When does agentic RAG help document search?
Retrieval-augmented generation (RAG) searches your documents and builds a request for the model containing the question and the passages found. Agentic RAG, also called agentic retrieval, lets the model direct further searches before answering. Extra searches can find passages one search misses when questions have several parts or depend on earlier conversation; each can add model calls and time.
Comparing the two on your own questions shows which questions gain from more searches, what they cost and how to keep a run within limits.
What changes when the model directs search?
An agent is a model that chooses its next step, such as another search, from what it has read. In Anthropic's tool use, your application runs requested searches and returns the results in the next model request. The model can then request another search or produce an answer.
Which questions need several searches?
Microsoft says agentic retrieval handles query complexity that a single query can't. Its examples are questions with multiple asks, questions that depend on earlier context in the conversation, queries that benefit from rewriting, and spelling mistakes. Query rewriting changes a question's wording for search while preserving what the user is asking.
Take a traveller asking whether their policy covers cancellation because of industrial action. One clause may settle the question, and one search may find it.
An insurance analyst asks, "Which of our products exclude industrial action, and which endorsements changed that this year?" Finding exclusions may reveal product names needed to locate endorsements. The endorsements found may point to further documents to check.
Subqueries are smaller questions searched separately to answer a larger one. LlamaIndex's Sub Question Query Engine splits a question across relevant sources and combines the intermediate answers.
For wording mismatches, first compare searching by words and meaning. If search already finds the needed passages, check whether they reach the model's request and measure whether search finds the right passages before adding more searches.
What the comparisons show
These two studies are evidence about multi-step retrieval. Neither isolates a model choosing each next search from what it has read.
A 2026 study ran the same 5,000 HotpotQA questions requiring linked facts through every setup, with the same local model. The pipeline's model split each question once up front and was not called between searches, so it did not choose each next search itself.
Exact match, the share of answers matching the reference answer, rose from 43.1% with single-pass search to 53.2% with the full pipeline, and mean response time from about 0.5 to 5.6 seconds. Several components changed together, so the comparison measures the whole pipeline.
A second 2026 study used one local model on MuSiQue questions requiring linked facts and on 80 DevOps documents generated with model assistance and manually validated. Splitting questions into subqueries improved the ranking of relevant results on the DevOps collection, where response time rose from about 21 to 48 seconds. On MuSiQue, topic coverage rose sharply while ranking measures collapsed.
What the extra steps cost
Count model calls as well as searches. In the HotpotQA study, fewer retrieval steps saved little time because extra retrieval was inexpensive relative to the two model calls that dominated per-question cost: splitting the question and writing the answer. Microsoft's agentic retrieval overview says agentic retrieval adds latency compared with a single-query pipeline.
Tokens are the small pieces of text in which model input and output are counted. Microsoft lists several billing components for agentic retrieval. Azure OpenAI bills for input and output tokens in model-based query planning and answer synthesis; Foundry IQ bills for retrieval tokens consumed while running subqueries and ranking results.
Microsoft's retrieval reasoning effort controls how much planning happens. Low runs one pass of model-based planning and source selection.
At medium, an extra semantic classifier model judges whether the results give enough context to answer the question. If not, the system runs a second retrieval pass, with only one retry. Set the effort explicitly because the service default can vary with enabled features.
Bound the run
A stopping rule specifies when search ends: when passages cover every part of the question, or after a fixed number of searches. Enforce maximum searches and model calls in application code.
In the HotpotQA study, with sub-questions fixed up front and no model calls between searches, two retrieval steps gave 95% of the gain from five.
LangChain's agentic retrieval tutorial grades the retrieved documents for relevance and, when they are not relevant, rewrites the question and retrieves again. The tutorial sets no limit of its own on that loop.
LangGraph's recursion limit caps how many super-steps, the discrete steps in which a run advances, one run may execute.
One LangGraph user reported a text-to-SQL agent, which writes database queries from questions, looping on version 1.0.6 until it hit its recursion limit of 20. They said an older 0.6 version did not loop with the same configuration, while prompt instructions to stop did not help on the newer version.
The reply on the issue pointed to LangChain's tool call limit, and the issue was closed with the comment that this is already possible in LangChain. The runaway loops and cost collection gathers related reports.
Watch what the run does
In Anthropic's documented custom-tool loop, each new request includes earlier messages and search results, so it grows with each step.
One LangChain forum builder reported an agent that writes website test scripts running into context window overflow, the token limit for the request and reply, and redoing its first step. Reports of the same kind are in the state bloat and context overflow collection.
A run can also end before the work is done. Another LangChain forum user reported a deep agent, built with the deepagents library, stopping after completing one of nine planned tasks, without an error, despite raising the recursion limit.
Record generated searches, returned passages, model responses and why the run ended. Related reports are in the no visibility into runs collection. When a capped run lacks needed passages, the answer can say the documents searched did not settle the question.
A first setup and a check
Keep your existing search as the baseline. Take questions from your document-answer test set, including ones with several parts, and record the passages needed to settle each answer.
Run each question with one search and with an agent capped at two or three retrieval steps, keeping the documents the same. The HotpotQA study's author recommends that depth under similar resource constraints: a local 7B model with no proprietary API calls.
Record the settling passages found, the answer and citations, model calls, searches and elapsed time.
Inspect cases where the agent helped, stopped early, repeated work or added cost without improving the answer.
If your application can choose between approaches, reserve several steps for question types where the comparison shows a benefit. Keep one search for the rest.
Join the waitlist: one email when there is something to try.