<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohammad Lareb Zafar</title>
    <description>The latest articles on DEV Community by Mohammad Lareb Zafar (@zlareb1).</description>
    <link>https://dev.to/zlareb1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4261216%2Fb7e31ec0-8e58-4a43-a963-e7665b4c856e.png</url>
      <title>DEV Community: Mohammad Lareb Zafar</title>
      <link>https://dev.to/zlareb1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zlareb1"/>
    <language>en</language>
    <item>
      <title>I built an agent memory tool. Here's how it compares to the ones you've heard of</title>
      <dc:creator>Mohammad Lareb Zafar</dc:creator>
      <pubDate>Wed, 02 Dec 2026 12:39:10 +0000</pubDate>
      <link>https://dev.to/zlareb1/i-built-an-agent-memory-tool-heres-how-it-compares-to-the-ones-youve-heard-of-48al</link>
      <guid>https://dev.to/zlareb1/i-built-an-agent-memory-tool-heres-how-it-compares-to-the-ones-youve-heard-of-48al</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  The tools
&lt;/h2&gt;

&lt;p&gt;I picked the seven that come up most when people talk about memory or context for coding agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mem0&lt;/strong&gt;: "The Memory Layer for AI Agents." Library, self-hosted server or cloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zep / Graphiti&lt;/strong&gt;: Graphiti is an open-source framework for temporal knowledge graphs. Zep is the managed product built on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letta&lt;/strong&gt; (formerly MemGPT): stateful agents that rewrite their own memory. Active development now lives in Letta Code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cognee&lt;/strong&gt;: an open-source memory platform that builds a knowledge graph from documents, code and conversations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Basic Memory&lt;/strong&gt;: knowledge stored as plain Markdown files, served over MCP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serena&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code's built-in memory&lt;/strong&gt;: &lt;code&gt;CLAUDE.md&lt;/code&gt; files you write, plus auto memory that Claude writes itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And Loom: a self-hosted MCP server with shared memory, document search with citations and a code index, stored in ClickHouse.&lt;/p&gt;

&lt;h2&gt;
  
  
  The comparison
&lt;/h2&gt;

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

&lt;p&gt;The column that matters most to me isn't in that table, so here it is separately.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk2akpi7xxwn4fj33bga3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk2akpi7xxwn4fj33bga3.png" alt="Comparison matrix of the eight tools across six capabilities" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the others are better
&lt;/h2&gt;

&lt;p&gt;I'll start here, because it's the part I'd skip if I were being lazy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mem0 has the community and the polish.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Graphiti is the most serious about time.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serena is better at code navigation and editing.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Memory is the simplest thing that works.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Letta is about the agent, not just the memory.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cognee is broader on ingestion.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude Code's built-in memory costs nothing to adopt.&lt;/strong&gt; It's already there. &lt;code&gt;CLAUDE.md&lt;/code&gt; for rules you write, auto memory for what Claude picks up, and &lt;code&gt;/doctor prompt-audit&lt;/code&gt; 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 &lt;code&gt;MEMORY.md&lt;/code&gt; load at session start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Loom is different
&lt;/h2&gt;

&lt;p&gt;Here's the one thing I built Loom to do that I couldn't find elsewhere.&lt;/p&gt;

&lt;p&gt;A memory in Loom points at the code it's about. When an agent saves a lesson that names &lt;code&gt;fetch_page()&lt;/code&gt; 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 &lt;code&gt;fresh&lt;/code&gt;, &lt;code&gt;moved&lt;/code&gt;, &lt;code&gt;changed&lt;/code&gt; (with the commit that changed it), &lt;code&gt;unresolved&lt;/code&gt; or &lt;code&gt;missing&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;With a linked lesson, the agent gets the warning with the lesson:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;hits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"when does fetch_page retry"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code_state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code_changed_since&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# fetch_retry_rule changed &amp;lt;commit that edited fetch_page&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;changed&lt;/code&gt; 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 &lt;code&gt;fresh&lt;/code&gt;, so it doesn't cry wolf.&lt;/p&gt;

