Agent memory layers compared: Mem0, Zep, Letta, Cognee and LangMem
Contents

Agent memory layers compared
Choose by the memory job
Choose an agent memory layer by the information you need to preserve and change. A preference record, a changing relationship and a shared working file are different jobs.
Start with the question the next run must answer
“We need memory” is too vague to choose a component. A support assistant may need to remember a customer’s preferred response format. A relationship assistant may need to distinguish a former account owner from the current one. Two coding agents may need to edit the same working notes.
All three involve persistence. They do not require the same representation or update behavior. The comparison below is a reading of current primary documentation, not a performance benchmark or hands-on evaluation. Features, hosted services and APIs change; verify the particular release and deployment you plan to use.
Five approaches worth distinguishing
The descriptions focus on the documented model for storing and changing information. A row is not a claim that the project supports only that use case.
| Project or approach | Documented mechanism | Question to test in your application |
|---|---|---|
| Mem0 | Memory records exposed through operations such as add, search, update and delete. Its MCP interface also lists events. | Does correcting a fact prevent the old version from resurfacing in your retrieval path? |
| Zep / Graphiti | Graphiti represents entities and relationships over time. Zep is a managed context platform using Graphiti-derived artifacts. | Can you retrieve the right relationship for the time the question asks about? |
| Letta | Current shared-memory guidance uses Git-backed repositories for participating agents. Legacy shared memory blocks remain supported. | How do agents pull updates and resolve conflicting edits in your workflow? |
| Cognee | Documents and conversations become searchable graph-based memory; self-hosted and hosted options have different operational responsibilities. | Does your document set produce useful retrieval, and can you inspect the supporting material? |
| LangMem | Utilities transform conversations into memories; core utilities are storage-independent, with stateful integrations using LangGraph stores. | Which writes belong in the response path, and which can wait for background processing? |
Read the source behind each row
Mem0’s MCP reference lists retrieval and mutation tools, plus event-related operations. It would be inaccurate to describe it as having no update, deletion or event controls. Whether those controls cover your full application is a separate question.
The Graphiti overview describes temporal relationships, historical context and retrieval, and distinguishes the open-source framework from Zep’s managed platform. Do not treat a benchmark on one configuration as a result for the other.
Letta’s shared-memory documentation describes repository-based sharing in Letta Cloud and separately discusses legacy blocks. Follow the documentation for the mode you actually deploy rather than combining old and new behavior into one imagined feature set.
Cognee’s documentation distinguishes its Python self-hosted engine from Cognee Cloud and describes graph-based memory. The location of the runtime and storage changes who operates the service; it does not alone establish what your application may disclose.
LangMem’s conceptual guide separates its core utilities from storage integration and discusses memory writes during or between conversations. The former can add response latency; the latter may leave a gap before a new memory is available.
A shortlist built from three concrete jobs
Imagine a fictional service business choosing memory for an assistant. Its first requirement is: “When a customer asks for a short reply, use that preference next time, and let them change it.” Begin by testing an explicit preference record and its update path. Mem0’s record operations or LangMem’s extraction utilities could be candidates. If a normal database row already meets the need, you may not need a separate memory framework.
The second requirement is: “Explain who owned account Rowan when the March request was made.” A single current-owner field loses the past. A temporal representation such as Graphiti is a candidate to evaluate, but the test must include dated ownership changes and questions about both past and present. Merely returning a relevant name is not enough.
The third is: “Two agents should maintain a shared research brief that a person can inspect.” Letta’s shared repository approach is relevant to that artifact. Compare it with the repository workflow your team already operates. Shared files make edits visible, but you still need a rule for conflicting changes and for when a draft becomes accepted.
Cognee becomes a more relevant candidate if the central problem is transforming a collection of documents into connected, retrievable information. That is a different selection criterion from remembering a single preference. These are starting hypotheses for a shortlist, not endorsements or claims that only one product can do each job.
Use a tiny evaluation before a large migration
Prepare a small fixture with three stages: the initial fact, a correction and a question after the correction. Include one question that should have no supported answer. For time-sensitive facts, add an “as of” date. For shared files, give two agents conflicting edits based on the same starting version.
Record whether the result is correct, what source supports it, what persists between runs and how long an update takes to become available. Measure cost and latency in the workload you expect to run. A public score from another dataset cannot settle those tradeoffs for you.
Keep source authorization separate from memory operations. An API that deletes a memory record has not thereby demonstrated deletion from every source, index, saved conversation or export. An event endpoint has not thereby demonstrated complete authorization auditing. See what accountable memory evidence proves for that distinction.
Choose the smallest fit you can explain
Before adopting a layer, finish this sentence: “We need to preserve this kind of state, update it this way, and retrieve it for this decision.” Then test that sentence against a small sample. If the answer remains “because agents need a brain,” the requirement is still unfinished.
HeyBrain publishes this comparison. It makes no claim that HeyBrain outperforms these projects or that the listed mechanisms automatically satisfy a company’s permission or retention requirements.
About this article
Written by the HeyBrain Editorial Team with AI assistance. The examples are fictional and illustrate design choices; they are not customer stories, product demonstrations or measured test results. Primary sources are linked beside the claims they support.


