Deep Search is a pattern that runs multiple retrieval passes with query reformulation, branching, and aggregation to find information that a single retrieval step would miss. It trades latency for recall by exploring the document space more thoroughly than basic RAG.
At a Glance
- Problem: Multi-hop questions draw on incident data, post-mortems, and proposals spread across sources, but basic RAG retrieves once, so it returns a confident partial answer and never notices what it missed.
- Forces: Recall versus latency and cost that grow with every round; thorough decomposition versus scope creep in the research loop; deeper exploration, but a greater need to detect contradictions and stale documents across rounds.
- Solution: Decompose the question into sub-questions, retrieve for each, then evaluate the results for gaps, contradictions, and references to follow. Issue follow-up queries and repeat until the sub-questions are answered, the budget runs out, or new rounds add little.
- Consequences: Gains: complete answers that connect evidence across many documents and sources and surface contradictions. Costs: 5 to 30 seconds of latency, retrieval calls that multiply with rounds and sub-queries, harder debugging, and runaway cost without strict budget limits.
What problem does Deep Search solve?
A user asks your RAG system: "Which of our microservices had the most incidents last quarter, and what architectural changes were proposed to fix the root causes?" No single document holds the answer. The incident counts are in one system. The post-mortem reports are scattered across multiple documents. The architectural proposals might be in RFC documents, Slack threads, or meeting notes. No single retrieval step will gather all of this.
Basic RAG retrieves once and generates once. That works for straightforward factual questions where the answer lives in one or two chunks. The questions users care about most tend to require connecting information from multiple sources, following chains of references, and synthesizing across documents that were never written with each other in mind.
The failure mode is predictable. The system retrieves chunks related to the most obvious keyword in the query, generates a partial answer, and presents it with confidence. The user gets an answer about incidents in general but nothing about the architectural proposals. Or they get one team's post-mortem but miss the three others that tell a different story. Nothing tells the system what it missed, so it never looks further.
How does Deep Search work?
Deep Search replaces the single retrieve-generate cycle with an iterative loop. The system retrieves, reasons about what it found, identifies gaps, and retrieves again. It keeps going until it has gathered enough information to produce a complete answer, or until it exhausts its budget of retrieval rounds.
First, the system decomposes the original question into sub-questions. "Which microservices had the most incidents last quarter?" becomes one sub-query. "What root causes were identified?" becomes another. "What architectural changes were proposed?" becomes a third. Each sub-question can target different data sources and use different retrieval strategies.
After the first retrieval round, a reasoning step evaluates the results. Here Deep Search departs from basic RAG. Instead of passing everything to the generator immediately, the system checks whether it has enough to answer each sub-question, whether the results contradict each other, and whether they reference other documents worth following. The evaluation produces a quality assessment and, more usefully, a list of information gaps.
If gaps exist, the system formulates new queries to fill them. These follow-up queries are informed by what was already retrieved. If the first round found incident reports for three services, the follow-up might specifically search for post-mortems related to those three services. If a post-mortem references an RFC, the follow-up retrieves that RFC. Each round builds on the previous one.
The loop has exit conditions. The first is that all sub-questions are answered with sufficient evidence. A budget limit prevents runaway costs, typically measured in total retrieval calls or elapsed time. A diminishing returns check stops the loop when new retrievals are not adding meaningful information.
Cross-document reasoning happens throughout the process. As the system accumulates chunks from different sources, it looks for connections, contradictions, and patterns. If two post-mortems identify different root causes for the same service, that contradiction is noted and included in the final answer rather than silently resolved.
The retrieval sources are not limited to a single vector index. Deep Search can query your knowledge base, call web search APIs, run SQL queries against structured databases, or hit internal APIs. Each sub-question routes to whichever source is most likely to have the answer. The system works through the problem the way a researcher would, step by step, rather than the way a search engine does.
When should you use Deep Search?
Deep Search is designed for questions that require synthesis across multiple documents or data sources. If your users regularly ask questions that start with "compare," "analyze the trend," "what is the relationship between," or "summarize all," you likely need iterative retrieval.
It is also the right pattern when your knowledge base is large and heterogeneous. A corpus of 10,000 documents spanning multiple domains, formats, and time periods will almost always need multi-hop reasoning for non-trivial questions.
Do not reach for Deep Search when simple questions dominate your workload. If 90% of queries can be answered from a single chunk, the overhead of iterative retrieval is not justified. Use it selectively, either as a separate "deep research" mode that users can invoke explicitly, or triggered automatically when the system detects that a question is complex.
The latency profile is very different from basic RAG. A single retrieval round might take 200 milliseconds. Three to five rounds of retrieval with reasoning in between can take 5 to 30 seconds. Tell users they are waiting for a more thorough answer, so they do not mistake the delay for a bug.
When not to use it: Avoid it in interactive products where users expect near-instant answers and will not wait 5 to 30 seconds; Basic RAG or Hybrid Retrieval fits that latency budget. If single-pass answers are wrong because the right chunks rank too low, rather than because evidence is spread across documents, fix ranking with Retrieval Refinement first. If only some queries need depth and the rest need different tools, let Agentic RAG decide per query instead of running every question through the loop.
Worked Example: Cost and Latency
An engineering research assistant answers 1,000 multi-hop questions a day, like the incident question above.
| Setup | Calls per request | Tokens per request (in / out) | Cost per 1,000 requests | Latency per request |
|---|---|---|---|---|
| Basic RAG, single pass | 1 search + 1 LLM | 2,300 / 300 | $11.40 | 5.7 s |
| Deep Search, 3 rounds × 3 sub-queries | 9 searches + 5 LLM | 33,900 / 1,050 | $117.45 | 20.6 s |
Assumptions: each search takes this page's 200 ms and returns 3 chunks of 400 tokens, the three searches in a round run in parallel, and all reasoning uses the large model ($3.00 and $15.00 per million, 60 tokens per second). A 100-token decomposition call takes 0.5 s + 100 / 60 ≈ 2.2 s. Each round adds 3,600 tokens of evidence, so the three gap-analysis calls read 3,900, 7,500, and 11,100 tokens and write 150 each, at 3.0 s apiece. The final synthesis reads 11,100 tokens and writes 500: 11,100 × $3.00 per million = $0.0333 plus 500 × $15.00 per million = $0.0075, so $0.0408 on its own. Latency is 2.2 + 3 × (0.2 + 3.0) + 8.8 = 20.6 s, inside the 5 to 30 second range above.
Deep Search costs about 10 times as much as a single pass and takes about 3.6 times as long, and its input grows with every round, so it pays for the minority of questions that need synthesis across sources, not as the default path.
What are the common pitfalls?
The biggest risk is scope creep during the research loop. Each reasoning step can identify new gaps, and each new retrieval can surface references to more documents. Without strict budget controls, the system can spiral into an expensive research session that retrieves dozens of documents for a question that did not warrant it.
Query decomposition can go wrong in subtle ways. If the system breaks a question into sub-questions that miss an important dimension, no amount of iterative retrieval will find the missing piece. Make the decomposition thorough, and have the system state its sub-questions so you can inspect them.
Contradiction handling is hard. When two authoritative sources disagree, the system needs a strategy. Presenting both viewpoints is often the right choice, but it requires the system to detect the contradiction in the first place, and that detection is a problem of its own.
Information staleness compounds across retrieval rounds. If the first round retrieves a document from last year and the third round retrieves an update from last month, the system needs to recognize the temporal relationship and prefer the newer information. Without date awareness, it might synthesize an answer that mixes outdated and current information without distinguishing between them.
What are the trade-offs?
Cost scales linearly with the number of retrieval rounds and the number of sub-queries per round. A five-round deep search with three sub-queries per round means fifteen retrieval calls plus the reasoning overhead. For high-volume applications, that adds up quickly. Consider reserving Deep Search for a subset of queries or offering it as a premium feature.
Latency is the most visible trade-off. Users conditioned by instant search results may not wait 15 seconds for an answer, even if that answer is much better. The user experience needs to communicate that deeper research is happening. Progress indicators, streaming partial results, and explicit "researching..." states help manage expectations.
Debugging is harder than with basic RAG. When the final answer is wrong, you need to trace through multiple retrieval rounds, reasoning steps, and query reformulations to find where the process went astray. Log every step.
Building it takes real engineering work. You need query decomposition, iterative retrieval orchestration, quality evaluation at each step, cross-document reasoning, budget management, and result synthesis. This is closer to building an agent than building a search pipeline. Confirm that your use case needs it before you commit.
Goes Well With
Basic RAG handles the simple queries in your system. Deep Search handles the complex ones. Together they cover simple and complex questions without over-engineering the common case.
Grounded Generation matters more for Deep Search because the multi-hop nature of the retrieval makes it easier for the LLM to introduce errors during synthesis. Citations and self-critique loops help keep the final answer grounded in the retrieved evidence.
Hybrid Retrieval improves each individual retrieval round within the loop. If individual retrievals are low quality, iterating over them does not help. Combining Deep Search with HyDE or hybrid search makes each round more effective.
References
- Ma, X., et al. (2023). Query Rewriting for Retrieval-Augmented Large Language Models. EMNLP 2023. arXiv