RAG lesson 03 · Retrieve candidates
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
Lexical retrieval excels at exact identifiers and rare terms. Dense retrieval can connect paraphrases but depends on model behavior and domain fit. Hybrid retrieval preserves both result lists and combines their ranks.
Fuse ranks or calibrated evidence; do not average incomparable raw scores.
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-hybrid-v3
Injected failure
Dense search ranks another tenant’s similar policy first; BM25 ranks a stale TrailCam 4 clause first.
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 semantic-only demo can miss product codes, negation, dates, or low-resource language. A lexical-only system can miss paraphrases and concept-level matches. Filters applied too late can leak forbidden content.
Common mistake: Cosine 0.82 is universally better than BM25 12.4. The scores come from different functions and distributions. Combine ranks or calibrate scores on representative relevance judgments.
Transfer exercise: Search “activated camera return window” and “TrailCam 4 §4.2” through lexical, dense, and reciprocal-rank-fused fixtures.
Next: Candidate retrieval optimizes coverage; reranking and context assembly must decide which small evidence set deserves the generation budget.