RAG & Retrieval·Question 46 of 100Advanced

A user reports the RAG assistant gave a wrong answer. Walk me through your triage.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

The discipline is a binary split first: retrieval miss or generation miss? Everything else follows from that fork, and the tooling prerequisite is per-request tracing - logged query, rewritten query, retrieved chunks with scores, final prompt, and output. Without traces you're guessing; say so.

Full worked answer with diagram

The discipline is a binary split first: retrieval miss or generation miss? Everything else follows from that fork, and the tooling prerequisite is per-request tracing - logged query, rewritten query, retrieved chunks with scores, final prompt, and output. Without traces you're guessing; say so.

Step 1 - was the right information in the prompt? Pull the trace, find where the correct answer lives in the corpus, check whether that chunk was in the assembled context.

If absent → retrieval miss. Walk backwards up the pipeline: Is the answer in the corpus at all? (Coverage gap - no retrieval tuning will fix a missing document.) Did parsing mangle it? (Look at the chunk text for the source page - tables and PDFs, the usual suspects.) Did chunking split the fact across boundaries or bury it in a multi-topic chunk? Did the query rewrite corrupt intent (check original vs rewritten)? Did embedding/lexical search rank it poorly (query the index directly for the gold chunk's rank - if it's at rank 40, is it a semantic gap, a missing exact-match path, a filter wrongly excluding it)? Did the reranker demote it from top-50 into oblivion (compare pre- and post-rerank positions)? Each has a different fix: ingest the doc, fix the parser, re-chunk, adjust rewriting, add hybrid search, tune or retrain the reranker.

If present → generation miss. Sub-triage: model ignored the context (position issue - was the chunk buried mid-context among 20 others? Lost-in-the-middle; reduce k or reorder), misread it (chunk lacks surrounding context - consider parent-document retrieval or contextual enrichment), got contradicted by other retrieved chunks (stale duplicates - freshness/dedupe bug), or overrode context with parametric belief (prompt/grounding-instruction fix, or model upgrade). Reproduce by re-running generation with the same prompt; if it's intermittent, that points to sampling variance and prompt robustness.

Step 2 - generalise. One report is a sample from a failure distribution: add the case to the golden set, search logs for similar queries, and check whether the class of failure (e.g., "all table-based answers fail") is systemic. In practice retrieval misses are the more common culprit, and "hallucination" complaints are very often retrieval failures wearing a costume - the model confabulated because the evidence wasn't there.

Worth sketching. Triage is a tree, and drawing it proves you have actually debugged one of these rather than read about it.

flowchart TD
    T["Pull the trace"] --> Q{"Was the gold chunk<br/>in the final prompt?"}
    Q -->|"no"| R{"Is it in the<br/>corpus at all?"}
    R -->|"no"| C["Coverage gap:<br/>ingest the document"]
    R -->|"yes"| P{"Its rank when you<br/>query the index directly"}
    P -->|"never returned"| PA["Parse or chunk defect,<br/>or a filter excluded it"]
    P -->|"rank 40"| H["Missing lexical leg,<br/>or the rewrite broke intent"]
    P -->|"top 50, gone after rerank"| RK["Reranker demoted it"]
    Q -->|"yes"| GM["Generation miss: buried mid-context,<br/>misread, or contradicted by a stale duplicate"]

What a good answer covers

  • The discipline is a binary split first: retrieval miss or generation miss?
  • Everything else follows from that fork, and the tooling prerequisite is per-request tracing - logged…
  • Without traces you're guessing; say so
  • Step 1 - was the right information in the prompt?
  • Pull the trace, find where the correct answer lives in the corpus, check whether that chunk was in the…

Key terms: If absent → retrieval miss · If present → generation miss · Step 2 - generalise

Interviewer follow-ups to expect

  1. What must be in your traces to make this triage take minutes, not hours?

  2. The gold chunk was retrieved at rank 3 and the model still ignored it - top three hypotheses?

  3. How do you decide whether one bad answer warrants pipeline changes?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep