Anyone typing "best agent memory" into a search bar this year is really asking a narrower question: which of the five or six serious frameworks will fit the specific way my agent forgets things. That is a fair question, and it does not have one universal answer, because Mem0, Zep, Letta, Cognee and Supermemory each solved a different memory problem first and built outward from there. This guide compares them on the axes that actually predict fit: architecture, pricing, licence, and self-hosting, rather than on benchmark charts each vendor picked to flatter itself.
What counts as an agent memory framework?
An agent memory framework gives an LLM-based agent a way to keep facts across sessions instead of starting from a blank context window every time. Under that one description sit genuinely different designs. Some extract facts from conversation turns. Some build a graph of entities and their relationships over time. Some are a library you embed in your own agent code, and others are a hosted service you call over an API.
That variety is why a single "best" answer misleads more than it helps. A tool built to remember a user's flight preferences is not competing for the same job as a tool built to answer "what was our pricing tier three months ago." Treating them as interchangeable is the fastest way to pick wrong.
The frameworks worth comparing in 2026
| Framework | Core architecture | Self-hosting | Licence | Pricing (2026) |
|---|---|---|---|---|
| Mem0 | Extracts durable facts from conversation turns into a per-user or per-agent memory store | Yes, open source core | MIT | Free tier; $19/mo Starter; $249/mo Pro |
| Zep | Temporal knowledge graph (Graphiti) tracking when facts changed, not just their current state | Community Edition deprecated April 2025; self-host Graphiti directly against Neo4j, FalkorDB or Kuzu | Graphiti: MIT. Zep Cloud: proprietary | Zep Cloud from around $125/mo |
| Letta | Full stateful agent runtime with in-context and persistent memory blocks a developer controls directly | Yes, free to self-host | Apache 2.0 (core) | Free self-hosted; Pro hosted around $20/mo |
| Cognee | Ingests mixed data formats into a structured, traversable knowledge graph agents can query and update | Yes, developer-assembled | Apache 2.0 | Free open source core; enterprise on request |
| Supermemory | Hybrid semantic search and memory extraction, offered as a hosted API or a single self-hosted binary | Yes, free single-binary option, zero config | Self-hosted core: open; hosted platform: closed | Free tier; $19/mo Pro; $399/mo Scale |
| Contextely | Condenses facts from a company's existing systems of record, with entitlement scored inside retrieval ranking | Yes, first-class | Proprietary | Usage-based pricing |
Table 1: six agent memory options compared on architecture, hosting, licence and price as of September 2026. Pricing and licensing details change; verify against each vendor's own page before committing.
A few things are worth pulling out of that table rather than leaving buried in it. Mem0 and Letta both jumped their pricing structures during 2026, Mem0 retiring its middle $79 tier in July and leaving a sizeable gap between $19 and $249. Zep's self-hosting story is genuinely different from the other four: the packaged server is gone, and what remains is the open engine underneath it, which is a real option but a different amount of assembly work than downloading Letta or Cognee.
"The emergence of writable, cross-session persistent memory in LLM agents introduces a qualitatively different threat landscape from conventional input-centric security concerns, characterized by three properties: persistence, statefulness, and propagation."
A Survey on the Security of Long-Term Memory in LLM Agents, arXiv, 2026
That line matters beyond the security framing it was written for. A memory store that writes and persists across sessions carries every mistake forward with it, which is exactly why the same paper argues protections have to be designed in at storage time rather than bolted on at query time. The same logic applies to entitlement: checking who is allowed to see a fact after it has already been condensed into an agent's long-term store is much harder than deciding at the point the fact is written.
Architecture: vector store, graph, or something else?
Mem0's default path is closer to a vector store with an extraction step in front of it: a conversation goes in, an LLM call decides what is worth keeping, and the result lands in a per-user memory space. Zep and Cognee both lean on a knowledge graph instead, which is a heavier structure to reason about but pays off the moment your questions are about relationships between named things rather than plain recall. Letta sits apart from both, because it is not really a memory store on its own, it is an agent runtime that happens to expose memory as a first-class, developer-controlled concept.
Self-hosting and licensing, properly checked
"Open source" and "self-hosted" get used loosely enough in this space that it is worth reading the actual repository rather than the landing page. Mem0's MIT core and Graphiti's MIT core are the least restrictive starting points on this list. Cognee and Letta both ship under Apache 2.0, which is also permissive but carries a patent grant clause worth a quick legal read if that matters to your organisation. Supermemory is the odd one out structurally: the self-hosted binary is free and open, but the hosted platform sitting behind supermemory.ai is closed source, so "self-hosted Supermemory" and "Supermemory the product" are not quite the same licence commitment.
How do you choose an agent memory framework for production?
Skip the feature comparison chart for a moment and write down, in one sentence, what your agent actually fails at today. That sentence usually sorts you into one of four buckets faster than any benchmark would.
- The agent forgets what a user told it last session. That is conversational recall, and it is Mem0's whole reason for existing. Its API is small, its free tier is genuinely usable for a prototype, and the jump to $249/month only bites once you need graph memory or serious volume.
- The agent needs to reason about what changed, not just what is currently true. That is temporal memory, and Zep's Graphiti engine is built for exactly this. Be honest with yourself about the self-hosting cost, though: since the Community Edition's deprecation, running this yourself means operating Graphiti against a graph database directly, not deploying a packaged Zep server.
- You are building an agent from scratch and want to own its memory design. Letta gives you memory blocks, tools, and a real runtime rather than a black box, at the cost of writing more of the surrounding integration yourself.
- Many different people, or other software, need answers from a shared and changing set of company facts, each with different access rights. None of the five frameworks above were built around that specific requirement, which is a narrower, less crowded category than general agent memory.
What breaks first when you wire this into a real multi-tenant app
When we tried wiring a popular conversational memory layer into an early multi-tenant prototype, the first thing that broke was not retrieval quality, it was namespacing. The default unit of separation was a single user or agent id, which is exactly right for a consumer assistant remembering one person's preferences. The moment two different customer accounts shared an underlying workspace, that same default put both customers' facts one misconfigured id away from landing in the same memory space. We ended up building an explicit workspace-level partition on top, by hand, before we could trust the store with a second tenant's data. That is not a criticism of the framework doing its actual job badly. It is a reminder that a memory layer designed for one asker per store needs real, deliberate work bolted on before it is safe for many askers per store, and that work is easy to skip under a deadline.
Is there a good open source ai memory option?
Yes, more than one, and the honest answer depends on how much assembly you are willing to do. Mem0 and Graphiti are the most straightforwardly open, MIT licensed, and usable close to out of the box. Cognee is open under Apache 2.0 and growing quickly, with a genuinely flexible pipeline if you are comfortable assembling your own graph or vector backend behind it. Letta is free to self-host entirely and gives you the most architectural control of the four, which is also why it asks the most of you as a developer. If your requirement is specifically self-hosting with the smallest possible operational footprint, Supermemory's single-binary option is worth a look precisely because it skips the separate database provisioning step the others assume you will handle yourself. A full self-hosted ai memory setup guide walks through what that operational cost looks like in practice, beyond the licence line on a landing page.
The gap none of these five close
Every framework above does a real, useful job at the thing it was built for. None of them were built to answer a different, quieter question that comes up the moment more than one person is asking: given who is asking, what are they actually allowed to see. Mem0's memory spaces separate data by user or agent, which is a form of isolation, but it is not the same as scoring a result by a specific asker's permissions inside the ranking itself. How these tools compare on that exact axis goes further into the difference between separation and entitlement, and the individual reviews of Mem0, Zep, Letta and Cognee each cover where that specific tool's design stops.
None of that makes the five frameworks above the wrong choice for most teams evaluating agent memory today. It makes them the right choice for a narrower job than "give my whole company's AI tools memory," which is a different, harder problem with its own shortlist and its own pricing model.
