Promote a retriever only after judged recall, support, access and latency checks pass for distinct query families.
Retrieval release gates: evaluate slices before changing an index
Freeze the comparison
Store query, permitted corpus snapshot, expected answer-bearing passage IDs, acceptable abstention and query family. Run current and candidate versions against the same access snapshot. Keep exact IDs, paraphrases, multilingual queries, long documents, stale revisions and no-answer cases separate. A global average can rise while one small tenant loses its only correct passage. Retrieval and answer quality remain separate measurements.
Measure decisions
For each query, measure answer-bearing candidate recall, required-fact survival in the final packet, first relevant rank and unsupported answer claims. Record p95 latency and forbidden-passage exposure; the latter must stay at zero. Some questions have no answer, so abstention matters. Compare equal cutoffs and token budgets across versions.
Set slice floors before testing
Write thresholds before seeing candidate results. A release may require no access violations, no decline in exact-ID recall and a bounded p95 increase while accepting a defined paraphrase improvement. Such thresholds are product policies, not universal constants. Inspect every newly failed query and retain it for regression work.
Canary and recover
After offline gates pass, send a small permitted traffic slice to the candidate alias and watch latency, empty-result rate and citation resolution before widening. Record encoder, extraction, corpus, filter and ranker revisions. Rollback query encoder and index alias together. Embedding migrations fail quietly when only one half is reverted.
Worked contract
def release_decision(current: dict, candidate: dict) -> tuple[bool, list[str]]:
failures = []
if candidate["access_violations"] != 0:
failures.append("access violation")
if candidate["exact_id_recall"] < current["exact_id_recall"]:
failures.append("exact-ID recall regression")
if candidate["answer_support"] < current["answer_support"]:
failures.append("answer support regression")
if candidate["p95_ms"] > current["p95_ms"] + 47:
failures.append("latency budget exceeded")
return not failures, failures
baseline = {"access_violations": 0, "exact_id_recall": .94,
"answer_support": .91, "p95_ms": 168}
candidate = {"access_violations": 0, "exact_id_recall": .95,
"answer_support": .92, "p95_ms": 199}
assert release_decision(baseline, candidate) == (True, [])
assert release_decision(baseline, {**candidate, "access_violations": 1})[0] is FalsePerformance and operating cost
Evaluation of Q queries and K candidates costs at least O(QK) identity work, plus search, rerank and answer calls. Keep a small smoke set for each change and a broader judged set before promotion. The 47 ms allowance in this example is product-specific; choose a measured budget for the actual service.
Common Mistakes
- Promoting on one average while an important tenant slice regresses.
- Changing the judged corpus between baseline and candidate runs.
- Reporting answer quality without candidate recall or access exposure.
- Rolling back the index while leaving the new query encoder active.
Validation drill
Build 120 judged questions across six slices. Compare two generations at identical top-12 and 600-token packet limits, list newly failed queries and record the rollback target.
Read next
- Embedding migrations: keep query and document vectors in one space
- Filtered vector search: measure ANN recall inside the permitted set
- Claim-level citations: verify each answer against its passage
- RAG evaluation: separate retrieval recall from answer support
Continue this retrieval path
- Incremental retrieval ingestion: replay events without reviving deleted passages
- Retrieval traces: locate the stage that lost the answer
- Query expansion: add recall terms without changing the user's question
