Lab: Build rag_answer, grounded and cited
19 min read·13 Oct 2026
Module 8 · Lab · About 60 minutes · Needs: lessons 1 to 5 of this module (ingestion, storage, retrieval, generation, evaluation)
What you are building
This lab joins the module's five lessons into one function, rag_answer(question, label): answers grounded in the help centre, with citations. A question goes in; a checked reply comes out with the chunk ids it used, or the fixed sentence "I don't know, let me get a person." On the way: Lesson 1's 300-character chunks with a content hash, Lesson 2's MiniLM vectors in Chroma, Lesson 3's winner (dense search plus the category filter), and Lesson 4's grounded prompt, citation check and refusal gates. You finish with a scorecard on Lesson 5's ten golden questions. A full run makes 11 hosted calls.