Ground answers in sources with citations and 'I don't know'
Complete the RAG pipeline: generate answers that cite their sources, refuse to hallucinate when retrieval is thin, and surface provenance so learners trust the output.
You're on lesson 5 of 6 in the free RAG module. Unlock the full AI Engineer curriculum →
Step 1 · concept
Ungrounded answers are a black box
A grounded answer is one where every claim traces back to a source document. A grounded RAG system doesn't just answer the question — it shows its work.
This matters for three reasons:
- Trust. Users can verify claims against the original source. "The model said X" becomes "Document Y says X", which is a very different guarantee.
- Debugging. When the answer is wrong, citations tell you whether the problem was retrieval (wrong source returned) or generation (right source, misread). Without grounding, you stare at a black box and guess.
- Accountability. In regulated domains — healthcare, legal, finance — you need an audit trail showing where information came from. An ungrounded answer is unshippable in those contexts.
Without grounding, your RAG system is a black box: the user gets an answer but has no way to assess reliability. This lesson closes that gap with three production patterns: source-labelled context, the strict-refusal branch, and structured citation output.
groundedness