Entry 03Retrieval · evaluation2026

My embedding search beat keyword search on 1,222 chunks of notes and lost to it on the full collection of 57,562

I built a hybrid retrieval engine over my own working notes. It combines keyword search with embedding-based search, which compares numeric representations of what each passage means, and I measured how well it finds things. On a 1,222-chunk development set the embedding side beat keyword search. On the full collection of 57,562 chunks, a ten-question probe found the reverse: keyword search alone beat every hybrid configuration I tried, and four of the five paraphrased questions returned nothing useful. On paraphrased questions, a labelled evaluation that followed put keyword search ahead on one score and the re-ranked hybrid slightly ahead on another.

full collection, chunks57,562
useful answers in the full-scale probe5 of 10
dev set, embedding score0.731
dev set, keyword score0.436

Results on the development set and on the full collection

The notes are split into chunks (short passages of text). On a development set of 1,222 chunks from 82 Claude Code sessions, I tested seven paraphrased questions, which describe a memory in different words from the ones I originally wrote. On nDCG@10, a 0-to-1 score of how well the top ten results rank relevant passages, the embedding side scored 0.731 and keyword search 0.436.

The first test on the full collection was a probe: ten questions, five keyword-shaped and five paraphrased, with the top three results judged by hand. The production default returned something useful for five of the ten. Four of the five paraphrased questions, the case the embedding side was built for, returned nothing useful.

Search methodRank of the correct answer · 5 paraphrase questions in the probe
Keyword (BM25, a standard keyword-ranking formula)3 · 1 · 1 · 5 · 1
Embedding>200 · 7 · 2 · 107 · 1

Here the correct answer is any chunk containing a known key term, such as nohup, so this is a rough check; >200 means no such chunk was in that method’s top 200. Keyword search alone beat every hybrid configuration in the probe, the reverse of the development-set result. My working explanation is that at this size embedding similarity scores stop separating good matches from bad ones.

A labelled evaluation followed: 20 questions written before looking at the notes, the top five results of five configurations pooled, and each result graded by Claude 0 (irrelevant), 1 (related) or 2 (the memory wanted). On the paraphrased questions, keyword search alone scored 0.422 nDCG and 0.300 Hit@1 (the share of questions whose first result was relevant). The hybrid that always re-ranks scored 0.447 and 0.200.

For several of the failed questions, the answer was in a file the index returns for other questions. The collection held the answer, and the system did not connect a paraphrased question to a document it already had.

How the investigation went

  1. My first explanation was that the larger collection was diluted by lower-quality material. Restricting the search to the single highest-quality source of notes did not improve results in that run, so I rejected that explanation.
  2. A diagnostic then separated answers that were never retrieved (a recall problem) from answers that were retrieved and ranked too low (a ranking problem). In the probe the misses were ranking problems. In the labelled evaluation, half the paraphrased questions had no relevant passage in any configuration’s top five.
  3. A query-adaptive router, the component that decides for each question whether to run the expensive re-ranker, had been shipped as the default. It ran the re-ranker only when a question looked like a keyword search, and it had been tuned on a 1,271-chunk snapshot. In the labelled evaluation it scored worst of six configurations on paraphrased questions: 0.000 Hit@1, against 0.200 when the re-ranker always ran. The same day I made always re-ranking the default, at about three seconds per query.
  4. A code review found that the scorer retrieved deeper than the set of results that had been judged. The re-ranked configuration was returning documents nobody had graded and was marked wrong for them. Fixing the bug raised its paraphrase nDCG from 0.352 to 0.447, above keyword search alone at 0.422.

Evaluation methods used

A stop condition written in advanceBefore anything was built, I wrote down that the project would stop after one session if a local re-ranker did not beat the existing baseline. The re-ranker passed that test, so the project went ahead.
No tuning on unlabelled examplesThe router’s cut-off (0.131) underperformed on the full collection and was not re-fitted to eight unlabelled examples from it. The fusion weights, which set how much each search method counts in the hybrid, were also not re-fitted to the five probe questions. My written project plan records both decisions.
Questions that have no answerTwo negative controls, questions with no answer anywhere in the collection, check whether the system invents matches. The embedding side scored a nonsense query about sourdough hydration 95% as highly as an answerable question.
Judging pooled results without knowing their sourceCandidates were pooled from five retrieval configurations and shuffled, with no indication of which system found them. This stops the existing system from winning by being graded only on its own results.
Who produced each labelEach label records who produced it. All 194 labels in the July evaluation came from Claude, and the check against my own judgments was not run. A re-test started on 1 November 2026 and is paused at the judging step. Its plan is for a model to label most results and for me to score a random 50 blind, then report how often we agree.
RetrievalEvaluation PythonOffline / CPU

Questions about the method? Email is best — [email protected] · Back to portfolio