I built an agent memory tool. Here's how it compares to the ones you've heard of

2026-12-02来源 dev.toEnglish
I built an agent memory tool. Here's how it compares to the ones you've heard of

First, the disclosure. I build ClickHouse Loom. I'm an engineer at ClickHouse, and Loom is the project I spend most of my evenings and a fair number of my days on. So read this knowing I have a favourite.

I wrote it anyway, for two reasons. People keep asking me "why not just use Mem0?" and I want one place to point them. And I don't trust comparisons that only list where the author wins. So every claim below links to the tool's own README or docs, star counts are dated, and I've tried to be clear about where the others are better.

Everything here was checked on 2 December 2026. These projects move fast, so if you're reading this later, check the links.

The tools

I picked the seven that come up most when people talk about memory or context for coding agents:

  • Mem0: "The Memory Layer for AI Agents." Library, self-hosted server or cloud.
  • Zep / Graphiti: Graphiti is an open-source framework for temporal knowledge graphs. Zep is the managed product built on it.
  • Letta (formerly MemGPT): stateful agents that rewrite their own memory. Active development now lives in Letta Code.
  • Cognee: an open-source memory platform that builds a knowledge graph from documents, code and conversations.
  • Basic Memory: knowledge stored as plain Markdown files, served over MCP.
  • Serena: not a memory store first. It's an MCP toolkit that gives agents IDE-level symbol navigation and editing, with a simple memory feature on the side.
  • Claude Code's built-in memory: CLAUDE.md files you write, plus auto memory that Claude writes itself.

And Loom: a self-hosted MCP server with shared memory, document search with citations and a code index, stored in ClickHouse.

The comparison

Tool GitHub stars (2 Dec 2026) License Self-host Storage MCP
Mem0 69,926 Apache-2.0 Yes (Docker server) Postgres + pgvector in the self-hosted server Hosted MCP server on the platform
Graphiti 33,243 Apache-2.0 Yes (Graphiti); Zep is managed or BYOC Neo4j, FalkorDB, Amazon Neptune or embedded Relate Reference MCP server
Cognee 33,799 Apache-2.0 Yes SQLite + LanceDB + Ladybug by default; Postgres, Neo4j and others optional Yes
Serena 31,897 GPL-3.0-or-later (app), MIT (SolidLSP) Yes, runs locally Language servers; memories as files Yes, it is an MCP server
Letta 25,618 (letta), 3,952 (letta-code) Apache-2.0 Local server or Letta Cloud Memory tracked in git (MemFS) Not covered in the README I checked
Basic Memory 4,814 AGPL-3.0 Yes, or hosted Markdown files, indexed in SQLite or Postgres Yes, MCP-native
Claude Code memory n/a (built in) Part of Claude Code Local files Markdown in the repo and ~/.claude/projects/<project>/memory/ n/a
Loom 263 Apache-2.0 Yes (Docker, Helm) ClickHouse; Postgres optional for live state Yes, plus Claude Code and Codex plugins

The column that matters most to me isn't in that table, so here it is separately.

Tool Knows about code Notices when the code a memory is about changes
Serena Yes, symbol-level via LSP, 40+ languages Not documented for its memories
Cognee Code becomes a graph of symbols and dependencies Not documented
Graphiti No code focus Facts have validity windows and get invalidated when information changes
Claude Code Reads the repo directly /doctor prompt-audit flags references to files or commands that no longer exist
Loom Code index with definitions, callers, change impact Each memory links to the functions and files it names; every indexed commit sets the link to fresh, moved, changed, unresolved or missing

Comparison matrix of the eight tools across six capabilities

Where the others are better

I'll start here, because it's the part I'd skip if I were being lazy.

Mem0 has the community and the polish. Almost 70,000 stars against Loom's 263 is not a rounding error. It has a library, a self-hosted server and a cloud, and its README publishes 92.5 on LoCoMo and 94.4 on LongMemEval. Read the footnote though: those scores are for Mem0's managed platform, which "includes proprietary optimizations not available in the open-source SDK." The evaluation framework is open, which I respect.

Graphiti is the most serious about time. Its facts carry validity windows, and when something changes the old fact is invalidated while history is kept. That is a better general model of "this used to be true" than anything Loom does for facts that aren't about code. The Zep paper reports 94.8% vs 93.4% over MemGPT on the DMR benchmark and accuracy improvements of up to 18.5% on LongMemEval. If your agent's memory is mostly about users, customers and events, start here.

Serena is better at code navigation and editing. It plugs language servers into your agent, supports more than 40 languages, and does symbol-level edits like replacing a function body. Loom has a code index, but Serena's editing tools are a different and very good thing. They're not even really competitors. You could run both.

