To enhance long-term memory recall and provide high-level overviews of past work, this ticket covers the creation of a script that can summarize a completed agent session.
This script will serve as a data processing tool that can be run independently, without needing a full interactive agent session. It will read all the memories for a given session, use a generative model to create a concise summary, and store that summary in a new sessions database collection.
This creates a powerful, two-tiered memory system: a high-level index of session summaries, and a detailed log of individual interactions.
Workflow in Practice
- Initiation: The process is triggered via a command like
npm run ai:summarize-session -- --session-id <ID_of_session>.
- Memory Retrieval: The script connects to the
neo-agent-memory collection and retrieves all documents for the given session ID.
- Content Aggregation: It concatenates the
prompt, thought, and response from all memories into a single text block.
- Summarization: It sends this text to the Gemini API with a prompt to summarize the key goals, decisions, and outcomes of the session.
- Persistence: The resulting summary is saved as a new document in a new
sessions collection in ChromaDB.
Acceptance Criteria
- A new script is created (e.g.,
buildScripts/ai/summarizeSession.mjs).
- The script accepts a
sessionId as a command-line argument.
- A new ChromaDB collection (e.g.,
neo-agent-sessions) is created to store the summaries.
- The script successfully retrieves memories, generates a summary via the Gemini API, and stores it in the new collection.
- The
aiConfig.mjs file is updated with configuration for the new sessions collection.
To enhance long-term memory recall and provide high-level overviews of past work, this ticket covers the creation of a script that can summarize a completed agent session.
This script will serve as a data processing tool that can be run independently, without needing a full interactive agent session. It will read all the memories for a given session, use a generative model to create a concise summary, and store that summary in a new
sessionsdatabase collection.This creates a powerful, two-tiered memory system: a high-level index of session summaries, and a detailed log of individual interactions.
Workflow in Practice
npm run ai:summarize-session -- --session-id <ID_of_session>.neo-agent-memorycollection and retrieves all documents for the given session ID.prompt,thought, andresponsefrom all memories into a single text block.sessionscollection in ChromaDB.Acceptance Criteria
buildScripts/ai/summarizeSession.mjs).sessionIdas a command-line argument.neo-agent-sessions) is created to store the summaries.aiConfig.mjsfile is updated with configuration for the new sessions collection.