Hardcore Reviews
Hardcore Reviews

AI Agent Memory Tools Compared: Mem0, Zep, Letta, and How to Pick

A comparison of 6 AI agent memory tools: Mem0 (layered memory), Zep (graph memory), Letta (runtime memory, MemGPT lineage), LangMem, Graphiti (temporal knowledge graph), and Cognee. Two comparison tables (architecture/integration) plus a decision tree. Representative comparison, not hands-on, per official docs.

Published August 2, 20268 min read
<!-- ai-agent-memory-tools-comparison-review | review | AI Agent Memory Tools Compared: Mem0, Zep, Letta, and How to Pick -->

AI agents keep getting smarter, but they share one embarrassing flaw: goldfish memory. You spend half an hour laying out requirements, come back tomorrow, and the agent blinks: "I don't have any prior conversation on file." By 2026, "give your agent a brain" is no longer optional-the open-source world has coughed up seven or eight memory-specific projects in a rush, with names that sound like they were squatted in a land grab: Mem0, Zep, Letta, LangMem, Graphiti, Cognee, Supermemory. A newcomer cannot tell them apart. This piece picks six of the most representative, compares them side by side, and gives you a per-scenario verdict instead of a vanity ranking.

One thing up front: every comparison below is a representative comparison based on each project's official docs, GitHub repo, and public description, not a benchmark I ran myself. Memory architectures, positioning, and features shift over time; treat each tool's official latest docs as the source of truth, not this article as a contract.

1. Why everyone is bolting memory onto agents in 2026

LLMs are stateless by nature. Every call is a blank slate; what passes for "memory" is just old conversation stuffed back into the context window. Once the window fills, old content gets truncated and the agent develops amnesia. Fine for one-shot tasks, a disaster for long-horizon work: a support agent forgets the bug a user reported last week; a writing agent drops the persona you defined; a personal assistant loses the preferences you mentioned.

The memory category exploded in 2026 for one root reason: agents graduated from "single-turn Q&A" to "long-horizon autonomous tasks." Once an agent has to persist across sessions, across days, or across users, memory becomes infrastructure. So the projects each bet on a different horse: some make memory an add-on "layer," some build it as a graph, some fold it into the agent's own runtime and let the agent manage it. Hold those bets in your head and the design tradeoffs below start to make sense. There is no all-rounder here.

Four questions to ask yourself before shopping: Is your agent long-horizon conversation or institutional knowledge management? Do you want the agent to decide what to remember, or do you want to control it centrally? Are you already on a framework like LangChain, or building from scratch? Can your data leave the country (managed cloud) or must it stay in-house (self-hosted)? Four answers and the pick basically locks itself.

2. The six contenders

Here is the lineup. Positioning and architecture come from each project's official docs and GitHub description, not from hands-on testing.

ToolMemory architectureProvenance / traceabilityPersonalizationInstitutional knowledgeOpen source
Mem0Memory layer (add-on)Four-layer provenanceYes (user/agent scoping)Weak (conversation-focused)Yes
ZepGraph-shaped memoryEpisode-levelYesMediumYes
LettaRuntime memory (agent-managed)Yes (memory ops traceable)Strong (agent self-prunes)WeakYes
LangMemMemory layer (add-on)BasicYesWeakYes
GraphitiGraph memory (temporal KG)Yes (temporal edges)MediumMediumYes
CogneeKnowledge graph (ECL pipeline)YesStrong (personalization layer)StrongYes

A few key gaps to call out. First, memory architecture splits into three camps: Mem0 and LangMem are "add-on layers"-you slot them between your agent and the LLM, and they handle extraction, storage, and retrieval without touching the agent itself; Zep and Graphiti are "graph-shaped"-they organize memory as a knowledge graph where entities and relationships are first-class citizens, not flat lists of facts; Letta is "runtime memory"-memory is part of the agent's runtime, and the agent itself decides what to remember and forget via function calls, an idea inherited from MemGPT's OS-style memory management.

Second, provenance (traceability) is the new focal point of the 2026 memory lane. Mem0 touts a four-layer provenance system; Zep does episode-level tracing-every memory is bound to the conversation that produced it. This is not garnish; for compliance and debugging it is a hard requirement. When an agent says something wrong, you need to trace which memory caused it.

Third, all six are open source, but to different degrees. Mem0, Zep, and Letta each offer self-hosted plus managed cloud; LangMem and Graphiti are pure libraries you embed in your app; Cognee is framework-grade, leaning toward self-built pipelines. So "is it open source?" is not the dividing line- "how does it integrate?" is.

3. One by one: each tool's best range

Mem0: the add-on memory layer, lightest to bolt on

