Skip to content

Case study: trace a document-ranking comparison to its inputs

Two simple rankers can disagree even on six short help articles. This case study compares word counting with BM25, then follows one difference back to a question, its relevance label and the saved ranking. The purpose is to demonstrate an inspectable comparison, not to establish a search-engine benchmark.

Experiment and observed result

The bundled starter contains six English articles and five authored questions. Each program returns all article IDs in ranked order. The grader receives the expected article separately, verifies that the output is a permutation of the article IDs, and measures reciprocal rank and whether the expected article is first. Each candidate runs once on every question: ten trials in total.

A fresh installed development wheel completed 10/10 trials successfully on macOS arm64 with CPython 3.12.12. No API key, model endpoint or container service was used. The retained results were:

Candidate Successful trials Expected article first Mean reciprocal rank
Word count 5/5 3/5 0.7666667
BM25 5/5 5/5 1.0000000

For how can I change files without changing the original?, the expected article is folder. Word count placed it third, behind skill and chat; BM25 placed it first. The corresponding reciprocal ranks are 1/3 and 1. Both executions succeeded. Word count's zero top_one is a measured outcome, not a missing score.

The sanitized evidence record includes all ten trial scores, matched coordinates, candidate version IDs, aggregates, runtime dependency versions and SHA-256 digests of the frozen source files. It excludes process IDs, local paths and raw worker logs. Its rawResultSha256 identifies the local complete result used to derive it; that digest does not authenticate the result or imply that a new run's timestamps and IDs will match.

Reproduce it

From the development checkout root:

uv sync --locked
uv run optpilot demo ./document-search-case

Use a new directory for a clean demonstration. The command prints the run ID and the detail command. Inspect it and export an offline report:

uv run optpilot experiment detail RUN_ID --project ./document-search-case
uv run optpilot experiment report RUN_ID --project ./document-search-case \
  --output ./document-search-case.html

The verification behind this page used the same CLI from an installed wheel in an isolated environment and a separate resource registry. demo and report are development features; this page does not claim they ship in the published Core 0.2.0 package. The tutorial also gives the explicit review/run workflow and explains the measurement.

Identify the recorded inputs

Item Recorded identity
Run run-523ded94-f40f-42b4-84b9-508068ca0932
Review study-7e680208209c401f40b9e53d2712607278bac6b89709af4bb77d93e848f9563b
Manifest SHA-256 085f62db8da00c7a69bbec9a05fcb1823a000b490be9e5b86e8c2baf56021570
Article data SHA-256 d6f51db75d1286d7dbf1c4e47d9dc269e2521e0d31f8a3b65ff0144c69fafa0e
Grader SHA-256 adb99ff1b8da21a3565161c5d3271aa56963e0268316c2f3fc9dc330b61b8275

The evidence record contains the two program digests as well. Source files are the bundled src/optpilot/_starter/document_search/ project. This run used a development worktree based on commit 353c5e594d1d72a8935258b5e6321b53b542adad; uncommitted readiness changes were present. The runtime version string 0.2.0 therefore does not identify a released artifact containing this whole workflow. Use the recorded source digests to identify the experiment, and a published release plus its provenance when reproducing a release build.

What the result supports

BM25 performed better on these five authored questions. The result does not show how either method performs on users' queries, another corpus, Chinese text or a production retrieval system. The tokenizer is deliberately English-oriented; the bilingual product website does not make this ranker multilingual. Five chosen questions are too small and unrepresentative for a general ranking claim.

The useful result is the trace: a mean links to individual observations, which link to exact program and grader versions. Changing a ranker and creating a new review preserves the previous comparison. A failed trial would remain visible with an error and missing score; it would not silently become a zero. See interpreting evidence before expanding this example into a larger evaluation.