RAG lesson 06 · Evaluate the RAG pipeline
Versioned evidence corpus · deterministic retrieval fixtures
Lighthouse Policy Evidence Assistant. A fictional support assistant answers questions from a versioned product-policy corpus. It must retrieve current, authorized evidence, cite exact source spans, and abstain when evidence is missing or conflicting.
01 · Smallest useful mechanism
Retrieval metrics answer whether expected evidence was found and ranked. Context metrics inspect what generation actually received. Grounding and answer metrics test support and usefulness. Slices and critical cases keep aggregate gains honest.
Measure candidate recall before judging prose produced from missing evidence.
02 · Experiment
Deterministic retrieval fixture
This workbench uses inspectable ranking and evidence fixtures and injected failures. It does not make live calls or execute external effects.
Retrieval workbench · lighthouse-eval-v6
Injected failure
Recall@5 rises from 0.78 to 0.86, but one cross-tenant chunk is selected and Polish citation correctness falls by 18 points.
The trace has not run.
Commit to an implementation, then inject the failure and inspect the actual state transitions.
03 · Implementation brief
Your learning artifact
Stored only in this browser. No account required; course reset does not delete it.
04 · Check your understanding
Primary sources · verified 2026-08-02
A stronger generator can mask worse retrieval on easy questions; an automated judge can reward fluent unsupported prose; average Recall@k can hide complete failure for one language, tenant, or policy type.
Common mistake: RAGAS, nDCG, or one model judge can be the release gate by itself. Each metric embodies a construct, labels, thresholds, and blind spots. Release evidence needs component metrics, calibrated judgments, critical invariants, and raw cases.
Transfer exercise: Compare baseline and candidate on eight paired queries; inspect Recall@5, nDCG@5, context precision, claim support, abstention, latency, and critical failures.
Next: Evaluation establishes the release argument; production security and operations must keep corpus, index, permissions, and evidence coherent after launch.