Back to updates
BlogBenchmarks
14 min read

When memory goes stale: benchmarking mex against nine tools

After 367 commits of real code changes, memory tools with no link to code served 90 to 100% of outdated facts as current in their no-LLM modes. mex served 20%. We also measured the cost of its warnings, and its code graph: 65.9% Hit@5 on SWE-Explore against 30.2% for keyword search, and 24 of 24 updates identical to a clean rebuild.

20%
outdated facts served as current
with mex, against 90 to 100% for other memory tools in their no-LLM modes.
65.9%
Hit@5
on 656 SWE-Explore issues in the languages mex supports. Keyword search (BM25): 30.2%.
24 / 24
identical to a clean rebuild
incremental graph updates, zero drift. Next best: 21 / 24.

Memory that is wrong is worse than no memory. An agent will act on an outdated fact with the same confidence as a true one, and nothing in the fact tells it the code has moved on. This report starts there: what each tool does with project knowledge after the code it describes has changed. It then measures the code graph underneath, which is what lets mex notice those changes at all.

We ran mex and nine other free, local tools on the same machine, against the same repositories and tasks, and scored every tool against answer keys that none of the tools produced. Project knowledge was tested by replaying 367 commits of the Hono web framework and checking, after the code had moved, which tools still served outdated facts as current. The code graph was tested on 848 real GitHub issues from SWE-Explore, on 11 repositories in 5 languages, and against 200 real commits.

Key findings

  • Stale knowledge. Memory tools with no link to code served 90 to 100% of outdated facts as current. mex served 20.0%.
  • The cost of warning. mex flags a fact when its linked code changes, including facts that are still true. Plain mex check returned only 56.9% of still-true facts cleanly, against 85 to 96% for tools that never warn. With mex sync, which uses an LLM to re-check flagged facts, that rose to 89.2% and balanced accuracy to 82.9%.
  • Finding code. On the 656 SWE-Explore issues in languages mex supports, mex put code the fix needed in its top five results for 65.9% of issues. Keyword search (BM25) did so for 30.2%.
  • Staying exact. After every one of 24 incremental updates, mex's graph was identical to its own clean rebuild. The next best tool matched in 21 of 24.
  • Search. mex ranked the right symbol first more often than any tool tested (Hit@1 66.7%, MRR 0.710) on a small public task set. On multi-hop tasks, code-review-graph scored highest.
  • Impact analysis. mex had the highest precision (11.4%) and the highest F1 (0.157), with lower recall than four of the five other graph tools.

What we tested, and what's new in this round

01

Our first benchmark post was a pilot. It compared mex with plain file search on 12 tasks across two repositories, and with a real agent in the loop. It answered one question: does mex hand an agent less noise. This round asks harder questions and holds mex to a stricter standard.

  • A public benchmark. Code retrieval is scored on SWE-Explore [1], with the benchmark's own evaluator, not tasks we wrote.
  • Other tools, not only a baseline. Five code graph tools and four memory tools, each installed and run by us, plus two baselines: keyword search and a plain AGENTS.md file.
  • Answer keys no tool produced. Ground truth comes from the benchmark, from real commits, or from an audited fact set.
  • A new question: staleness. Memory that is wrong is worse than no memory. We measured what each tool does with facts the code has since made false.

One rule decided which tools were in scope: we tested only what runs free and locally. Tools that need an LLM provider, a hosted or paid service, or several services were left out. They are listed in section 07. Every competitor was run in its native mode, without an LLM.

Project knowledge that notices when the code changes

02

Project knowledge is the layer on top of the code: decisions, conventions, how a subsystem works. It goes stale when the code changes under it. The question is what a tool does with a fact that used to be true.

We replayed 367 commits of the Hono web framework. At checkpoint C5, the fact set held 132 facts: 102 still true and 30 made false by the code changes since they were written. We report three main metrics:

  • Stale-served (lower is better): outdated facts returned with no warning.
  • Fresh retention (higher is better): still-true facts returned cleanly, without a false warning.
  • Balanced accuracy (higher is better): the average of fresh retention and (100 minus stale-served), so true and false facts count equally.

Table 5 also reports code recall@5: the percentage of the 94 code-linked facts found in the top five results when searching by their file and function.

We show mex two ways. mex check links each fact to the code it describes and flags the fact when that code changes, deterministically and with no LLM. mex check + mex sync adds a review step: mex sync runs your coding agent to re-check each flagged fact against the current code, and renews the facts that are still true.