Basic Memory is the simplest thing that works. Your memory is Markdown you can open in Obsidian, diff and commit. There's no database to run beyond a local index. If you're one person and you want to see every byte your agent remembers, that's hard to beat. Note the AGPL-3.0 license if you plan to build on it.

Letta is about the agent, not just the memory. Letta Code agents rewrite their own memory, skills and prompts, and track all of it in git. That's a much bigger idea than a memory server. If you want a self-improving agent harness, Loom isn't one. Its README says plainly that it's not an agent framework.

Cognee is broader on ingestion. It turns documents, code and conversations into one knowledge graph and runs on embedded file stores by default, so it's light to start. Its BEAM results are reported with unusual honesty: 0.79 at 100K tokens on 20 questions from one held-out conversation, and 0.67 at 10M tokens marked as exploratory.

Claude Code's built-in memory costs nothing to adopt. It's already there. CLAUDE.md for rules you write, auto memory for what Claude picks up, and /doctor prompt-audit to catch instructions that point at files that no longer exist. For a lot of solo projects that's enough. Two limits from its docs: auto memory is machine-local and not shared across machines, and only the first 200 lines or 25KB of MEMORY.md load at session start.

Where Loom is different

Here's the one thing I built Loom to do that I couldn't find elsewhere.

A memory in Loom points at the code it's about. When an agent saves a lesson that names fetch_page() in backticks, Loom resolves that to one definition in the indexed repository and links them. On every indexed commit, a worker compares the definition's tokens with the ones the lesson was written against. The link reads fresh, moved, changed (with the commit that changed it), unresolved or missing.

That matters because stale memory is quiet. A note that says "this helper retries on code 115" will be served with the same confidence after someone rewrites the helper. Picture an agent reading it and writing a tidy patch around behaviour that no longer exists. That's the failure mode I keep worrying about.

With a linked lesson, the agent gets the warning with the lesson:

hits = await agent.memory.search("when does fetch_page retry") for hit in hits: print(hit.memory_key, hit.code_state, hit.code_changed_since) # fetch_retry_rule changed <commit that edited fetch_page> 

A changed lesson is still served, because it may still be true. Code that's gone entirely is left out of search by default unless a person pinned, locked or verified the memory. Whitespace, comments and most formatter runs leave a link fresh, so it doesn't cry wolf.

The other two differences are smaller but real:

  • Document search with citations. Loom returns passages cited by document, revision and line, including PDF, .docx and .pptx files.
  • ClickHouse underneath. Memories, runs and index data live in a columnar database, which is handy when you want to ask questions like "what did my agents cost by repository last week."

And the benchmarks, with their caveats. On Claude Code against the ClickHouse codebase, Loom measured 0.84 vs 0.78 on answer quality with 20% lower model cost (24 questions, 3 paired runs) and 96.4% vs 91.4% on file localization with 21% lower cost (36 questions, 10 paired runs). Cost excludes Loom's own server-side model calls, hosting and indexing. Separately, Loom's memory.ask configuration scored 96.6% on the 500 LongMemEval-S questions.

Please don't line that 96.6% up against Mem0's 94.4 and declare a winner. Different configurations, different answer models, possibly different variants of the benchmark. Every number in this post is the vendor's own, mine included.

Where Loom is weaker

  • It's young. The repository was created in October 2026. Fewer users means fewer people have hit the edge cases.
  • It's heavier to run than Markdown files or Claude's built-in memory. You run a server and ClickHouse (Docker or Helm). Personal mode needs no login, but it's still a service.
  • Code links need an indexed repo. Uncommitted editor changes don't trigger the check, and names shorter than four characters aren't linked unless qualified.
  • Our tests verify link state, not answer quality. CI checks that a lesson goes from fresh to changed with the right commit. It doesn't prove the agent reads the warning. Offering a tool doesn't guarantee the model uses it.

When to pick what

  • You're solo, on one machine, and want zero setup: Claude Code's CLAUDE.md and auto memory. Add Basic Memory if you want notes you can read and version yourself.
  • You're building an app with per-user memory: Mem0, or Graphiti/Zep if facts about people and events change over time.
  • You want an agent that improves itself: Letta Code.
  • You want one graph over documents, code and chats: Cognee.
  • Your agent needs to navigate and edit code precisely: Serena. It pairs fine with any memory tool.
  • Several agents or people share one codebase, and you're worried about lessons going stale as code changes: that's what I built Loom for. It's also a reasonable pick if you already run ClickHouse.

Try it, and correct me

Loom is Apache-2.0 at github.com/ClickHouse/loom. The default personal install is one command and listens only on localhost.

If I've got a fact wrong about any of these tools, tell me and I'll fix the post. I'd rather be corrected than be the person who posted an unfair comparison.

Sources

原文:https://www.a8q9.cn/en/article/i-built-an-agent-memory-tool-here-s-how-it-compares-to-the-ones-you-ve-heard-of-838eb4.html

相关文章