&lt;p&gt;The other two differences are smaller but real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Document search with citations.&lt;/strong&gt; Loom returns passages cited by document, revision and line, including PDF, &lt;code&gt;.docx&lt;/code&gt; and &lt;code&gt;.pptx&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ClickHouse underneath.&lt;/strong&gt; 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."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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 &lt;code&gt;memory.ask&lt;/code&gt; configuration scored 96.6% on the 500 LongMemEval-S questions.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Loom is weaker
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's young.&lt;/strong&gt; The repository was created in October 2026. Fewer users means fewer people have hit the edge cases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's heavier to run&lt;/strong&gt; 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code links need an indexed repo.&lt;/strong&gt; Uncommitted editor changes don't trigger the check, and names shorter than four characters aren't linked unless qualified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Our tests verify link state, not answer quality.&lt;/strong&gt; CI checks that a lesson goes from &lt;code&gt;fresh&lt;/code&gt; to &lt;code&gt;changed&lt;/code&gt; with the right commit. It doesn't prove the agent reads the warning. Offering a tool doesn't guarantee the model uses it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to pick what
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Try it, and correct me
&lt;/h2&gt;

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

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Mem0 README: &lt;a href="https://github.com/mem0ai/mem0" rel="noopener noreferrer"&gt;https://github.com/mem0ai/mem0&lt;/a&gt; and self-hosted server: &lt;a href="https://github.com/mem0ai/mem0/tree/main/server" rel="noopener noreferrer"&gt;https://github.com/mem0ai/mem0/tree/main/server&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Mem0 MCP server: &lt;a href="https://docs.mem0.ai/platform/mem0-mcp" rel="noopener noreferrer"&gt;https://docs.mem0.ai/platform/mem0-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Graphiti README: &lt;a href="https://github.com/getzep/graphiti" rel="noopener noreferrer"&gt;https://github.com/getzep/graphiti&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Zep paper: &lt;a href="https://arxiv.org/abs/2501.13956" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2501.13956&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Letta: &lt;a href="https://github.com/letta-ai/letta" rel="noopener noreferrer"&gt;https://github.com/letta-ai/letta&lt;/a&gt; and &lt;a href="https://github.com/letta-ai/letta-code" rel="noopener noreferrer"&gt;https://github.com/letta-ai/letta-code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Cognee README: &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;https://github.com/topoteretes/cognee&lt;/a&gt; and store defaults: &lt;a href="https://docs.cognee.ai/guides/store-configurations" rel="noopener noreferrer"&gt;https://docs.cognee.ai/guides/store-configurations&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Basic Memory README: &lt;a href="https://github.com/basicmachines-co/basic-memory" rel="noopener noreferrer"&gt;https://github.com/basicmachines-co/basic-memory&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Serena README: &lt;a href="https://github.com/oraios/serena" rel="noopener noreferrer"&gt;https://github.com/oraios/serena&lt;/a&gt; and license: &lt;a href="https://github.com/oraios/serena/blob/main/LICENSE" rel="noopener noreferrer"&gt;https://github.com/oraios/serena/blob/main/LICENSE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Claude Code memory docs: &lt;a href="https://code.claude.com/docs/en/memory" rel="noopener noreferrer"&gt;https://code.claude.com/docs/en/memory&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Loom README and benchmarks: &lt;a href="https://github.com/ClickHouse/loom" rel="noopener noreferrer"&gt;https://github.com/ClickHouse/loom&lt;/a&gt; and &lt;a href="https://github.com/ClickHouse/loom/blob/main/docs/benchmarks/results.md" rel="noopener noreferrer"&gt;https://github.com/ClickHouse/loom/blob/main/docs/benchmarks/results.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Loom code-linked memory: &lt;a href="https://github.com/ClickHouse/loom/blob/main/docs/use-cases/memory-linked-to-code.md" rel="noopener noreferrer"&gt;https://github.com/ClickHouse/loom/blob/main/docs/use-cases/memory-linked-to-code.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>mcp</category>
      <category>devtools</category>
    </item>
    <item>
      <title>My agent's memory now knows when the code changed</title>
      <dc:creator>Mohammad Lareb Zafar</dc:creator>
      <pubDate>Tue, 01 Dec 2026 18:32:48 +0000</pubDate>
      <link>https://dev.to/zlareb1/my-agents-memory-now-knows-when-the-code-changed-3bif</link>
      <guid>https://dev.to/zlareb1/my-agents-memory-now-knows-when-the-code-changed-3bif</guid>
      <description>&lt;p&gt;Here's a failure mode I keep worrying about.&lt;/p&gt;

&lt;p&gt;Picture this. Months ago your team learned that a fetch helper retries on one specific error code. You saved that as a note so your coding agent would stop asking. Then someone rewrote the helper. The note stayed.&lt;/p&gt;

&lt;p&gt;Today the agent reads that note, trusts it, and writes a confident patch around behaviour that no longer exists.&lt;/p&gt;

&lt;p&gt;Nothing crashes. The tests pass, because they were updated with the rewrite and the patch doesn't touch them. The only thing standing between that patch and main is a reviewer who notices the diff looks a little too sure of itself.&lt;/p&gt;

&lt;p&gt;I test databases at ClickHouse for a living. My whole job is asking "what is this assuming, and is it still true?" Agent memory, as most of us use it today, is a pile of assumptions with no expiry date.&lt;/p&gt;

&lt;p&gt;That worry is why one feature in Loom exists. It's the part of the project I'm most attached to, so this post is about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with agent memory
&lt;/h2&gt;

