Why Your AI Agent Keeps Forgetting
Your agent does not have a memory problem. It has a memory architecture problem. The four kinds of agent memory, where each one lives, and why a context window was never going to be enough.
How AI agents remember: working, episodic, semantic, and procedural memory, the limits of the context window, retrieval, and the knowledge graph as the long-term semantic store. The architecture behind agents that do not forget.
Your agent does not have a memory problem. It has a memory architecture problem. The four kinds of agent memory, where each one lives, and why a context window was never going to be enough.
Ordered by chapter. Each post stands alone but builds on the one before it.
Mem0 or Graphiti? The honest answer is not a benchmark, it is one question: do the facts your agent remembers change over time? Plus the costs no vendor quotes, and when to build your own graph instead.
Your agent’s memory store is probably fine. Its retrieval is the bug. Top-k by similarity is a lookup; production memory retrieval is a ranking problem. How to rank by relevance, recency, and importance, retrieve then rerank, combine vector, keyword, and graph, and assemble it all into a limited window.
A bigger context window does not give your agent a memory. The window is a cache: finite, expensive, and used less reliably as it fills, so a long session always overflows it. The real lever at scale is the working-memory policy that decides what stays: pin the invariants, keep recent turns, compact the warm middle, and offload the cold to a store you re-retrieve from. Manage the window, or the cost of the conversation grows with the square of its length while the agent forgets the one constraint that mattered.
Storing everything is not a memory. An agent that saves every turn drowns in stale, contradictory facts and pays to retrieve noise, while the one detail that mattered gets buried. The fix is the write path: extract the durable facts, summarize only the narrative, reconcile contradictions with a timestamp instead of overwriting, and let stale memory decay. Run that pass in the background and your agent gets sharper the longer it runs. Skip it and you have built an expensive landfill with excellent search.
You shortlisted a memory system by its leaderboard rank, shipped it, and it forgets in production. The public benchmarks cannot tell you which system will work for your problem, and several cannot reliably tell which is better at all: a no-memory baseline tops the leaderboard, the answer key is partly wrong, and the automatic judge accepts most wrong answers. So build your own evaluation on your own data. Split retrieval from the answer, score retrieval with real ranking metrics, add the four checks generic RAG eval skips, consistency, recency, abstention, and forgetting, calibrate the judge instead of obeying it, and put cost and latency next to accuracy.