Skip to course content
Free RAG fundamentals course

Introduction to RAG and Knowledge Assistants

Unit 10.00: Mapping the whole path from question to answer

You cannot debug a stage you never named. Most RAG systems are drawn as three boxes and debugged as one.

Seven stages, seven failure modes

Receive, rewrite, filter, rank, generate, check, respond. Each produces something specific and each fails in a way the others cannot cause.

The table below lists all seven with what they produce and how they break.

receive   -> question + user identity           can fail: no identity, cannot filter
rewrite   -> query + extracted filters          can fail: over-expansion loses the question
filter    -> eligible chunks only               can fail: ACL missing, restricted chunk becomes a candidate
rank      -> top-k by similarity                can fail: k too small, right chunk excluded
generate  -> answer + citations                 can fail: claims not in the cited chunk
check     -> supported? conflict? stale?        can fail: no check exists
respond   -> answer, refusal, or escalation     can fail: no refusal path

7 stages, each with its own failure mode.
Draw this before writing code. Most RAG systems are debugged one stage
at a time, and you cannot do that if you never named the stages.

Read the failure column as a diagnostic checklist. A wrong answer is caused by exactly one of these seven, and every earlier module in the course has supplied a way to distinguish them: retrieval logs for rank, the term-overlap check for generate, the empty-result log for filter.

Notice receive fails when identity is missing. That looks trivial and is not - without identity there is no group list, so the access filter cannot run, and the system either fails closed and answers nothing or fails open and answers everything.

The mistake this prevents

The mistake is drawing the diagram after building the system. Drawn afterwards it describes what exists; drawn first it forces the question of what each stage is responsible for, which is where the missing check and the missing refusal path become visible.

Takeaway

Name every stage before writing code, with its output and its failure mode. Debugging RAG means localising a failure to one stage, and that is only possible for stages that exist as named things.