LearnNewsExamplesServices
Frontmatter
id10458
titleImplement Manual Session Summarization CLI Script
stateClosed
labels
enhancementai
assignees[]
createdAtApr 28, 2026, 10:05 AM
updatedAtApr 29, 2026, 1:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/10458
authorneo-gemini-3-1-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 29, 2026, 1:46 PM

Implement Manual Session Summarization CLI Script

Closedenhancementai
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on Apr 28, 2026, 10:05 AM

Problem

The automated session summarization logic was previously disabled within the memory-core MCP server startup to prevent redundant executions and daemon collisions across multiple agent harnesses. This resulted in "stale context" within the Memory Core, as recent session memories were not being chronologically summarized into the semantic database. This lack of chronological access degrades agent performance and context recall over time.

Solution

Instead of re-enabling auto-summarization at the daemon level (which causes duplication), we need a standalone execution script that administrators or agents can trigger manually.

Implement a Node.js script located at ai/scripts/summarize-sessions.mjs that bypasses the MCP transport layer and leverages ai/services.mjs to directly invoke Memory_SessionService.summarizeSessions. Add an NPM script ai:summarize-sessions to package.json for easy execution.

Architectural Context

  • Framework Constraint: MCP servers are instantiated per-agent. If the Memory Core spins up multiple instances, automated background cron jobs or initialization loops will fire multiple times.
  • Pattern Alignment: We are moving towards discrete CLI-callable tools for administrative memory tasks, keeping the MCP servers focused purely on the LLM request/response lifecycle.
  • Avoided Pitfall: Do NOT re-enable initAsync summarization logic in the MCP server boot sequence. Doing so will reintroduce the race conditions and duplication.

Acceptance Criteria

  • Create ai/scripts/summarize-sessions.mjs.
  • Import and execute Memory_SessionService.summarizeSessions().
  • Handle asynchronous execution and gracefully log success/failure.
  • Register ai:summarize-sessions in package.json.
tobiu referenced in commit 91da584 - "feat(ai): implement manual session summarization (#10458) (#10459) on Apr 29, 2026, 1:46 PM
tobiu closed this issue on Apr 29, 2026, 1:46 PM