Search for AI agent memory and you get two very different kinds of result: vendors selling a memory layer, and papers proving that the layer you already have does not work. Both are right, because “memory” is being used for at least four different things, stored in at least three different places, and measured by benchmarks that test only one of them.
The useful definition is narrower than the marketing. Agent memory is whatever has to survive the context window. Everything else is just a long prompt. Once you frame it that way, the design question stops being “which memory product” and becomes three smaller ones: what gets written, when it gets written, and where it lives when the context is gone.
What AI agent memory has to do that context cannot
The context window is where the model thinks, and it is a terrible place to keep things. It is bounded, it is expensive per token, and in any long-running task it will be reset. Anthropic’s memory tool documentation states the operating assumption as bluntly as a system prompt can: “ASSUME INTERRUPTION: Your context window might be reset at any moment, so you risk losing any progress that is not recorded in your memory directory.”
The benchmarks say the same thing in numbers. LongMemEval (Wu et al., ICLR 2025) embeds 500 questions inside long user-assistant histories and tests five abilities: information extraction, multi-session reasoning, temporal reasoning, knowledge updates and knowing when to abstain. Its headline finding was a roughly 30% accuracy drop for commercial chat assistants and long-context models once information had to be remembered across sustained interaction. LoCoMo (Maharana et al., 2024), the other standard benchmark, builds conversations of about 300 turns over up to 35 sessions and found that long-context models and retrieval both help but “substantially lag behind human performance.”
So the failure is not hypothetical. A bigger window buys time; it does not buy memory. What follows is what actually does.
Four things people mean by memory
The cleanest taxonomy comes from the CoALA paper (Sumers, Yao, Narasimhan and Griffiths, 2023), which borrowed it from cognitive science and it has since become the default vocabulary in framework documentation:
- Working memory “maintains active and readily available information as symbolic variables for the current decision cycle.” That is the context window plus whatever state your loop carries between calls.
- Episodic memory “stores experience from earlier decision cycles”: past trajectories, what happened last time this task was attempted.
- Semantic memory “stores an agent’s knowledge about the world and itself”: facts, preferences, entities.
- Procedural memory is the odd one. CoALA says language agents hold it in two forms, “implicit knowledge stored in the LLM weights, and explicit knowledge written in the agent’s code.”
LangChain’s LangGraph documentation maps the same three long-term types onto engineering: semantic memory is “facts or concepts from past interactions,” episodic memory is typically implemented as few-shot examples of how a task was done, and procedural memory is “model weights, agent code, and agent’s prompt.” That last mapping matters for a reason we covered in our piece on MCP, Skills and AGENTS.md: an instructions file that is always in context is procedural memory, just the cheapest possible kind. Most “memory” products sell semantic memory only.
One more distinction the documentation draws and buyers often miss. Conversation history is not long-term memory. OpenAI’s Agents SDK sessions retrieve “the conversation history for the session” and prepend it before each run, with backends from SQLite to Redis to OpenAI’s own Conversations API. LangGraph does the same with thread-scoped checkpointers. Both are working memory that happens to be persisted. Long-term memory, in LangGraph’s phrasing, is “shared across conversational threads.” If your memory does not outlive the thread, you have a transcript.
Three places to keep it
Strip the branding and there are three architectural answers to “where does memory live.” Most production systems combine two.
1. In the context, but edited by the agent
The MemGPT paper (Packer et al., October 2023) introduced this pattern under the name virtual context management: treat the context window as main memory and give the model tiers behind it, “inspired by hierarchical memory systems in traditional operating systems.” Its commercial descendant, Letta, exposes the idea as memory blocks: “structured sections of the agent’s context window that persist across all interactions,” pinned to the system prompt, size-limited, and rewritten by the agent through its own memory tools. Anything not pinned lives in archival storage outside the window and has to be retrieved.
Anthropic’s memory tool is the same lineage with files instead of blocks. Claude reads and writes a /memories directory; the application executes every file operation, so “memory lives entirely in your application.” The documentation frames it as just-in-time retrieval: “Rather than loading all relevant information up front, an agent records what it learns in memory files and reads them back on demand.” Anthropic’s own context engineering guide pairs it with compaction, which summarises a conversation near its limit and restarts with the summary, and with sub-agents that “return only a condensed, distilled summary of its work (often 1,000-2,000 tokens).”
This is the architecture for procedural and progress memory: what the task is, what has been decided, what is left. It is cheap, inspectable and the agent controls the write. Its weakness is scale. A directory of notes does not answer “what did the user say about invoices in March” once there are thousands of sessions.
2. Extracted facts in a store
The second pattern extracts facts from each turn, deduplicates and consolidates them, and stores them for retrieval. The Mem0 paper (Chhikara et al., April 2025) describes it as “dynamically extracting, consolidating, and retrieving salient information from ongoing conversations,” optionally with a graph variant for relationships between entities. On LoCoMo it reported a 26% relative gain over OpenAI’s built-in memory on an LLM-as-judge metric, and against feeding the full history it claimed 91% lower p95 latency and over 90% token savings.
LangGraph offers the same shape as a primitive: long-term memory is “JSON documents in a store,” organised by namespace rather than thread. Its documentation also names the timing decision every team eventually hits. Writing memory “in the hot path” during the run gives immediate availability at the cost of latency; writing it “as a separate background task” removes the latency and “separates application logic from memory management,” at the cost of a window where the agent does not yet know what it just learned.
This is the architecture for semantic memory at scale, and it is what most memory vendors sell. Its weakness is that extraction is lossy and the store goes stale: a fact that was true in March is retrieved with the same confidence in September.
3. Consolidation by the model itself
The third pattern removes the embedding index altogether. Google Cloud’s open-source Always-On Memory Agent, published under the GoogleCloudPlatform GitHub organisation with an MIT licence, runs three agents on Gemini 3.1 Flash-Lite: an ingest agent that reads 27 file types, a consolidate agent on a timer (“default: every 30 minutes”) that reviews, connects and compresses memories, and a query agent that answers with citations. The README is explicit about what is missing: “No vector database. No embeddings. Just an LLM that reads, thinks, and writes structured memory” into SQLite.
We covered the release in July; the point here is architectural. Consolidation trades retrieval precision for coherence. The memory reads like notes a person kept, and it costs a background inference bill instead of a vector database. It is a sample repository, not a managed product, and the trade-off has not been benchmarked against the other two patterns by anyone independent.
What the benchmarks show, and what they leave out
Mem0’s State of AI Agent Memory 2026 report (April 2026) gives the clearest current picture, with the obvious caveat that a vendor is reporting its own scores. Its algorithm posts 92.5 on LoCoMo and 94.4 on LongMemEval at roughly 6,900 tokens per query, against about 26,000 tokens for a full-context baseline. That is a smaller saving than the “over 90%” the 2025 paper claimed on a different setup; both numbers are Mem0’s, so treat them as a range, not a fact. The same report also shows the ceiling: on the BEAM benchmark the score falls from 64.1 at one million tokens of history to 48.6 at ten million. Memory systems degrade with volume too, just more slowly than raw context.
The independent evidence is thinner but points the same way. AgentMemBench (Cherif, June 2026, a single-author preprint) compared five strategies: in-context windowing, external key-value retrieval, graph-based episodic memory, compression-based summarisation and web-augmented memory. On LoCoMo the retrieval approach reached Recall@5 of 0.573 while the recency window, the graph and the summariser retrieved “almost nothing (Recall@5 ≤ 0.005)”. The cost was real: about 5,100 tokens per query against about 300 for windowing. Retrieval wins at long horizons; it is not free.
Now the gap. Every benchmark above tests conversational recall: did the assistant remember what the user said. None of them tests the memory that agentic work actually depends on, which is progress and procedure across sessions of a task. Anthropic’s documentation offers a pattern for that, an initialiser session that writes a progress log and feature checklist, later sessions that read it first and update it last, but a pattern is a prescription, not a measurement. If your agent is a coding or operations agent rather than a chat companion, the published leaderboards measure the wrong thing.
Mem0’s report is candid about what remains open and its list is a good checklist for any architecture: cross-session identity, temporal abstraction, memory staleness, application-level evaluation, and privacy and consent. The last one is not a footnote. A store of extracted facts about a person is personal data by construction, and Anthropic’s memory tool documentation devotes a section to path-traversal attacks because a memory directory is also an attack surface. Memory is where prompt injection goes to become permanent.
Memory is not RAG, although it uses the same machinery
The two are constantly confused because the retrieval half looks identical: embed, index, fetch top-k. The difference is the write path. RAG retrieves from a corpus you gave the agent. Memory retrieves from what the agent wrote down about its own experience. In CoALA’s framing, “learning occurs by writing information to long-term memory,” and RAG does not learn; it looks up.
The practical consequence is that memory has problems RAG does not. Documents do not contradict themselves across time the way a user’s preferences do, so RAG rarely needs a knowledge-update policy. Memory always does, which is why LongMemEval scores knowledge updates as a separate ability and why Mem0’s report puts staleness on its open-problems list. If you already run an agentic RAG pipeline, you have the retrieval half of a memory system and none of the hard part.
A decision rule
Start from what has to survive, not from what a vendor stores.
- If it is progress on a task, use agent-edited notes in your own storage, plus compaction. This is the cheapest pattern, it is fully inspectable, and the frameworks from Anthropic, Letta and LangGraph all ship it. Most coding and operations agents need nothing else.
- If it is facts about a person across many sessions, you need an extraction-and-store layer, and you should decide up front whether you write in the hot path or in the background. Budget for the retrieval tokens the benchmarks show, and budget for a staleness policy the benchmarks do not.
- If it is a growing body of mixed material where coherence matters more than precise recall, the consolidation pattern is worth a prototype. Expect to evaluate it yourself, because no one else has.
- Evaluate on your task, not on LoCoMo. The published scores tell you a system can remember a conversation. They do not tell you it will remember your deployment checklist next Tuesday.
The context window will keep growing and it will keep not being memory. The agents that hold up over months are the ones that treat forgetting as a design constraint rather than a bug in the model, and write down, deliberately, what they cannot afford to lose.
Sources
- Anthropic — Memory tool documentation
- Anthropic — Effective context engineering for AI agents
- Sumers, Yao, Narasimhan, Griffiths — Cognitive Architectures for Language Agents (CoALA)
- Packer et al. — MemGPT: Towards LLMs as Operating Systems
- Letta — Memory blocks
- LangChain — LangGraph memory
- OpenAI — Agents SDK sessions
- Chhikara et al. — Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory
- Mem0 — State of AI Agent Memory 2026
- Google Cloud Platform — Always-On Memory Agent (GitHub README)
- Wu et al. — LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memory
- Maharana et al. — Evaluating Very Long-Term Conversational Memory of LLM Agents (LoCoMo)
- Cherif — AgentMemBench