In my last post I built a long-term memory layer for a debugging agent and tried to break it on synthetic data. The most robust finding there was that recency mattered more than I expected. Synthetic data proves little, so this time I ran the same retrieval layer on a real project's history: Dapper (Apache-2.0).

What this is not: there is no LLM and no agent in this experiment. It only measures whether the memory retrieves the right earlier fix. I originally wanted to run a full agent-with-memory vs agent-without comparison, but most of Dapper's tests need a live SQL Server (2,427 of 2,895 tests failed on my machine with connection errors), so "did the agent fix it?" couldn't be judged automatically.

Setup

  • Incidents: every non-merge commit whose message matches fix|bug|hotfix, that changed at most 15 files and at least one .cs file. That's 230 commits.
  • Memory entry: the commit message plus the words in the changed file paths (CamelCase split, generic words like "fix" and "bug" removed).
  • Time split: I replay history in order. For each fix, only earlier fixes are in memory.
  • Query: only the new fix's commit message.
  • Ground truth: an earlier fix is "related" if it touched at least one of the same .cs files.
  • Metric: Hit@3 (a related fix appears in the top 3) and MRR.
  • Methods: BM25 on message only; BM25 on message + paths; the same with a recency decay (half-life 180 days, chosen before running); and a baseline that needs no search at all: just show the 3 most recent fixes.

First run: the baseline won

method Hit@3 MRR
BM25, message only 60.6% 0.528
BM25, message + paths 63.5% 0.544
BM25 + paths + decay 73.1% 0.629
last 3 fixes 76.0% 0.647

208 queries, and my memory layer lost to "show the latest three." That's the point of having a baseline.

Why that result was misleading

A few core files (like the main mapper file) are touched by a large share of all fixes. With my definition, almost any earlier fix counted as "related" to any later one, which makes the recency baseline look great. So I changed the ground truth: files touched by more than X% of fix commits are ignored when deciding relatedness.

I want to be upfront: I changed this definition after seeing the first result. It's a defensible change, but it was made after the fact, so I tested three values of X instead of picking one.

Results with hot files excluded

Hit@3 / MRR:

hot-file cutoff queries text only text + paths text + paths + decay last 3 fixes
>5% (5 files) 100 36.0% / 0.304 37.0% / 0.339 54.0% / 0.430 47.0% / 0.357
>10% (3 files) 116 38.8% / 0.342 40.5% / 0.354 58.6% / 0.473 50.9% / 0.375
>20% (2 files) 135 41.5% / 0.353 42.2% / 0.356 60.7% / 0.506 60.0% / 0.479

What I take from it

  1. Text similarity alone lost to "most recent fixes" in all three settings, by roughly 11 to 18 points of Hit@3. Commit-message words were a weaker signal than time.
  2. Adding recency decay to the text search helped by about 17 to 18.5 points in every setting. This is the most stable result.
  3. Search + decay beat the no-search baseline, but not robustly: by 7.0 and 7.7 points at the stricter cutoffs, and only 0.7 points (about one query) at the loosest. The stricter I made the ground truth, the more the text signal mattered, but I can't claim it's reliably better than "last 3."
  4. File paths in the index added little (1 to 3 points), within noise.

Limitations

  • One repo. Dapper is a library with fixes concentrated in a few files. Application code may behave very differently.
  • The query leaks the answer's area. A message like "fix bug in X" names the feature. Real agents get stack traces and logs. Treat these numbers as an optimistic ceiling for this kind of retrieval.
  • "Shares a file" is a rough proxy for "same bug."
  • 100 to 135 queries. A 3-point gap is about 3 to 4 queries. Only the larger gaps (like decay vs text-only) are comfortably above noise.
  • Judgement calls: the hot-file cutoff was chosen after the first result (hence the sensitivity table), and I did not tune the 180-day half-life.
  • No LLM and no end-to-end "did it fix the bug" evaluation.

Takeaway

If you're building memory for a debugging agent, benchmark it against "the most recent N incidents" before you celebrate. In this repo the baseline was hard to beat, and the thing that moved the needle most wasn't smarter text matching but remembering when something happened.

Code: https://github.com/PouyaBasiri/retrieval_study (memory.py and retrieval_study.py). Run it on your own repo with python retrieval_study.py <repo> [hot_file_fraction].