Skip to main content
Retrieval quality concerns which evidence was returned and where it appeared. It is separate from whether a generated answer faithfully used that evidence. Use this guide alongside the broader RAG evaluation guide.

Pin the protocol

The current built-in retrieval workflow is explicitly lexical. Its schema includes method: "lexical", a bounded topK, a historical cutoff, an organization-owned document ID set, and a reference version. The metric computer is more general than this particular built-in execution route; do not infer a Jev reranker or arbitrary vector-database integration from the metric names. The workflow pins corpus content and revalidates access and content before execution. A changed corpus or revoked access must not silently become comparable evidence from the original corpus.

Bring your own retriever

The source SDKs include a local scorer for observations from your own search system. It needs no EvalGate account, credential, or network connection. Keep query text and document contents inside your environment; the scorer needs only relevance-unit identities and labels. Check the installed release’s capabilities before using these new commands; source availability does not establish package publication. Write one observation per line in observations.jsonl:
Run the same command using the TypeScript or Python SDK CLI:
This example measures recall as 2/3 and fails the requested 0.8 threshold. You can also gate --min-precision, --min-ndcg, and --min-mrr, each between 0 and 1. Human output is the default; JSON includes metric values, availability, per-query reasons, protocol identities and the gate result. Macro means use every declared query, and confidence intervals use 2,000 bootstrap resamples with seed 42. The shared reference fixture tests the same observations and intervals in both SDKs. Each query ID must be unique. Duplicate returned IDs count once at their first occurrence, while duplicate reference labels are rejected. completeRelevantSet asserts that the labelled population is exhaustive; use false when that cannot be established. Empty results can score zero against a known relevant population. A population with no relevant examples cannot establish recall or nDCG. Any unavailable metric takes precedence over a threshold failure, so missing evidence never becomes a passing gate. Inputs are limited to 10,000 queries and 32 MiB.

Label relevance explicitly

Each observation identifies its query, corpus, cutoff, retrieval unit, k, ordered returned IDs, relevance labels, and whether the complete relevant population is known. The current reference gains are integers from 0 through 4. A zero gain explicitly means non-relevant. An absent label means unknown, not non-relevant. Do not claim exhaustive recall against a corpus when only a partial set of relevant documents has been labeled.

Metric semantics

MRR is not the average rank position. A first relevant document at rank 4 contributes 1/4. A higher reciprocal-rank score means the first relevant result appeared earlier. For example, with k = 3, returned IDs [A, X, B], complete relevant set [A, B, C], and explicit label X = 0: precision is 2/3, recall is 2/3, and reciprocal rank for this query is 1.

Missing evidence is not zero quality

A partial scan, permission violation, missing reference set, or returned item without a label prevents the corresponding valid measurement. Duplicate reference identities are invalid. Returned duplicates are handled using first unique relevance units. The aggregation does not quietly drop invalid queries and publish a selective-cohort mean. When a required query metric is unavailable, the aggregate remains unavailable with the missing count and reasons.

Be precise about ranking ties

The current observation contract records ordered IDs, not a complete score distribution and tie-breaking provenance. It cannot, on its own, establish how much ranking quality came from a candidate scorer versus the original order used to resolve ties. For an external reranking experiment, retain the raw candidate scores and tie policy in a separately reviewed experiment protocol. Report model-only and hybrid-system results separately; do not describe that diagnostic as an already shipped automatic EvalGate report. Continue with Compare evaluators and Read evaluation evidence.