&lt;p&gt;Every coding agent I use has some form of memory now. A &lt;code&gt;CLAUDE.md&lt;/code&gt; file. An &lt;code&gt;AGENTS.md&lt;/code&gt;. A notes folder. A vector store bolted onto an MCP server.&lt;/p&gt;

&lt;p&gt;They all share one weakness. A memory is a sentence, and a sentence has no idea what it's about.&lt;/p&gt;

&lt;p&gt;"&lt;code&gt;fetch_page()&lt;/code&gt; retries on code 115" is a claim about a function. When that function changes, the claim might become false. But the memory store doesn't know the function exists, so it keeps serving the sentence with the same confidence forever.&lt;/p&gt;

&lt;p&gt;Humans deal with this through context. You remember who told you, roughly when, and you have a feel for whether that part of the code has been churning. An agent starting a fresh session has none of that. It gets the text and nothing else.&lt;/p&gt;

&lt;p&gt;So the question I kept coming back to was simple. What if a memory knew which code it was about, and could tell you when that code changed?&lt;/p&gt;

&lt;h2&gt;
  
  
  What Loom does
&lt;/h2&gt;

&lt;p&gt;Loom is an open-source, self-hosted memory server for AI agents. It speaks MCP, HTTP, Python and TypeScript, and stores everything in ClickHouse. It has shared long-term memory, document search with citations, and a code index of your repositories.&lt;/p&gt;

&lt;p&gt;The code index is what makes the interesting part possible.&lt;/p&gt;

&lt;p&gt;When an agent saves a lesson that names a function in backticks or as a call, like &lt;code&gt;`fetch_page()`&lt;/code&gt;, Loom tries to resolve that name to exactly one definition in the indexed repository. If it finds one, the lesson gets a link to that definition. Unqualified names need four or more characters, so a lesson that mentions &lt;code&gt;get&lt;/code&gt; doesn't end up linked to half the codebase.&lt;/p&gt;

&lt;p&gt;From then on, every indexed commit is a chance to check the link. A background worker compares the definition's tokens with the ones the lesson was written against, and the link ends up in one of five states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;fresh&lt;/strong&gt;: same definition, same text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;moved&lt;/strong&gt;: the file moved, or the function was renamed with nothing else changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;changed&lt;/strong&gt;: the function's text changed, and &lt;code&gt;changed_since&lt;/code&gt; names the commit that did it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;unresolved&lt;/strong&gt;: the name is gone and something new may be it, but nothing certainly is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;missing&lt;/strong&gt;: the code is gone. The link keeps its place, so a revert finds it again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnk2d8rfsubyidx2yv0ht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnk2d8rfsubyidx2yv0ht.png" alt="How a lesson follows its code through a commit" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because the comparison is on tokens, whitespace, comments and most formatter runs leave a link fresh. I spent more time on that than I expected. A memory system that cries wolf every time someone runs a formatter is worse than one that never warns at all, because people learn to ignore it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like from the agent's side
&lt;/h2&gt;

&lt;p&gt;Here is the smallest version, with the Python SDK against a local Loom:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;asyncio&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;loom&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"local"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"lareb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# The repo tag tells Loom which indexed repository the lesson is about.&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;"fetch_retry_rule"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"`fetch_page()` retries on code 115, not on 503"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"repo:&amp;lt;your-repo-id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Later, possibly in another session or from another agent:&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"when does fetch_page retry"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code_state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;code_changed_since&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;asyncio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Link passes run every 60 seconds and pick up writes that are at least 60 seconds old, so on an indexed trunk the link shows up within about two minutes. Right after saving, &lt;code&gt;code_state&lt;/code&gt; reads &lt;code&gt;fresh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now change one expression in the function body, commit, and push to the indexed trunk. Once the index and the link worker have processed that commit, the same search returns &lt;code&gt;changed&lt;/code&gt;, and &lt;code&gt;code_changed_since&lt;/code&gt; is that commit's hash.&lt;/p&gt;

&lt;p&gt;The Claude Code and Codex plugins do the tagging for you. They pull lessons out of a session's transcript and tag them with the repository, so most of the time I never write that &lt;code&gt;memory.set&lt;/code&gt; call by hand. The lessons just accumulate, and they carry their own warnings.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Changed" is not "wrong"
&lt;/h2&gt;

&lt;p&gt;This was the design decision I argued with myself about the longest.&lt;/p&gt;

&lt;p&gt;When a function changes, the lesson about it might still be true. Maybe someone renamed a variable inside it. Maybe they added logging. Throwing the lesson away would lose real knowledge. Serving it as if nothing happened is how I got the bad patch.&lt;/p&gt;