Table 1 · Project knowledge on the Hono replay, checkpoint C5
Project knowledge on the Hono replay, checkpoint C5
ToolStale-served (lower is better)Fresh retention (higher is better)Balanced accuracy (higher is better)Code recall@5 (higher is better)Stale flagged when returned (higher is better)False alarm when returned (lower is better)
mex check + mex sync23.3%89.2%82.9%83.0%75.0%2.2%
mex check20.0%56.9%68.4%83.0%78.6%38.3%
Hindsight90.0%96.1%53.0%34.0%0%0%
cognee93.3%95.1%50.9%31.9%0%0%
mem096.7%95.1%49.2%51.1%0%0%
Plain AGENTS.md96.7%95.1%49.2%38.3%0%0%
agentmemory100%85.3%42.6%55.3%0%0%
Table 1. 132 facts: 30 outdated, 102 still true. Competitor rows are each tool's native, no-LLM mode.

In practice: Other memory tools hand your agent outdated facts as if they were still true; mex flags most of them, and with sync it does so with few false warnings.

  1. mex sync invokes your coding agent and uses an LLM to re-check each flagged fact against the current code, renewing the ones that are still true. Plain mex uses no LLM.
  2. Competitors were measured in their no-LLM modes, so mex check + mex sync is not a like-for-like comparison with their AI update paths, which were not tested.
  3. In the sync run the agent wrongly renewed one outdated fact (h018, the CORS default methods), so stale-served rose from 20.0% to 23.3%. Fixing that is on the roadmap.
  4. One repo (Hono), 132 facts written with AI, answer key audited by AI. A maintainer spot check is pending.

We also ran "fed" variants of mem0 and agentmemory, told about each commit as text. They did not change the picture: stale-served stayed at 96.7% and 100%, and balanced accuracy was 49.2% and 43.1%.

Figure 1 · Keeping true facts vs catching outdated ones (Hono, checkpoint C5)
0%20%40%60%80%100%40%50%60%70%80%90%100%FRESH RETENTION: TRUE FACTS RETURNED CLEANLY →OUTDATED FACTS NOT SERVED AS CURRENT →50% balanced60% balanced70% balanced80% balancedmex check + mex syncmex checkHindsightcogneemem0, Plain AGENTS.mdagentmemory
Figure 1. Each tool by how many true facts it keeps (across) and how many outdated facts it stops from being served as current (up). Dashed lines mark equal balanced accuracy. Tools with no link to code keep almost every true fact and catch almost no outdated ones. mex check + mex sync uses an LLM; the other points do not.

Reading the result. Without a link to code, a tool has no way to know a fact went stale, so 90 to 100% of outdated facts were served as current. That is expected by design, and it is why those tools score high on fresh retention: they never warn. mex warns when the linked code changes. On its own that produces false alarms on 38.3% of returned true facts. With mex sync re-checking the flagged facts, false alarms fall to 2.2% and fresh retention rises to 89.2%, at the cost of the one wrongly renewed fact in note 3.

Finding the code a fix needs

03

SWE-Explore gives a tool a repository and a real GitHub issue, and asks for a ranked list of the code regions that matter [1]. It contains 848 issues. We report the 656 written in languages mex supports: 546 in Python and 110 in JavaScript, TypeScript or Rust.

The metric is issue Hit@k: the share of issues where the top k results contain code the fix needed. We compare against keyword search (BM25) [2], the standard lexical baseline. None of the five other graph tools has a published SWE-Explore result, so this comparison is against keyword search only.

Table 2 · Issue Hit@k on SWE-Explore, by language
Issue Hit@k on SWE-Explore, by language
Issuesmex Hit@5 (higher is better)mex Hit@10 (higher is better)Keyword (BM25) Hit@5 (higher is better)Gain at Hit@5
All mex languages (656)65.9%73.6%30.2%+118%
Python (546)68.7%76.2%32.4%+112%
JS / TS / Rust (110)51.8%60.9%19.1%+171%
Table 2. Scored with the SWE-Explore evaluator. Gain is the relative improvement of mex over keyword search at Hit@5.

In practice: When your agent starts on a bug, mex more often puts the code that actually needs changing in the first five results it reads.

Figure 2 · Issue Hit@k on SWE-Explore
0%25%50%75%100%All mex languages656 issues65.9%73.6%30.2%Python546 issues68.7%76.2%32.4%JS / TS / Rust110 issues51.8%60.9%19.1%
Figure 2. mex more than doubles keyword search at Hit@5 on all three issue groups. The gap is widest on JavaScript, TypeScript and Rust, where keyword search finds the right code for fewer than one issue in five.

Reading the result. Finding the file is the easy part. The harder part is how much of what comes back is useful. On Python, 44% of the lines mex returned were relevant, against 10% for keyword search, measured without a line cap. Less of what mex returns is noise the agent has to read past.

Staying exact as the code changes

04

