GrooveSeek

Semantic search over a Markdown knowledge base, served over MCP.

View the Project on GitHub alphabet-h/grooveseek

6. Report a corpus that quotes the golden set, and require more than one quote

Context and Problem Statement

kb-mcp eval measures retrieval against a golden query set. When the knowledge base being measured is also where its owner writes notes — the normal case for a personal or team KB — a note that quotes a golden query verbatim becomes the strongest match for that query. It takes the top slot and pushes the labelled answer down.

This was observed on the reference corpus: a note written the same day took rank 1 for a query whose wording it quoted, demoting the expected document to rank 4. Aggregate recall survived, so nothing failed; the cause was found only because a person happened to read the per-query rows. The more that is written about the evaluation, the harder the evaluation is to pass, and nothing says so.

The awkward part is that the observation has two causes and they look identical. A document that contains a query verbatim is either a note about the test, or the source the query was written from — and in the second case it belongs in that query’s expected, so the golden file is what is wrong. Only the person who wrote the golden set can tell them apart.

Decision Drivers

Considered Options

Each option was measured against the reference corpus — 662 documents, 26 golden queries, no known leak other than the one note — by counting how many findings it produces on a corpus that is healthy.

  1. Embedding similarity: report hits that are highly similar to the query text and not in expected.
  2. Verbatim quote, one is enough, top_k only: report a top_k hit whose body contains the query text verbatim.
  3. Verbatim quote, one is enough, whole corpus: the same, scanned over every indexed document rather than the retrieved ones.
  4. Verbatim quote, two or more distinct queries, whole corpus.

Decision Outcome

Option 4.

Option 1 has no threshold to find. Every top-ranked hit is highly similar to the query — that is what retrieval is — so the condition is close to “report the results”.

Option 3 produced 8 findings, all false positives. The reason is structural rather than a matter of tuning: golden queries are frequently topic names (cross-encoder, torch.compile, Qwen3.5-Omni), and a topic name appears verbatim in the documents that explain that topic. One verbatim match is what a document about a topic looks like.

Option 2 produced 0. Restricting the scan to top_k does not reduce the false positives (they are top hits by construction); it only makes the rule weaker. Measured on the same corpus, the one genuinely leaking note appeared in top_k for one of the queries it quoted and not for another, whose ten slots were all chunks of a single document.

Option 4 produced exactly one finding, and it was the note that was in fact documenting the golden set — quoting query strings inside backticks while explaining how the golden queries were designed. Quoting several golden queries is what a note about the test looks like, and it separates cleanly from the population that made option 3 useless.

The finding is named for what was measured (golden-queries-quoted), not for the cause it suggests, and the message states both possible causes. This follows the same rule as kb-mcp doctor: report the observation, name the remedies, change nothing.

Consequences