When Single-Pass RAG Is Not Enough
Name the assumptions behind single-pass RAG and the questions that break them, see what an agentic retrieval loop adds, count the extra calls it costs, and decide per query type which design a question should get.
Contentsand lesson path
On this page
- Why it matters
- Four assumptions of a single pass
- What an agentic loop adds
- Counting the cost in calls
- Choosing a design per query type
- Check your understanding
- Apply it
- Review prompt
Lessons of Agentic RAG
- When Single-Pass RAG Is Not Enough Concept · 15 min
- Retrieval Tools: Index, SQL and Web Search Worked example · 20 min
- Lab: Decomposing Multi-Hop Questions Lab · 25 min
- Grading Evidence and Retrying Lab · 25 min
- Single-Pass Versus Agentic: A Measured Comparison Worked example · 20 min
- Check: Design an Agentic Retriever Knowledge check · 8 questions
What you will learn
- Compare agentic RAG with a single-pass pipeline on answer quality, latency and cost, and choose per query type.
Prerequisites: RAG Foundations, Agent Loops & ReAct
01. Why it matters
The pipeline you built in RAG Foundations makes one pass: it searches once with the question as the user typed it, puts the top k passages in a prompt, and calls the model once. For most documentation questions that is the right design. It is fast, cheap and easy to test.
Some questions defeat it however good the index is. Where is the lead of the team that owns nightly-report based? needs a team name before it can ask for a lead, and a lead before it can ask for an office. How many billing-sync runs failed in October? needs a count over records, not a passage that happens to mention failures. Agentic RAG handles such questions by letting a model plan the retrieval: choose a source, search, read what came back, decide whether it is enough, and search again or stop.
That flexibility costs model calls, latency and new ways to fail. This lesson sets out which questions need it, so that the rest of the skill builds it only where it pays: tools in lesson 2, decomposition in lesson 3, grading and retries in lesson 4 and a measured comparison in lesson 5.
02. Four assumptions of a single pass
A single pass quietly assumes four things. Each assumption has a matching failure, and each failure needs a different fix:
- The question is a good query. Users write parked runs where the docs say dead-letter queue, or it where they mean the Payments API. The retriever matches words or meanings, not intentions. Often a rewrite fixes this without any agent: the query-rewriting lab in RAG Foundations (lesson 4) does it in one extra call.
- The answer lives in one index. Counts, dates, owners and statuses usually sit in a database or an API. A passage that mentions three failures may be stale or partial; only a query over the records gives the current number.
- One round of retrieval is enough. In a multi-hop question, a later lookup needs a value from an earlier one. You cannot write the query for the lead's office until you know who the lead is, so no single query, however long, retrieves both facts.
- The model notices missing evidence. Given passages that are on topic but lack the answer, a model often answers anyway. The Grounding and Citations skill showed how to abstain; an agent can also look again before it gives up.
Only the second and third assumptions strictly need an agent. The first can often be fixed with a rewrite step and the fourth with an abstain rule. Separating them stops you from building a loop to solve a problem that one extra call would solve.
03. What an agentic loop adds
An agentic retriever wraps retrieval in a loop that a model controls. Four capabilities matter, and each maps to one lesson of this skill:
- Routing to tools. Each source (document index, SQL database, web search) is a tool with a description. The model picks the tool and writes its arguments; the code checks them before anything runs (lesson 2).
- Decomposition and rewriting. The model splits a question into steps, marks which steps depend on which, runs independent steps together and fills later queries with values found earlier (lesson 3).
- Grading. Before answering, a grader judges whether the retrieved evidence is relevant (on topic) and sufficient (actually contains the answer). This is the idea behind Self-RAG (Asai et al., 2023) and Corrective RAG (Yan et al., 2024), both cited below (lesson 4).
- A budget and an exit. The loop retries a fixed number of times, then answers with what it has or abstains, and says what it searched (lesson 4).
None of this makes the model better at reading. It gives the model more chances to fetch the right evidence, and each chance is another call.
04. Counting the cost in calls
Published latency and token multipliers for agentic RAG are not worth memorising: they depend on how many steps your questions need, which models you use, how long the passages are and whether steps run in parallel. Count calls instead. The calls follow from the design, and you can turn them into time and money with numbers measured on your own stack. The sketch below uses the call pattern of the lab in lessons 3 and 4: one planning call, a tool call plus a model call per attempt, one model call per rewrite and one answer call. It charges a fresh rewrite for every retry, so it gives an upper bound. The lesson 4 loop writes one rewrite and reuses it, so there a second retry costs two calls, not three.
"""Count the model and tool calls one question costs under each design."""
def single_pass() -> int:
return 2 # one search, one answer
def agentic(steps: int, retries: int = 0) -> int:
plan, answer = 1, 1
attempt = 2 # a tool call, then a model call that reads or grades the result
rewrite = 1 # a model call that writes the next query
return plan + steps * attempt + retries * (rewrite + attempt) + answer
for label, calls in [("single-pass", single_pass()),
("agentic, one step", agentic(1)),
("agentic, two dependent steps", agentic(2)),
("agentic, two steps, one retry", agentic(2, retries=1))]:
print(f"{label:<30} {calls} calls ({calls / single_pass():.1f} x single-pass)")python calls.pysingle-pass 2 calls (1.0 x single-pass)
agentic, one step 4 calls (2.0 x single-pass)
agentic, two dependent steps 6 calls (3.0 x single-pass)
agentic, two steps, one retry 9 calls (4.5 x single-pass)Read the table as a count of calls, not as a prediction of seconds. Running independent steps in parallel shortens the wait but not the bill: two lookups that run side by side still make two tool calls and two model calls. Prompts also grow with each step, because every call carries the evidence gathered so far, so tokens usually grow faster than calls. Lesson 5 records calls per question for three designs and shows how to convert them into latency and cost with measured per-call figures.
05. Choosing a design per query type
Because the cost is paid per question, the decision is also made per question. A common pattern is an adaptive router: a cheap classifier, or one short model call, labels each question and sends simple lookups to the single-pass pipeline and dependent or structured questions to the agentic loop. Adaptive-RAG (Jeong et al., 2024) trains a small model for exactly this job, predicting how complex a question is from labelled outcomes.
A router has its own errors. Send a multi-hop question down the single pass and it fails as before; send a simple question into the loop and you pay for calls that add nothing. So the decision rests on measurements:
- What your traffic contains. Label a sample of real questions by type: single fact from the docs, structured lookup, multi-hop, unanswerable. The mix decides how much an agent can gain overall.
- Accuracy per type, per design. Compare designs on the same questions, question by question, as lesson 5 does. A gain that appears only on multi-hop questions argues for routing, not for switching everything.
- Calls, latency and cost per type. A design that is right more often but too slow for the product is still the wrong design.
Keep the single pass as the default for questions it already answers well, and add agentic steps where the measurements show that the other assumptions fail.
06. Check your understanding
07. Apply it
The practice project for this skill builds an agent over a documentation index and a small SQL database and compares it with a single pass on 20 questions, 5 of them multi-hop. Start it now with the labelling, before any code:
- Collect 20 questions that your users ask, or that you would ask of your own documentation and data.
- Label each with its type: single fact from the docs, structured lookup, multi-hop or unanswerable. For each multi-hop question, write down the hops and which ones depend on which.
- For each question, write the strings that a correct answer must contain, and decide which questions the system should refuse.
- Predict the number of calls each design will make per type with the formula in
calls.py. Lesson 5 checks your prediction against a real run; expect the run to come in lower, because that loop reuses its rewrite and a question that ends in an abstention makes no answer call.
08. Review prompt
Without looking back:
- Name the four assumptions of a single pass and the failure each one causes.
- Which two of them need an agent, and which can be fixed with one extra call?
- What makes a question multi-hop? Give an example from your own work.
- Why count calls instead of quoting latency multipliers, and what does running steps in parallel save?
- What would you measure before routing any traffic to an agentic retriever?
References
- Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection (Asai et al., 2023)
- Corrective Retrieval Augmented Generation (Yan et al., 2024)
- Adaptive-RAG: Learning to Adapt Retrieval-Augmented Large Language Models through Question Complexity (Jeong et al., 2024)
- Agentic Retrieval-Augmented Generation: A Survey (Singh et al., 2025)
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.