RAG lesson 01 · Define the retrieval contract
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
A RAG system joins ingestion, search, ranking, context assembly, generation, and evidence validation. Each stage can fail independently, so the product contract must name the answer claim and the evidence needed to support it.
Retrieval changes the model context; it does not make the resulting answer true.
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-contract-v1
Injected failure
A stale 14-day policy ranks above the current 30-day clause; a marketing FAQ promises 60 days.
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 polished answer may cite stale, unauthorized, merely topical, or contradictory text. Without a retrieval contract, no metric or vector database configuration can say whether the product succeeded.
Common mistake: If the top chunk is semantically similar, the answer is grounded. Similarity estimates topical relation. Grounding requires current, authorized evidence that supports each material claim under the product’s rules.
Transfer exercise: Compare a topical marketing FAQ, a stale policy, and the current authoritative clause for the same question; decide what the product may claim.
Next: A retrieval contract depends on a corpus whose parsing, chunking, identity, and deletion semantics preserve the source truth.