A code graph is only useful if it tracks the code. Graph tools typically update incrementally after a commit instead of rebuilding from scratch. Incremental updates can drift: a renamed function keeps its old edges, a deleted file leaves nodes behind.

We replayed commits one at a time (16 single commits and 80 commits) plus one 80-commit jump. After each step, we compared the tool's incrementally updated graph with a clean rebuild by the same tool.

Table 3 · Incremental update vs the tool's own clean rebuild
Incremental update vs the tool's own clean rebuild
ToolIdentical to its own clean rebuild (higher is better)Worst drift (lower is better)
mex24 / 240
code-review-graph21 / 240.1% of edges
codebase-memory-mcp12 / 14 (rebuilds every commit)1.7%
graphify (CLI)4 / 6 (rebuild only)5 stale nodes
codegraph2 / 2410.3%
graphify (hook)0 / 2316.8%
GitNexus12 / 22124.6%
Table 3. Consistent with its own rebuild. This measures whether updates stay in step with a full rebuild, not whether a graph is complete or correct. Denominators differ because not every tool completed every check.

In practice: After each commit in these tests, the graph your agent queried was the same one a fresh rebuild would have produced.

Figure 3 · Incremental update vs clean rebuild, one square per check
mex24 / 24code-review-graph21 / 24codebase-memory-mcp12 / 14graphify (CLI)4 / 6codegraph2 / 24graphify (hook)0 / 23GitNexus12 / 22
Figure 3. One square per check. mex matched its clean rebuild on all 24. The worst drift elsewhere ranged from 0.1% of edges to 124.6%.

Reading the result. Agents query the graph between rebuilds, so whatever drift an update leaves behind is what they see. Matching a clean rebuild at every step means the graph an agent queries is the graph you would get by rebuilding from scratch.

Finding the right symbol first

05

For symbol search we used code-review-graph's public task set: 15 searches and 9 multi-hop tasks. It is a small set, so treat the differences as directional. We report mean reciprocal rank (MRR), which rewards putting the right answer near the top, and Hit@1, the share of searches where the first result is right.

Table 4 · Search on code-review-graph's task set
Search on code-review-graph's task set
ToolSearch MRR (higher is better)Hit@1 (higher is better)Multi-hop (higher is better)
mex0.71066.7%0.556
graphify0.66960.0%0.000
codegraph0.63953.3%0.370
code-review-graph (+ embeddings)0.52646.7%0.889
GitNexus (+ embeddings)0.24520.0%0.222
codebase-memory-mcp0.15413.3%0.222
Keyword (BM25)0.1050%n/a
Table 4. 15 searches and 9 multi-hop tasks. Small set. Tools marked + embeddings used their embedding search.

In practice: Ask for a function and the right one is usually first, so your agent spends fewer steps choosing between matches.

Figure 4 · Search MRR on code-review-graph's task set
0.00.20.40.60.8mex0.710graphify0.669codegraph0.639code-review-graph (+ embeddings)0.526GitNexus (+ embeddings)0.245codebase-memory-mcp0.154Keyword (BM25)0.105
Figure 4. mex had the highest search MRR (0.710) and Hit@1 (66.7%). Keyword search ranked the right symbol first in none of the 15 searches.

Reading the result. An answer ranked fourth still costs the agent a step to work out which of several matches is right. A first-place answer removes that step. Multi-hop is the exception here: code-review-graph, using embeddings, scored 0.889, well above mex at 0.556.

Impact analysis with the fewest false alarms

06

Before changing code, an agent wants to know what else the change affects. We asked each tool for the impact set of a change, and checked it against 200 real commits: the files that actually changed together.

Table 5 · Impact analysis against 200 real commits
Impact analysis against 200 real commits
ToolPrecision (higher is better)Recall (higher is better)F1 (higher is better)
mex11.4%25.1%0.157
codebase-memory-mcp6.1%19.6%0.093
code-review-graph3.7%49.6%0.070
graphify2.0%52.3%0.039
codegraph1.8%54.9%0.036
GitNexus0.7%46.5%0.015
Table 5. Scored against files that changed together in real commits. That is a proxy, not a causal truth: files can change together without depending on each other.

In practice: When mex says a change may affect another file, it is right more often than the other tools, but it also misses more of the files that do change.

Figure 5 · Impact analysis: precision against recall
0%2%4%6%8%10%12%14%0%10%20%30%40%50%60%RECALL →PRECISION →F1 = 0.05F1 = 0.10F1 = 0.15mexcodebase-memory-mcpcode-review-graphgraphifycodegraphGitNexus
Figure 5. Precision against recall, with dashed lines of equal F1. mex sits highest on precision and is the only tool above F1 = 0.15. Four tools reach higher recall by returning far more files.

