Short version: I dug through eight memory layers for AI agents — actual repos and docs, not landing pages. Four patterns decide more than any benchmark: who writes memory, how it’s searched, what happens to contradictions, and what it costs in tokens. Below: each tool with sources, a comparison table, and an honest pick — including mine, with the same harsh treatment.
My coding agent kept forgetting what we decided yesterday. Not in a poetic sense — literally: every new session started with me re-reading the README, the changelog, and my own notes back to it, burning a few thousand tokens on “context we already agreed on.”
So I spent a couple of weeks digging through the memory-layer ecosystem. I also have a conflict of interest to declare upfront: I maintain one of the eight tools below (MaxGraph). I’ll flag my own biases and be as harsh on it as on the others. Star counts are from the GitHub API on 2026-10-19/20; prices are from official pricing pages captured 2026-10-10/20. For a deeper three-way dive into MaxGraph vs mem0 vs Zep specifically, see our earlier comparison.
What I looked at for each tool: how memory gets written (who extracts facts — the agent, an LLM pipeline, or nobody), how it’s read back (substring search? hybrid retrieval? auto-injection?), what happens when facts contradict each other, and what it costs in money and LLM tokens.
The eight
1. The official MCP memory server (the baseline)
@modelcontextprotocol/server-memory — the reference implementation from the MCP servers monorepo (91,405 stars for the whole repo, 2026-10-20).
A knowledge graph of entities, observations, and relations stored in a single local JSONL file (path via MEMORY_FILE_PATH, writes guarded by a lock-file). Nine tools: create_entities, add_observations, search_nodes, and so on. Runs with npx -y @modelcontextprotocol/server-memory, needs Node.js ≥24, no database, no API keys. The agent does all the cognitive work itself — the server contains zero LLM calls, zero cost, zero intelligence. Search is lowercase substring matching. There’s no compression, no dedup beyond exact-string equality (“Marco’s car” and “Marco’s vehicle” are two different entities forever), no notion of projects or sessions, and read_graph on a grown graph will happily eat your context window.
Their own README says it plainly: these are “reference implementations… NOT production-ready solutions.”
It’s the floor. Everything else on this list exists because of its three pains: string-identity duplicates, no consolidation, no semantic search.
2. mem0 — the popular kid
mem0ai/mem0, 67,517 stars, Apache-2.0.
The current version (since April 2026) made an architectural bet I find genuinely interesting: the write path is ADD-only. One LLM call extracts facts from new messages, dedups against recent and similar memories (with a nice anti-hallucination trick — UUIDs are mapped to integers before the LLM sees them), and nothing is ever updated or deleted on write. Conflicts get resolved at read time via temporal ranking. The old “smart manager” prompt that decided ADD/UPDATE/DELETE/NONE per fact is gone from the hot path.
Reading is hybrid: vector + BM25 + entity-matching boost, with over-fetch and optional rerankers. Their README claims 92.5 on LoCoMo and 94.4 on LongMemEval — with the honest caveat printed right there: these scores come from the managed platform, which “includes proprietary optimizations not available in the open-source SDK.” Hosted pricing runs $0 / $19 / $249 per month; the OSS stack self-hosts with Docker, but still needs an external LLM key (OpenAI by default).
One change worth knowing: their official MCP server, mem0ai/mem0-mcp, is archived (last push March 2026). The current path into Claude Code or Cursor is native plugins — and those require a Mem0 Platform cloud API key, so your memories flow to their cloud even in the “local” IDE setup.
Weak spots: in OSS, contradictory facts coexist (they only get linked); real conflict resolution lives in the paid Platform tier (“Dream” consolidation). Graph memory is also a Pro-tier feature. And 856 open issues is a lot of surface area.
3. Zep / Graphiti — the temporal graph
Zep is the managed product; getzep/graphiti (~32k stars, Apache-2.0) is its open-source engine.
Graphiti’s core idea is the strictest model of time I’ve seen: a bi-temporal knowledge graph. Edges carry valid_at / invalid_at (when the fact was true in the world) plus created_at (when the system learned it). Contradicted facts get invalidated, never deleted — so “what was true on date X” and “what did we know on date Y” are both answerable. Their paper reports up to +18.5% accuracy and −90% latency on LongMemEval against baselines, with the biggest wins exactly where others are weakest: temporal reasoning and knowledge updates.
The costs: several LLM calls per episode (extract nodes, dedupe nodes, extract edges, dedupe edges, timestamps, summaries), and you must run Neo4j, FalkorDB, or Neptune. Zep-the-service starts at $125/month and has no self-hosted option below enterprise BYOC.
4. claude-mem — the hook machine
thedotmack/claude-mem, ~99k stars (yes, in about 13 months), Apache-2.0.
This one is architecturally different: it’s not a memory server, it’s a plugin that captures your coding sessions through lifecycle hooks (SessionStart, PostToolUse, Stop…), and a background LLM “observer” (default: claude-haiku-4-5, but it supports OpenRouter/Ollama/etc.) compresses tool I/O into structured observations. Storage is SQLite FTS5 + ChromaDB vectors. The read path uses progressive disclosure: a session-start index of ~50 observations with per-entry token estimates costs roughly 800 tokens instead of ~8,500 for full records.
What I respect: the obsession with token accounting, and an observation taxonomy (bugfix/decision/gotcha…) that makes the index scannable. What worries me, from their own issue tracker: parser drops whole batches when an LLM provider returns a prose error — one user reported 12,115 lost batches (#4677); cold Chroma queries reportedly take ~33 seconds at scale (#4682); and default-on PostHog telemetry contradicts the “nothing leaves your device” privacy wording (#4605). Hosted “CMEM Pro” is $30/month.
5. Letta (ex-MemGPT) — the agent that rewrites itself
letta-ai/letta, ~25k stars, Apache-2.0.
Letta isn’t a memory layer you attach to your agent — it’s an agent platform where memory blocks are part of the system prompt, and the agent edits them with tools. The distinctive feature: sleep-time agents (their paper: arXiv:2504.13171). A second, background agent shares the memory blocks and rewrites them while the main agent idles. Their numbers: ~5× less test-time compute at equal accuracy on stateful reasoning benchmarks, and up to −2.5× average query cost when future queries are predictable. The newer incarnation (“Dreaming” over a git-backed MemFS) versions every memory edit — diffable memory, which I find elegant.
The catch for my use case: this is a platform. If you want memory for your existing Claude Code/Cursor setup, adopting Letta means adopting Letta’s agents.
6. LangMem — the library approach
langchain-ai/langmem, ~1.7k stars, MIT.
Not a product — primitives. create_manage_memory_tool and create_search_memory_tool drop into a LangGraph agent, and a background manager extracts → consolidates → updates memories on whatever store you already have. There’s a “hot path” pattern that injects memories without an explicit search call.
Honest framing: if you’re already on LangGraph, this is the lowest-friction option. If you’re not, it gives you a toolkit, not a system — no server, no UI, no dashboard, and the quality ceiling is whatever you build.
7. supermemory — the speed merchant
supermemoryai/supermemory, 31,334 stars, MIT.
A memory engine that runs hosted (API + dashboard) or fully local: npx supermemory local gives you one binary with an API on localhost, data in ~/.supermemory, local embeddings by default (Xenova/bge-base — no key needed), and true offline mode through Ollama. There’s an official hosted MCP server plus open-source plugins for Claude Code, Cursor and others.
Two ideas stood out to me: profiles split into static (stable facts) and dynamic (recent activity), served in one ~50 ms call (their docs’ number, not my measurement), and a hybrid “RAG + Memory in one query” mode.
Their headline numbers — “95% Recall@15, 99.4% context reduction” — deserve a footnote. Recall@15 is a retrieval metric (did evidence land in the top 15), not answer quality. And the 99.4% is arithmetic: ~720 injected tokens vs ~115k tokens of full history. Any top-N retriever produces a number like that. Credit where due: they also ship MemoryBench, an open benchmark harness (LoCoMo, LongMemEval, ConvoMem) that reports accuracy / latency / context tokens as a triple instead of one magic percent. That’s the most honest evaluation tooling in this whole list.
Pricing is credit-based: free tier ($5 of credits monthly), then $19 / $100 / $399 per month; the supported self-host offer sits at the $399 Scale tier. Caveats from their own pages: even local mode routes URL ingestion through their hosted reader service, telemetry is on by default (disable with SUPERMEMORY_DISABLE_TELEMETRY=1), and API v3/v4 shut down on 2026-12-31 — a migration tax if you’re on the old SDK.
8. MaxGraph — my own, with the same treatment
MaxGraph — the one I maintain, so grade this section yourself.
Self-hosted MCP server, knowledge graph of entities/observations/relations (same data model as the reference server, deliberately), hybrid search, and an ACT‑R-style activation score — facts surface based on recency × how often they’ve been accessed, which imitates how human memory re-strengthens what you actually reuse. Two things I haven’t found elsewhere in one package: tasks and bugs as first-class graph entities with open/done/fixed statuses, and per-project shards so memories from different repos never cross-contaminate.
The number I can stand behind, because I measured it on my own project (methodology and caveats): a session start with memory costs ~3.3–5.1k tokens vs ~7.3–11k for re-reading the README/protocol/changelog from scratch — a 1.4–3.3× reduction. Pointed questions: 1.2–4.2×. And the honest caveats from the same measurement: the memory digest itself costs ~2.5–3.9k tokens every session, and against a single small file memory can actually lose (down to 0.9×). Memory pays off when knowledge is scattered across sources or simply doesn’t exist in any file (“who decided what, and when”).
Weaknesses, since I promised: it’s a young project with a tiny community; my token numbers are character-based estimates, not tokenizer-exact billing; there is no LoCoMo/LongMemEval run yet (planned via MemoryBench — if it’s not on the repo by the time you read this, that’s a fair criticism); and it’s self-hosted only — if you want a managed cloud, this isn’t it.
The table
| Tool | Writes via | Search | Conflicts | Self-hosted | Price |
|---|---|---|---|---|---|
| MCP reference | Agent, 9 tools | Substring only | Manual deletes | Yes (JSONL) | Free |
| mem0 | 1 LLM call, ADD-only | Vector + BM25 + entities | At read time | Yes (LLM key) | OSS free; cloud $0–249/mo |
| Zep / Graphiti | LLM pipeline per episode | Hybrid + RRF | Bi-temporal invalidation | Graphiti (needs Neo4j) | from $125/mo |
| claude-mem | Hooks + LLM observer | FTS5 + vectors | No auto-resolution | Yes | $30/mo hosted |
| Letta | Agent + sleep-time agent | Core in context | Block rewrites | Yes | $0 / $20 / usage |
| LangMem | Tools + background manager | Store-dependent | Consolidation | Library | — |
| supermemory | API/SDK, auto | Hybrid, ~50 ms profiles | Auto-expiry | Local engine MIT | $0–399/mo |
| MaxGraph | Agent + capture hooks | Hybrid + ACT‑R | Supersede marks | Only | $1.99/mo |
Star counts (GitHub API, 2026-10-19/20): MCP servers monorepo 91.4k, claude-mem ~99k, mem0 67.5k, Graphiti ~32k, supermemory 31.3k, Letta ~25k, LangMem ~1.7k. MaxGraph is young — that’s part of the honest picture.
What actually matters (the patterns)
Comparing mechanics instead of marketing, four convergent ideas fell out:
1. Everyone abandoned UPDATE-on-write. mem0 went ADD-only; Graphiti invalidates instead of deleting; Letta rewrites in the background. Writing became cheap and predictable; conflict resolution moved to read time or to a background job. If you’re evaluating a memory system, “what happens on write, synchronously?” is the sharpest question you can ask.
2. Hybrid retrieval is table stakes. Vector + BM25 + a graph/entity signal, fused with RRF and reranked. Pure-vector is now the budget option; pure substring is the reference implementation. The differentiator moved to what the third signal is — entity links, graph distance, temporal filters.
3. Anti-hallucination engineering is the quiet moat. Graphiti’s dedup prompts refuse to merge when in doubt. mem0 maps UUIDs to integers so the LLM can’t invent references. Consolidation is where memory systems hallucinate — ask vendors how they prevent it.
4. Benchmark numbers are mostly incomparable. Different datasets, different judges, different backbones, and nearly all self-reported. The only sane comparison I found is supermemory’s MemoryBench approach: fixed judge, fixed datasets, and a triple of accuracy/latency/context-tokens instead of one heroic percentage.
What I’d pick
For a side project with zero budget: the MCP reference server, and accept its limits — or claude-mem if you live in Claude Code. For production agents where temporal correctness matters (“what did the user tell us last month?”): Graphiti, and budget for the LLM calls. For a hosted API where someone else runs the infrastructure: supermemory or mem0, but run your own MemoryBench eval before trusting either’s README. For a self-hosted setup with task tracking and per-project isolation: well, that’s why I built mine.
If you try MaxGraph, the repo is at github.com/RuMemory/maxgraph — a star helps, a MemoryBench run even more, and honest bug reports most of all. There’s a 7-day trial on rezon-ai.ru/en if you want to test-drive it first.
FAQ
Why no LoCoMo or LongMemEval number for MaxGraph? Because we haven’t run them yet — publishing a self-reported number without a fixed harness is exactly what we criticize above. A MemoryBench run is planned; until it lands, the token-cost measurements on our own repo are what we stand behind.
Which of these is fully free and open source? The MCP reference server (MIT), LangMem (MIT), Graphiti (Apache-2.0), mem0’s OSS stack (Apache-2.0, but bring an LLM key), and supermemory’s local engine (MIT). MaxGraph is source-available (BSL-1.1): free for personal use, each version turns MIT four years after release.
Where does my data physically live in each option? MCP reference, claude-mem, LangMem, Graphiti, supermemory-local and MaxGraph store everything on your machine. mem0 and supermemory’s hosted paths send memories to the vendor’s cloud — including mem0’s current IDE plugins, which require a cloud API key.
Can I switch later without losing my memories? Realistically only where export is first-class: MaxGraph exports the whole graph to NDJSON in one click; mem0 and Zep expose export via API. The MCP reference server is a plain JSONL file you can read with anything.
Facts checked against GitHub API, official READMEs and pricing pages on 2026-10-19/20. Found an error? Open an issue in the repo — I’ll fix and update.
Give your agent memory
7-day trial, no card. Installation is one prompt — your agent does the rest.