Memory-Augmented Agent
Persistent long-term memory across sessions
The agent loads memories from a JSON store at the start of each session, retrieves only the relevant ones, incorporates them into its response, then consolidates new learnings before exiting.
Memory-Augmented agents maintain continuity across conversations by persisting knowledge beyond a single session. At startup, the agent loads all memories from a JSON file and runs a relevance filter — using an LLM to select which memories are pertinent to the current question. This prevents context bloat from irrelevant history.
Three memory types reflect different kinds of knowledge: **episodic** memories (past interactions and their outcomes), **semantic** memories (facts learned about the domain), and **procedural** memories (learned strategies and preferences). Each type is tagged so the retrieval filter can reason about relevance by type.
After responding, the `consolidate` node extracts new learnings from the interaction and appends them to the persistent store with a timestamp. Over time, the agent becomes increasingly personalized and effective for its specific user and domain — building genuine long-term memory.