Reading the result. There is a real trade-off here. Four of the five other graph tools find more of the co-changed files, but at precision between 0.7% and 3.7%, so most of what they flag did not change. mex flags fewer files and is right more often. Recall is where mex has the most room to improve.

How the tools differ beyond the scores

07

The numbers above come from different tests. The table below puts the graph tools side by side on what was measured, and on where their knowledge lives.

Table 6 · Code graph tools, side by side
Code graph tools, side by side
Measuremexcodegraphcode-review-graphcodebase-memory-mcpgraphifyGitNexus
Exact after incremental updatesYes, 24 / 24No (10.3%)Mostly (21 / 24)Rebuilds on commitsHook: up to 16.8%No (124.6%)
Search MRR0.7100.6390.5260.1540.6690.245
Project knowledge linked to codeYesNoNoNoDocs, no code groundingNo
Where knowledge livesMarkdown in your git repon/an/an/aLocal graph fileLocal graph DB
Table 6. Measured rows come from Tables 3 and 4. graphify's update result is its hook mode.

In practice: Of the graph tools tested, only mex keeps project knowledge in your repo, linked to the code, and stays exact after updates.

For the memory tools, the practical difference is what has to run, and whether the knowledge can be reviewed like code.

Table 7 · Memory tools: what has to run
Memory tools: what has to run
ToolWhat has to runReviewable in a git PR?
mexThe CLI. Markdown plus local SQLite, no background serviceYes
mem0878 MB Python env + 88 MB model; local vector DBNo
cognee1.7 GB env + about 750 MB modelsNo
agentmemoryAbout 1 GB + background daemon on 4 portsNo
HindsightHTTP server + embedded PostgresNo
Plain AGENTS.mdNothingYes

In practice: mex runs no background service, and its memory is Markdown you review in a pull request like any other change.

mex is the only tool tested that is git-native, linked to specific code, and checked against every code change with no LLM.

Not measured. supermemory, Zep, Graphiti, Letta and TencentDB-Agent-Memory need an LLM provider, a hosted or paid service, or several services, so they fall outside the free-and-local rule. codegraph, code-review-graph, codebase-memory-mcp, graphify and GitNexus have no real project-knowledge layer to test, so they appear only in the code graph sections.

Method and limits

08

Setup. Every tool was installed and run by us, on the same machine, against the same repositories and tasks. Competitors ran in their native modes without an LLM. Answer keys came from the benchmark (SWE-Explore), from repository history (co-changed files), or from the audited Hono fact set. The mex sync run needed a Windows launch workaround for the agent.

Scoring. SWE-Explore results use the benchmark's own evaluator. Update consistency compares each tool against its own clean rebuild. Search uses code-review-graph's published task set. Impact analysis is scored against files that changed together in 200 real commits.

Full method and raw data. The detailed method, the benchmark harness and the raw results are in BENCHMARKS.md in the mex repository.

Limits. We want these to be as visible as the results.

  • SWE-Explore results cover the 656 of 848 issues in languages mex supports. We make no claim about the rest.
  • The search set is small: 15 searches and 9 multi-hop tasks.
  • Co-changed files are a proxy for impact, not a causal truth.
  • The knowledge benchmark covers one repository, Hono. Its 132 facts were written with AI and its answer key was audited by AI. A maintainer spot check is pending.
  • Competitors ran without an LLM. mex check + mex sync uses one, so that row is not a like-for-like comparison with their AI update paths, which we did not test.
  • In the sync run, one outdated fact (h018) was wrongly renewed. It is counted in the results.

None of this supports claims like "most accurate" or "always correct", and we don't make them. The claim the data supports is narrower. On these tests, mex found the code a fix needed far more often than keyword search, ranked symbols best on a small search set, stayed identical to its own clean rebuild, and served far fewer stale facts than the memory tools we could run free and locally.

What we're working on next

09
  • Over-renewal in mex sync. The h018 error came from renewing an outdated fact that lists a complete set (the CORS default methods). Fixing it is on our roadmap.
  • Retrieval recall. mex trails four of the five other graph tools on impact recall. We want to raise it without giving back precision.
  • A maintainer-checked answer key. The spot check of the Hono fact set is pending. Until it is done, we disclose it.

References

10
  1. Zhang, S. and colleagues. "SWE-Explore: Benchmarking How Coding Agents Explore Repositories." arXiv:2606.07297, 2026.
  2. Robertson, S. and Zaragoza, H. "The Probabilistic Relevance Framework: BM25 and Beyond." Foundations and Trends in Information Retrieval, 2009.
  3. mex. 90% less noise, up to 70% fewer tokens: the numbers behind mex. August 2026.