Module 06 Activity
Scenario
Retrieval works. Now the answer has to stay inside it, cite it, and refuse when nothing clears the bar.
What you build
A grounded retrieval chain returning sources, with a working refusal path and an unsupported-terms check running on every answer.
Steps
- Build the retrieval chain with the dict join, formatting documents so the chunk id appears in the context text.
- Write the grounding prompt as a list where every line names a failure it prevents.
- Return sources alongside the answer using a parallel branch, so retrieval runs once. Include the
updateddate. - Switch to scored retrieval and add a threshold set from the distributions you measured in Module 5.
- Log the best score on every refusal.
- Run the unsupported-terms check on every answer and classify the three worst flags as real or false positives.
Evidence to hand in
- The chain with the dict join and formatted context.
- The grounding prompt with the failure each line addresses.
- An answer with its sources and dates.
- The threshold with the distribution it came from.
- The unsupported-terms results, with three flags classified.
Review checklist
- Chunk ids appear in the context text, so the model can cite them.
- Retrieval runs once and feeds both the answer and the sources.
- The threshold comes from a measured distribution, not a tutorial.
- Refusals log the best score seen.
- False positives from the crude check are identified as such.
