Mental model
Module 14: Find the layer that actually failed- Use traces and evidence inspection to distinguish ingestion, retrieval, reranking, context, generation and citation failures.
Use traces and evidence inspection to distinguish ingestion, retrieval, reranking, context, generation and citation failures.
Engineering focus: Find the layer that actually failed
Use traces and evidence inspection to distinguish ingestion, retrieval, reranking, context, generation and citation failures.
You are not expected to know the engineering vocabulary before using the idea. Formal terminology comes after the mental model.
Carry one evidence-grounded knowledge assistant through all 18 modules. Preserve source IDs, retrieval evidence, evaluation cases, authority decisions and security assumptions so every improvement is measurable.
Troubleshooting RAG is like tracing a packet: follow the evidence through every hop and find the first point where expected state diverges.
Fix the first broken layer instead of tuning the prompt for every symptom.
If parsing lost the relevant paragraph, changing the prompt is wasted effort.
For each query, capture candidates, scores, filters, reranked order, final context and answer citations.
Change chunking, model, top-k or reranking independently where possible so improvements are attributable.
A system that performs well only when an answer definitely exists is not production-ready.
Module 14: Find the layer that actually failedQuestion wrong?
↓ no
Source ingested? → no: INGESTION
↓ yes
Relevant chunk in top-k? → no: RETRIEVAL
↓ yes
Survives filter/rerank/context? → no: CONTEXT
↓ yes
Answer supported? → no: GENERATION
↓ yes
Citation points to support? → no: CITATIONTeams keep changing prompts but the failure persists.
Find the earliest divergent layer before tuning downstream behavior.
Goal: Classify four synthetic failures into retrieval, context or generation layers.
python3 - <<'PY2'
cases={'A':'relevant chunk absent from top-k','B':'relevant chunk retrieved but removed by bad filter','C':'good context supplied but answer invents extra fact','D':'citation points to wrong chunk'}
labels={'A':'retrieval','B':'context/filter','C':'generation','D':'citation'}
for k,v in cases.items(): print(k,labels[k],v)
PY2Record the intermediate source IDs, ranks, metadata or state produced by the baseline. Explain which pipeline layer this evidence belongs to.
Take a retrieval failure and try to fix it only by changing the generation prompt. Explain why the symptom cannot be repaired downstream.
Find the earliest divergent layer before tuning downstream behavior. State the failing layer, change only that layer, then repeat the verification checks.
Record: hypothesis → evidence → change → observed result → remaining limitation. Keep this note with the running Evidence Desk project.
Production RAG improves when every change can be traced to evidence at a specific pipeline layer. In production, retain the before/after evidence so the same failure can become a regression test.
Trace spans pipeline layers
Failure taxonomy used
One-change-at-a-time experiments recorded
It directs engineering effort to the layer that actually failed.
Candidates, filters, ranks, final context, generated answer and citations.
To attribute improvements or regressions.
To measure abstention and unsupported-answer behaviour.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.