Mem0 positions itself as "a memory layer for AI applications." You already have an agent, you do not want to rewrite it, so you slot Mem0 in the middle. It auto-extracts memories from conversations, stores them scoped by user and agent, and retrieves the relevant ones to inject back into context on the next turn. The official docs emphasize a four-layer provenance system, which addresses "where did this memory come from, who produced it, when, and is it still valid."

Its bet is "lightweight and add-on." Lightweight means no agent rewrite-a few lines of code and you are in. Add-on means it does not lock you to a framework: LangChain, CrewAI, or your own hand-rolled agent all work. Python and JS SDKs, with both open-source self-hosting and a managed Mem0 Cloud.

Best for: teams with an agent already in production who want to add memory fast without re-architecting. Its sweet spot is conversation memory-remembering user preferences, past interactions, context. What it is not built for is institutional knowledge management; turning company docs into a structured knowledge graph is not its lane.

Zep: graph-shaped memory, the king of long-term conversation and entity relationships

Zep's core is graph-shaped memory. Instead of storing memories as a flat list of facts, it organizes them into a knowledge graph-entities the user mentioned, relationships between them, event timelines all live as nodes and edges. The docs emphasize episode-level provenance: every memory is bound to the conversation episode that produced it, so you can trace any fact back to its origin.

Its bet is "graph plus temporal." Graph buys you multi-hop reasoning: "how does the company the user mentioned relate to the project they brought up last week?" Flat memory cannot answer that; a graph can. Temporal buys you "expiry" handling: when a user changes their address, Zep marks the old one invalid instead of overwriting it, preserving history. Zep offers open-source self-hosting and a managed cloud.

Best for: long-horizon conversation scenarios, support agents that must remember user and entity relationships, and any case where you need temporal management of memories (which are still valid, which have expired). If your agent's core value is "remembering how people and organizations relate," Zep's graph beats a flat memory layer by a tier.

Letta: runtime memory, the agent manages its own brain

Letta is the productized version of MemGPT (a UC Berkeley research project that ported operating-system memory management ideas onto LLMs). The core difference: memory is not an external layer or service, it is part of the agent's runtime. The agent itself manages memory through function calls-pushing the non-urgent stuff into "archival memory," paging what it needs back into main context, actively deciding what to remember and what to forget.

Its bet is "runtime memory plus self-management." Other designs hard-code memory logic in your code; Letta hands the keys to the agent-it calls memory tools to read and write, the way a person decides "I should write this down." The upside is the agent can dynamically prune memory per task, giving the highest personalization. The downside is memory quality depends on the agent's own judgment, which is less controllable than rules you hard-code.

Best for: long-horizon autonomous agents, scenarios needing deep personalized memory, research-grade projects. If you just want "store every conversation so nothing is lost," Mem0 or Zep is more direct; if you want "let the agent decide what is worth remembering," Letta is the only option.

LangMem: the lightweight memory library native to LangChain

LangMem is the memory library from the LangChain team, positioned as "an add-on memory layer for LangChain/LangGraph agents." It is not a standalone service but a library embedded in your app-it gives you primitives for extraction, storage, and retrieval, and you wire them into your LangGraph state yourself.

Its bet is "ecosystem-native." If you are already building agents in LangGraph, adding LangMem is near-zero friction: it aligns naturally with your existing state, checkpoints, and tool definitions, no need to wire in a separate external memory service. The cost: it is a library, not a platform. No out-of-the-box managed cloud, and you provision the storage backend (Postgres, a vector store, etc.) yourself. Feature-wise it skews basic, without Zep's graph structure or temporal reasoning.

Best for: LangChain/LangGraph users with modest memory needs who are willing to assemble their own storage backend. Outside the LangChain ecosystem, there is little reason to pick it.

Graphiti: temporal knowledge graph engine, Zep's graph brain unbundled

Graphiti comes from the same team as Zep (getzep); it is the engine behind Zep's graph-shaped memory, released as a standalone open-source library. It is not a memory service but a "build temporal knowledge graphs" engine-you feed it data and it constructs a knowledge graph with timelines, where entities, relationships, and events all carry temporal markers.

Its bet is "graph engine plus temporal." Its relationship to Zep: Zep is the finished product (turnkey), Graphiti is the engine (you build the car). It suits teams that want to build their own graph memory system, need deep control over graph-construction logic, or want to embed a temporal knowledge graph into their own product. The cost is you write the integration and memory-management logic yourself, so the barrier is higher than just using Zep.

Best for: dev teams building their own graph memory, those with custom graph-construction needs, or projects that refuse to be locked into Zep's managed cloud. If you just want graph memory that works, go straight to Zep.

Cognee: institutional knowledge plus personalization, the enterprise KM route

Cognee takes a different road: not just conversation memory, but ingesting institutional documents, wikis, and knowledge bases to build a knowledge graph, with personalization layered on so different users see different knowledge views. Its pipeline is called ECL (Extract-Cognify-Load)-extract entities and relationships from unstructured data, build the graph, load it into storage.

Its bet is "institutional knowledge plus personalization." The previous five skew toward conversation memory-remembering what was said with a user; Cognee skews toward knowledge management-turning organizational knowledge into a structured graph, then personalizing it per user. That positioning gives it no direct competitor in the enterprise KM lane, but it also means it is overkill for "add memory to my chatbot."

Best for: enterprise teams that need to structure internal knowledge, personalize knowledge by role, and turn document/wiki repositories into a queryable graph. If your need is "remember user preferences," Cognee is too heavy.

4. Integration method and best-fit scenarios

Pull the integration dimensions into their own table; this is usually the practical deciding factor.

ToolIntegrationEcosystem / languageDeploymentBest scenario
Mem0SDK/library + managed cloudPython/JS, framework-agnosticSelf-host / cloudAdd memory to an existing agent
ZepStandalone service (API)Python/JS SDKSelf-host / cloudLong-term conversation, entity-relationship memory
LettaRuntime/frameworkPython SDKSelf-host / cloudLong-horizon agent that self-manages memory
LangMemLibrary (LangChain ecosystem)Python, LangChain/LangGraphEmbedded in appLightweight memory inside LangChain
GraphitiLibrary (temporal KG engine)PythonEmbedded in appBuild your own graph memory system
CogneeFramework/libraryPythonSelf-hostInstitutional knowledge management + personalization

Two more worth a mention: Supermemory is a lighter open-source memory layer, positioned similar to Mem0 but leaning harder toward "turnkey," suited to solo developers who want the simplest possible integration; Cloudflare has folded memory into its AI platform (Workers AI and friends), coupling memory and compute together, which suits projects already in the Cloudflare ecosystem but locks you to the platform. Both are narrower in positioning, so the main comparison stays with the six above.

5. A decision tree: four scenarios

Do not pick by hype; pick by the job.

Scenario one: add memory to an existing agent without re-architecting. Pick Mem0. It is designed for "add-on," a few lines to slot in, framework-agnostic, with both self-hosting and managed cloud. Your need is "remember user preferences and past interactions," and that is Mem0's sweet spot.

Scenario two: long-horizon conversation, remembering people and entity relationships. Pick Zep. Graph-shaped memory beats flat memory layers on multi-hop reasoning and relationship recall. Support, CRM, personal assistants-any case where "relationships are the core"-are where Zep's graph-plus-temporal combo is strongest. If you want to build your own graph engine, look at Graphiti.

Scenario three: let the agent decide what to remember. Pick Letta. It is the only one that hands memory-management authority to the agent-runtime memory, agent-driven paging. Long-horizon autonomous agents, deep personalized memory, research projects-Letta's MemGPT lineage is a unique edge.

Scenario four: enterprise knowledge management plus personalization. Pick Cognee. It is not a conversation-memory tool; it is a knowledge-graph builder that structures institutional knowledge and personalizes per user. None of the other five are built for this.

A couple of common combos. One: Mem0 for conversation memory plus Cognee for institutional knowledge, splitting the two dimensions. Two: LangMem embedded in LangGraph for lightweight memory plus Zep as a standalone relationship-graph service, dividing labor by complexity. Memory tools are not a single-choice question; pairing by scenario is more realistic.

6. Three pitfalls: stale info, memory noise, platform lock-in

First, stale information is the number-one trap. A user changes their address, switches jobs, or a preference goes out of date. If the memory layer only appends and never invalidates, the agent will answer from stale data. Zep's temporal graph and Letta's agent self-management both handle "mark invalid" instead of "overwrite," and Mem0's provenance system supports memory updates. Before you pick, confirm the tool can handle "expiry"; if it cannot, you will need to add a pruning layer yourself.

Second, memory noise will drag down retrieval. Remembering everything is as good as remembering nothing-if the memory layer stores every casual remark, retrieval gets flooded with irrelevant memories. Letta letting the agent self-prune is one fix; Mem0 and Zep rely on extraction strategies to filter. Pay attention to a tool's memory-extraction strategy and do not let it blindly persist everything.

Third, platform lock-in is a real bill to settle. Managed clouds (Mem0 Cloud, Zep Cloud, Letta Cloud) save effort but your memory data lives in someone else's hands, and migration cost is not trivial. Cloudflare's platform coupling is more extreme-memory is bound to its AI runtime, and leaving Cloudflare means leaving the memory behind. Before production, think it through: can the data leave the country, do you need self-hosting, and can you stomach the migration cost.

FAQ

Q: What is the difference between a memory layer and runtime memory? A: A memory layer (Mem0, LangMem) treats memory as an external module-the agent runs however it runs, and the memory layer extracts and retrieves alongside it, with the agent uninvolved in memory-management decisions. Runtime memory (Letta) folds memory into the agent's runtime-the agent itself reads and writes memory through function calls, actively deciding what to remember and what to forget, the way a person decides to jot something down. The former is controllable and easy to integrate; the latter is more flexible and personalizes better, but memory quality depends on the agent's own judgment.

Q: How do I choose? A: Four questions set the direction. Existing agent that needs memory: Mem0. Long-term conversation with relationships: Zep. Agent-managed memory: Letta. LangChain user with light needs: LangMem. Enterprise knowledge management: Cognee. Want to build your own graph engine: Graphiti. Lock onto your core scenario first; do not pick by star count.

Q: How do memory tools relate to RAG? A: Highly complementary but not the same thing. RAG retrieves relevant documents from an external knowledge base to feed the model, solving "knowledge the model does not know"-your product manuals, company policies. Memory tools remember historical interactions with a user, solving "context the model forgot"-preferences a user mentioned last week. Many agents need both: a memory tool for user context, RAG for external knowledge. Mem0 and Zep can ingest external data too, but their strength is interaction memory.

Q: Which one for production? A: Mem0 and Zep both offer mature self-hosted plus managed-cloud dual tracks, so production readiness is highest. Mem0 fits the "memory layer" scenario, Zep the "graph memory" scenario. Letta's runtime memory is better suited to research-grade or highly customized long-horizon agents; production maturity is catching up but the positioning is unique. LangMem and Graphiti are libraries, so productionizing them means building your own storage and ops. If data cannot leave the country, pick the self-hosted editions.

Q: What happens when an agent remembers stale information? A: This is a core design problem for memory tools, and a key thing to check at selection time. Zep uses a temporal graph to mark a memory's validity window, so stale info is flagged invalid rather than deleted. Letta lets the agent judge which memories need updating. Mem0's provenance system supports memory updates and pruning. Whichever you pick, add a "memory expiry check" at the business layer-periodic audits, memory refreshes triggered by key-info changes-do not rely entirely on the tool to handle it automatically.


References

This article is AI-assisted and human-edited. Last updated: 2026-08-02

FAQ

What is the difference between a memory layer and runtime memory?
A memory layer (Mem0, LangMem) treats memory as an external module-the agent runs however it runs, and the memory layer extracts and retrieves alongside it, with the agent uninvolved in memory-management decisions. Runtime memory (Letta) folds memory into the agent's runtime-the agent itself reads and writes memory through function calls, actively deciding what to remember and what to forget, the way a person decides to jot something down. The former is controllable and easy to integrate; the latter is more flexible and personalizes better, but memory quality depends on the agent's own judgment.
How do I choose?
Four questions set the direction. Existing agent that needs memory: Mem0. Long-term conversation with relationships: Zep. Agent-managed memory: Letta. LangChain user with light needs: LangMem. Enterprise knowledge management: Cognee. Want to build your own graph engine: Graphiti. Lock onto your core scenario first; do not pick by star count.
How do memory tools relate to RAG?
Highly complementary but not the same thing. RAG retrieves relevant documents from an external knowledge base to feed the model, solving "knowledge the model does not know"-your product manuals, company policies. Memory tools remember historical interactions with a user, solving "context the model forgot"-preferences a user mentioned last week. Many agents need both: a memory tool for user context, RAG for external knowledge. Mem0 and Zep can ingest external data too, but their strength is interaction memory.
Which one for production?
Mem0 and Zep both offer mature self-hosted plus managed-cloud dual tracks, so production readiness is highest. Mem0 fits the "memory layer" scenario, Zep the "graph memory" scenario. Letta's runtime memory is better suited to research-grade or highly customized long-horizon agents; production maturity is catching up but the positioning is unique. LangMem and Graphiti are libraries, so productionizing them means building your own storage and ops. If data cannot leave the country, pick the self-hosted editions.
What happens when an agent remembers stale information?
This is a core design problem for memory tools, and a key thing to check at selection time. Zep uses a temporal graph to mark a memory's validity window, so stale info is flagged invalid rather than deleted. Letta lets the agent judge which memories need updating. Mem0's provenance system supports memory updates and pruning. Whichever you pick, add a "memory expiry check" at the business layer-periodic audits, memory refreshes triggered by key-info changes-do not rely entirely on the tool to handle it automatically.

Related