Execute retrieval and distinguish filtering, recall, ranking and no results.
Understand the method
Run the command from the extracted folder. --retrieve does not call a model or generate an answer. Inspect IDs, versions, audience, text and scores in evidence; these are the basis for diagnosis.
retrieve() excludes archived records, filters applicability, scores overlap, removes zero matches and returns the top three. Ties use IDs for reproducibility. Linear scanning is sufficient for this tiny corpus, not a claim about large-scale performance.
With intern selected, P1 is excluded while P2 and general rules may remain. A candidate is not automatically supporting evidence. P2 helps explain a missing cap; it does not supply one.
For a miss, check corpus inclusion, filters and wording in that order. Only the wording problem may improve with synonyms or semantic search. Raising top_k cannot recover a rule that does not exist.
The lab fixes top_k at three. More candidates can increase recall and noise; fewer may drop a source required for a multi-part answer. Q10 checks whether both repair and booking evidence are present.
Save outputs with the exact question, audience, corpus version and candidate order. A final answer alone cannot distinguish retrieval and generation defects. Real systems should also log latency and errors while limiting private data.
- 1Status
- 2Audience
- 3Rank
- 4Inspect
Included material
Run supplied cases against the same Chinese corpus: python3 rag_lab.py --case Q2 python3 rag_lab.py --case Q5 python3 rag_lab.py --case Q12
Work through the steps
- Run the intern question and confirm that P1 and P1-old are absent.
- Check that P4 is retrieved and inspect the full text.
- Observe the no-evidence query and save its actual JSON.
Worked example
Expected structure, not a simulated model answer: mode: retrieval-only evidence: candidate list Intern case includes P2 and excludes P1. The supplied out-of-scope case has no matches; a changed question may accidentally overlap.
Your exercise
Run a paraphrase and a multi-part question. Record expected sources, actual sources and the reason for any difference.
Check before delivery
- Locate filtering before scoring and avoid treating scores as confidence.
- Use actual command output with inputs and versions.
Finish the exercise, then view the reference
Only P4 retrieved is a coverage failure. Both P4/P5 retrieved but only repair answered is a generation omission. Candidate logs distinguish the repairs.
An original course with teaching exercises. Reading records, practice outcomes and independent certification are distinct.