Mental model
Module 17: Use more steps only when the problem needs them- Learn routing, query decomposition, iterative retrieval and GraphRAG concepts without turning every RAG flow into an uncontrolled agent.
Learn routing, query decomposition, iterative retrieval and GraphRAG concepts without turning every RAG flow into an uncontrolled agent.
Engineering focus: Use more steps only when the problem needs them
Learn routing, query decomposition, iterative retrieval and GraphRAG concepts without turning every RAG flow into an uncontrolled agent.
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.
Advanced retrieval is a planner with a leash. Routing, decomposition, graph search and iterative retrieval are useful only when bounded, observable and justified by the query.
Complexity must improve measured outcomes enough to justify added cost and failure modes.
A simple retriever is easier to test and operate. Add routing or iteration only when evaluations show a real need.
Different query types may use different corpora, retrievers or tools.
Some answers require first finding an entity or fact, then using that result to retrieve another source.
Limit steps, tools, time and cost; keep trace evidence for each decision.
Module 17: Use more steps only when the problem needs themquery
↓ router
├─ basic/hybrid search
├─ entity/graph path
└─ multi-hop decomposition
step 1 evidence
step 2 evidence
step 3 STOP (budget reached or sufficient)An agentic retriever loops, becomes expensive or loses the evidence trail.
Bound every iterative retrieval process.
Goal: Route queries to two mock knowledge domains and enforce a maximum retrieval-step budget.
python3 - <<'PY2'
def route(q): return 'network' if any(x in q.lower() for x in ['port','dns','route']) else 'general'
for q in ['Which port is open?','What is our leave policy?']: print(q,'->',route(q))
max_steps=3; print('retrieval_budget=',max_steps)
PY2Record the intermediate source IDs, ranks, metadata or state produced by the baseline. Explain which pipeline layer this evidence belongs to.
Simulate an iterative retriever without a stop rule, then add max_steps=3 and an explicit stop reason.
Bound every iterative retrieval process. 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.
Routing justified by eval
Step/time/cost budgets enforced
Stop reason and evidence trace retained
When simpler retrieval fails representative tasks and the added complexity measurably helps.
Selecting a retriever, corpus or tool path based on the query/task.
Using intermediate evidence to formulate additional retrieval steps.
Step, tool, time and cost budgets plus stop conditions and tracing.
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.