&lt;p&gt;So Loom does neither. A &lt;code&gt;changed&lt;/code&gt; lesson is still served, but it arrives with the commit that changed the code. The agent is supposed to read the current body before acting on it. In the docs we phrase it as "this marks changed code, not a judgment that the lesson is false."&lt;/p&gt;

&lt;p&gt;Code that is gone entirely is treated more strictly. By default, search leaves out a memory whose code is all gone, unless a person pinned, locked or verified it. If a human said "keep this", it stays.&lt;/p&gt;

&lt;p&gt;Renames get special care too. If you only rename the function, the link worker can rewrite the name inside the lesson's text on the next pass, and the link reads &lt;code&gt;fresh&lt;/code&gt; at the new symbol. Where it can't safely rewrite the text, the link still records the new symbol with a &lt;code&gt;was_symbol&lt;/code&gt; field holding the old name, so whoever reads it can connect the two.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I test it, since that's the day job
&lt;/h2&gt;

&lt;p&gt;I'm a QA engineer, so the feature only counts if something tries to break it on every change.&lt;/p&gt;

&lt;p&gt;There's an integration test, &lt;code&gt;test_memories_follow_their_code&lt;/code&gt;, that walks a lesson through commits and checks &lt;code&gt;fresh&lt;/code&gt;, &lt;code&gt;changed&lt;/code&gt;, a pure move (&lt;code&gt;moved&lt;/code&gt;), removed code (&lt;code&gt;missing&lt;/code&gt;), and a release branch where the unchanged definition still reads &lt;code&gt;fresh&lt;/code&gt; even though trunk changed it.&lt;/p&gt;

&lt;p&gt;On top of that, a packaged MCP smoke test saves a lesson, checks it's fresh, commits a body edit, and waits for the workers to report &lt;code&gt;changed&lt;/code&gt; with that exact commit. A second harness restarts the Loom service and checks the link survives. CI runs both on amd64 and arm64.&lt;/p&gt;

&lt;p&gt;What those checks don't cover matters too. They verify link state. They don't test answer quality or whether the agent actually reads the warning. A tool being available doesn't mean the model uses it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does any of this save money?
&lt;/h2&gt;

&lt;p&gt;The README has numbers. Here they are, with the parts people tend to skip.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evaluation&lt;/th&gt;
&lt;th&gt;With Loom&lt;/th&gt;
&lt;th&gt;Without Loom&lt;/th&gt;
&lt;th&gt;Efficiency gain&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Coding-agent answer quality&lt;/td&gt;
&lt;td&gt;0.84&lt;/td&gt;
&lt;td&gt;0.78&lt;/td&gt;
&lt;td&gt;20% lower model cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Coding-agent file localization&lt;/td&gt;
&lt;td&gt;96.4%&lt;/td&gt;
&lt;td&gt;91.4%&lt;/td&gt;
&lt;td&gt;21% lower model cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory vs full-history answers&lt;/td&gt;
&lt;td&gt;94%&lt;/td&gt;
&lt;td&gt;90%&lt;/td&gt;
&lt;td&gt;91% fewer reader prompt tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The two coding rows are Claude Code on the ClickHouse codebase: 24 questions with 3 paired runs for answer quality, and 36 questions with 10 paired runs for file localization. Cost is the whole session's model bill, and it excludes Loom's own server-side model calls, hosting and indexing. The memory row uses 100 paired LongMemEval-S questions with the same reader model, and the 94% vs 90% difference is descriptive, not statistically established.&lt;/p&gt;

&lt;p&gt;Separately, Loom's &lt;code&gt;memory.ask&lt;/code&gt; configuration scored 96.6% on all 500 LongMemEval-S questions. That's a product evaluation with its own answer models, not the same fixed-reader comparison.&lt;/p&gt;

&lt;p&gt;None of these benchmarks measure the stale-memory feature directly. That one is harder to put in a table. What I can say is how the scenario at the top plays out with Loom: the stale note arrives marked &lt;code&gt;changed&lt;/code&gt;, with the commit that changed the code, and the agent is pointed at the current body before it writes anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, and tell me where it breaks
&lt;/h2&gt;

&lt;p&gt;Loom runs locally with Docker. The default personal setup has no login and only listens on localhost:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://github.com/ClickHouse/loom/releases/latest/download/install.sh -o loom-install.sh &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sh loom-install.sh &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm loom-install.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you'd rather not install anything, there's a playground at loom.clickhouse.com where you can change a retry rule in a sample function and watch the saved lesson go from fresh to changed.&lt;/p&gt;

&lt;p&gt;The repo is github.com/ClickHouse/loom. It's Apache-2.0.&lt;/p&gt;

&lt;p&gt;I'd really like to hear from people who've hit the stale-memory problem in their own setup, and from anyone who finds a case where a link stays &lt;code&gt;fresh&lt;/code&gt; when it shouldn't. That's the bug I most want to know about.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>clickhouse</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
