The retrieval contract
Given a query, corpus, access policy, and latency budget, return a small evidence set that contains the material needed to answer.
Recall first. Order second. Ground always.Change hybrid retrieval, candidate depth, metadata filtering, top k, and reranking. The live benchmark computes evidence metrics from labeled teaching corpora while the 3D scene shows which documents survive each stage.
Retrieval-augmented generation separates two jobs. A retrieval system chooses a small evidence set from a larger collection. A generator then uses that selected context to produce an answer. The quality of the answer is bounded by both stages: a careful generator cannot cite a policy it never received, and perfect retrieval does not force a model to interpret evidence correctly.
This lab makes the first job inspectable. Each scenario contains ten short chunks, synthetic semantic scores, visible metadata, and human relevance grades from zero to three. BM25 lexical scores are computed in your browser from the actual query and chunk text. The semantic values stand in for a dense encoder. They are deliberately labeled as teaching scores rather than measurements from a named model.
The semantic-weight slider blends normalized BM25 with the teaching dense score. At zero percent, exact words dominate. At one hundred percent, only semantic similarity remains. The candidate-pool control cuts the first-stage ranking before reranking, demonstrating an important constraint: a reranker cannot rescue a relevant document that retrieval excluded.
Turn on Verified to apply metadata before ranking. This can improve precision by removing untrusted notes, but a bad filter can destroy recall. Turn reranking off to inspect the first-stage ordering. Turn it back on to apply a stronger joint query-document teaching score only to the candidate pool, then compare the live Recall@k, MRR, nDCG@k, and Precision@k.
The visual scene follows the same arrays shown in the inspector. Corpus nodes begin in a shared index. Retrieval fans beams according to first-stage score. Reranking moves the candidate set into a new order. Context sends only the final top k toward the generator. Nothing is hidden behind a decorative animation.
Given a query, corpus, access policy, and latency budget, return a small evidence set that contains the material needed to answer.
Recall first. Order second. Ground always.Relevance grades are used only after ranking to calculate evaluation metrics. The benchmark never feeds the answer key into BM25, hybrid scoring, or reranking.
If a relevant chunk ranks below the candidate cutoff, later reranking cannot see it. First-stage recall sets the maximum possible downstream quality.
Metadata filters can enforce tenant, permission, freshness, language, geography, or source rules before similarity scoring. Their false negatives matter.
Larger k can recover more relevant evidence, but it also adds tokens, weak context, latency, and opportunities for contradictory passages.
End-to-end answer scores mix retrieval, prompting, model behavior, citation formatting, and evaluator noise. A retrieval benchmark isolates whether the necessary source material entered the context at all.
A canonical policy may be indispensable, a supporting procedure may be helpful, and an anecdotal note may only be marginally relevant. Binary labels collapse those differences. nDCG preserves them.
A benchmark should include paraphrases, abbreviations, stale records, near-duplicate chunks, permission boundaries, multi-hop questions, and lexical traps. Easy keyword matches produce misleading confidence.
Aggregate scores can hide failures for a tenant, language, document type, time range, or safety-sensitive workflow. Track slices that correspond to product risk and user experience.
If retrieval cannot find sufficient evidence, the system should abstain, ask a clarifying question, or escalate. Forcing an answer converts retrieval uncertainty into hallucinated certainty.
Split source material into retrieval units, preserve source identity, attach permissions and timestamps, and compute representations. Chunk boundaries influence whether one result contains a complete claim or a fragment that depends on missing neighbors.
IndexUse lexical, dense, sparse, or hybrid search to maximize candidate recall under a latency budget. Approximate nearest-neighbor indexes trade a small amount of recall for large speed gains on high-dimensional vectors.
SearchApply access, tenant, geography, source, and freshness policy. Filtering early reduces exposure and cost, but every rule needs tests for accidental exclusion of relevant evidence.
PolicyScore the query and each candidate jointly with a stronger model or feature set. Reranking usually improves precision and ordering, but its work scales with candidate-pool depth.
OrderDeduplicate, diversify, fit the token budget, retain citations, and represent conflicts. Context assembly is an optimization problem, not simply concatenating the top k strings.
Context"Can I return a damaged item after 30 days?"
This query needs an exception policy, not only the standard return window. Dense retrieval helps connect damaged goods with warranty language; lexical retrieval catches the explicit 30-day wording. A strong reranker should place the canonical damaged-item policy above a high-scoring complaint note.
No. They are deterministic teaching values designed to expose common ranking tradeoffs. BM25 is computed from the visible query and chunk text. Relevance labels are used only to calculate metrics. A production benchmark should run the exact embedding model, index, filters, and reranker used by the application.
Joint query-document scorers are usually more expensive than vector or lexical retrieval because they process each pair together. A fast first stage narrows millions of candidates to a manageable pool, and a stronger reranker spends computation only on that pool.
No. Similarity estimates relevance under a representation and objective. It does not guarantee authority, freshness, factual correctness, permission, or completeness. Source policy and downstream verification remain necessary.
Usually not. More context can increase recall, but irrelevant or contradictory passages can reduce answer quality and increase latency and cost. Tune k against retrieval and end-to-end evaluations rather than treating context capacity as a target.
Recall measures how much of all relevant evidence was recovered. Precision measures how concentrated the returned set is with relevant evidence. Increasing k often raises recall and lowers precision, which is why both should be observed.
It can, but access-control filters should generally constrain candidates before protected content is returned or processed. Some vector systems support pre-filtering; others approximate it or combine filtered sub-indexes. Test both correctness and performance.
Add explicit unanswerable examples and score whether the system abstains or asks for more information. Standard recall is undefined when no relevant item exists, so report a separate rejection or no-answer metric.
Reliable retrieval is observable: the corpus is scoped, candidates are inspectable, filters are tested, rankings are measured, and insufficient evidence produces an explicit stop rather than invented certainty.
Explore evidence-aware computer use