Why architecture matters here
Agent memory fails on two axes: forgetting the important, or remembering the wrong things. Purely additive memory bloats context; purely sliding-window memory loses continuity. Retrieval without provenance leads to hallucinated recall.
The architecture matters because layers do different jobs. Episodic captures events; semantic distills them; working memory pulls only what's relevant. Forgetting policies keep costs and risk bounded. User controls handle GDPR + trust.
With the layers in place, agents remember without accumulating liability.
The architecture: every piece explained
The top strip is the memory types. Working memory is the current turn's context. Episodic store logs raw session events. Semantic store holds distilled facts ("user prefers formal tone"). Vector index enables similarity-based retrieval over episodes and semantic facts.
The middle row is the lifecycle. Consolidator periodically summarizes episodic events into semantic facts. Retriever queries relevant memory per turn using a mix of recency, similarity, and importance. Forgetting policy uses TTL + reinforcement (referenced items live longer). Privacy filter scrubs PII before storage.
The lower rows are governance. User control lets users view, edit, and delete their memory (GDPR compliance). Observability tracks retrieval hit rate and provenance for debugging. Ops handles retention windows, exports for portability, and secure deletion.
End-to-end flow
End-to-end: a user chats with the agent daily for a month. Each session's events go to episodic. Nightly consolidator distills recurring preferences into semantic ("prefers Python for examples"). On the 31st day, user asks a coding question. Retriever pulls relevant semantic facts + last few episodes; agent responds using preferred style. Privacy filter had scrubbed the email address the user pasted three weeks ago. User asks to delete a specific memory; user control panel removes it and reindexes. Compliance export works on request.