What it does
Every memory layer does three jobs, whatever it calls them:
- Write. Take in conversations, documents or events and decide what is worth storing: raw text, extracted facts, summaries, or all three.
- Maintain. Reconcile new information with old. People change jobs, plans and preferences; a store that only appends will confidently return the stale answer.
- Read. Given the current task, return the small set of items that matter, ideally with dates and sources attached.
The main designs
Fact extraction into a vector store
A model pulls discrete facts out of each interaction, embeds them and stores them for similarity search. Mem0 is the best-known example. It is simple and cheap to query; its weakness is anything that depends on relationships between facts or on time.
Temporal knowledge graphs
Facts become edges between entities, each with a validity period, so the system can say what was true when. Zep, through its open-source Graphiti library, and Cognee take this route.
Self-editing agent memory
The agent itself decides what to write to and read from its memory, using tools. Letta, formerly MemGPT, established the pattern; Anthropic's memory tool is a file-based version of the same idea.
Observation logs
Background agents compress the running conversation into a dense log of observations that stays in the prompt. Mastra's Observational Memory works this way.
Hybrid retrieval over structured facts
Several newer systems extract typed facts and then search them several ways at once (semantic, keyword, graph, temporal) before reranking. Hindsight describes this design in its paper.
Plain files
Store the transcripts as files and let the agent search them with ordinary tools. Letta showed this scoring 74.0 on LoCoMo with GPT-4o-mini, above purpose-built systems of the time, which says as much about that benchmark as about files.
Do you need one, or just a bigger prompt?
With 1M-token windows now standard on flagship models, the honest first question is whether the history fits. If a user's entire history is a few tens of thousands of tokens and you answer occasionally, sending all of it may be the right design. A memory layer earns its place when at least one of these is true:
- The history is, or will become, larger than the window.
- You answer often enough that resending the history on every call dominates your bill or your latency.
- Facts change over time and the model must know which version is current.
- Different people are allowed to see different parts of the history.
- The agent has to act on what it knows without being asked a question that points at the right fact.
That list is also a guide to which benchmarks to read. Size is tested by BEAM's 10M tier, acting without a cue and cost by DolphinBench, and knowledge updates by parts of BEAM and LongMemEval. Access control is not tested by any public benchmark we know of.