How do you make a RAG system cite sources and stay grounded?
RAG · Intermediate 3
Short answer
Give each retrieved chunk an ID and source details, instruct the model to answer only from the provided context and cite chunk IDs for each claim, and to say it does not know when the context lacks the answer. Then verify that cited chunks support each claim, and measure faithfulness on an eval set.
Deeper answer
Grounding is mostly about retrieval quality plus clear instructions and checks. Show citations in the interface so users can click through to the page, which builds trust and makes errors visible.
Automatic checks can compare each sentence with its cited text using a judge model. Track the refusal rate too: a system that never says 'I don't know' is probably guessing.
What a strong answer covers
- Chunks carry IDs and source details
- Instruct to answer only from context
- Cite per claim
- Say 'I don't know' when context lacks the answer
- Verify citations and measure faithfulness
Answer it out loud in the mock interview about 1.5 min
Follow-ups to expect
- How would you check that a citation actually supports the claim?
- What should the app show when nothing relevant is retrieved?
Common mistakes
- Asking for citations without verifying them
- Never allowing 'I don't know'
Learn it
Grounding, citations and refusing to guess
- How do you choose a chunk size for RAG?
- Your RAG app gives wrong answers. How do you find the cause?
- Design a RAG system that lets a law firm search and ask questions about 50,000 contracts.
- How would you detect hallucinations in a production RAG application?
- What are embeddings, and how are they used in search?
- What are hybrid search and reranking, and when do they help?
- How do you keep a RAG index up to date as documents change?
- How do metadata filters improve retrieval?
- How would you build RAG over documents full of charts and images?
- Your RAG system must handle scanned PDFs, tables and slides. How do you ingest them?
- How do you make sure users only get answers from documents they are allowed to see?
- What are query rewriting and HyDE, and when do they help?
- Your HR assistant keeps quoting last year's leave policy. How do you fix it?
- Tell me about a RAG system you built and how you measured whether it worked.
- Can you do retrieval for long documents without a vector database?
- What is RAG, and why would you use it?
- When would you use graph RAG instead of standard vector RAG?