Back to paper library
Paper notesarXiv 2026

Deep Agentic Search

A Game of Telephone

Original paper

Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Study

Paper authors

Amirkia Rafiei Oskooei · Bora Ilci · Alperen Kayim …

Show all 8 authors

Amirkia Rafiei Oskooei · Bora Ilci · Alperen Kayim · Mehmet Egemen Uzun · Berat Can · Kaan Emre Kara · Ozan Orhan · Mehmet S. Aktas

Publication
Publication venue not yet verified
First submitted to arXiv
arXiv:2608.01507
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{retrievalaugmentedgenerationdeepagenticsearch2026,
  title = {{Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Study}},
  author = {Amirkia Rafiei Oskooei and Bora Ilci and Alperen Kayim and Mehmet Egemen Uzun and Berat Can and Kaan Emre Kara and Ozan Orhan and Mehmet S. Aktas},
  year = {2026},
  eprint = {2608.01507},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.01507}
}
On this page

Before answering “Where is this feature implemented?”, today's coding agents often send out a helper.

Instead of browsing files itself, the main agent has a subagent list directories, grep, read files, and keep searching. The subagent works in its own context and returns only an organized conclusion. The main agent's context stays clean, containing just the concise result.

This design is called Deep Agentic Search, sometimes described as “grep search performed by a subagent.” The paper notes its rapid adoption by coding agents such as Claude Code, Codex, and Antigravity.

But is it actually more accurate?

This is an empirical study from Yildiz Technical University and Intellica Business Intelligence in Istanbul, Türkiye. The authors compare it with a more traditional approach: build a vector index ahead of time and let the agent retrieve directly, using the same code question-answering tasks.

Surprisingly, the traditional approach passes 65.2% of questions, versus 46.2% for Deep Agentic Search, whose cost per correct answer is more than twice as high.

Defining the Problem

The authors ask three questions:

  1. Accuracy: Which approach answers repository-wide questions better?
  2. Cost: How much does each cost, and does additional spending buy accuracy?
  3. Behavior and failure: How do the approaches operate, and how do they fail?

Solving the Problem

Two Architectures

Two search paradigms: a ReAct agent retrieves code chunks from a prebuilt vector index above; a Deep Agent delegates exploration to a subagent in a separate context, without an index, below
Fig. 1 from the paper, excerpted from page 2 of the v1 PDF. (a) Semantic search implemented with a ReAct agent; (b) Deep Agentic search implemented with a Deep Agent.

Upper half (a): Semantic search. The repository is split into chunks, embedded, and stored in a vector database beforehand. When a question arrives, the ReAct agent turns it into a query vector, retrieves relevant code chunks, and assembles its own answer.

Lower half (b): Deep Agentic search. There is no index. The Deep Agent receives a question and sends an Explorer Subagent into the repository. In the figure, the subagent says “Not here” in one folder, then “Found it!” in another. It returns its findings to the main agent, which answers.

Notice that the dashed arrows on both sides are labeled “Waiting.” While the main agent waits, it cannot see what the subagent actually does.

Implementation Details

Both architectures use LangChain.

Semantic search uses LangChain's ReAct agent, with only the three tools in SWE-QA's original evaluation protocol: inspect repository structure, perform vector search, and read files. It has no shell, file-writing capability, or planning tool.

The appendix specifies the vector index:

  • A code-aware RecursiveCharacterTextSplitter creates 500-token chunks with 50-token overlap.
  • OpenAI's text-embedding-3-small produces 1,536-dimensional embeddings.
  • Chroma stores a separate vector database per repository, using cosine similarity and retrieving the top ten chunks each time.

Deep Agentic search uses LangChain's Deep Agents framework with its default tools: write a to-do list (write_todos), delegate to subagents (task), grep, ls, glob, and read files. Main agents and subagents use the same model.

The comparison therefore involves more than “vector retrieval versus grep.” Semantic search can also read files and inspect directories. Deep's distinguishing features are planning and subagent delegation.

Models, Data, and Scoring

Four models are tested: Gemini 2.5 Flash, Gemini 2.5 Pro, Gemini 3 Flash, and an open-weight model from another provider, Qwen3-235B. Four models crossed with two architectures yield eight conditions. Temperature is zero, with a 900-second and 80-step limit per question. Exceeding either counts as failure, without a retry.

The dataset is SWE-QA, a repository-wide question-answering benchmark. The authors use 15 Python repositories with 48 questions each, totaling 720. Twelve repositories come from SWE-bench and three from the newer SWE-bench-Live, ranging from roughly 13,000 to over 800,000 lines. Questions are roughly balanced across What, Why, Where, and How.

The judge is Claude Sonnet 4.6, from a different provider than every tested model. It scores five SWE-QA dimensions—correctness, completeness, relevance, clarity, and reasoning—combining them into a 0–100 score. Scores of at least 70 are Pass, 50 to below 70 are Partial, and below 50 are Fail.

The authors validate the judge with three software engineers, each with at least two years of experience and none a paper author. Blind to the conditions, they assess 800 answers. Inter-engineer agreement is Fleiss' κ = 0.81; majority human judgment versus the LLM judge gives Cohen's κ = 0.74 and a mean absolute score difference of 5.2 points. Agreement is slightly lower on Deep answers, κ = 0.69 versus 0.78 for Semantic, which the authors attribute to Deep's longer, more complex responses.

Discussion

Accuracy: Semantic Wins for Every Model

ModelPass (S)Pass (D)GapCost per pass (S)Cost per pass (D)
Gemini 2.5 Flash48.4%42.8%5.6$0.213$0.436
Gemini 2.5 Pro54.2%44.2%10.0$1.048$1.526
Gemini 3 Flash89.3%39.7%49.6$0.179$0.858
Qwen3-235B68.8%58.2%10.6$0.012$0.291

Compiled from Tables 3 and 4 of the paper. S is Semantic, D is Deep, and gaps are percentage points. The last two columns give US dollars per correct answer, calculated from measured tokens using the paper's single price schedule.

Semantic has a higher Pass rate for all four models. Averaging their Pass rates:

48.4+54.2+89.3+68.84≈65.2%,42.8+44.2+39.7+58.24≈46.2%\frac{48.4+54.2+89.3+68.8}{4}\approx65.2\%,\qquad \frac{42.8+44.2+39.7+58.2}{4}\approx46.2\%

That gives the abstract's 65.2% versus 46.2%. Fail rates are 21.9% versus 34.4%, showing that Deep not only turns some passes into partial answers but also produces more outright failures.

But gap size varies greatly. Gemini 2.5 Flash differs by only 5.6 points; Gemini 3 Flash by 49.6. Paired tests remain significant after multiple-comparison correction for all four models, but Cliff's δ is only about 0.14 for the two Gemini 2.5 models and 0.24 for Qwen3-235B. Only Gemini 3 Flash's 0.76 is large. The authors describe this with restraint, saying only that the direction is consistent, the gains on Gemini 2.5 are modest, and the gap is large only on Gemini 3 Flash.

Could the Pass threshold of 70 happen to favor Semantic? The authors sweep thresholds from 50 to 90. Semantic leads for every model at every threshold, with a minimum gap of 3.8 percentage points.

Cost: More Spending Does Not Buy Higher Accuracy

Deep uses more input tokens for every model. The largest gap is on Qwen3-235B, with about 34,000 tokens per question for Semantic versus 761,000 for Deep, a 22-fold difference.

Aggregating across the four models, cost per correct answer is 0.32versus0.32 versus 0.74. Deep is about 2.3 times as expensive.

The authors also examine per-question scores against spending. For input tokens and tool calls alike, fitted slopes are flat or negative under both architectures, so spending more does not produce higher scores. They caution that this is correlational; harder questions naturally require more exploration and are more likely to be wrong.

Latency has no consistent direction. Deep is faster for the two Gemini 2.5 models; Semantic is faster for Gemini 3 Flash and Qwen3-235B. The authors consider latency too sensitive to execution conditions for a general conclusion.

Does Deep's extra cost rise with repository size? No significant relationship appears across the 15 repositories, but the authors acknowledge the small sample and leave the question open.

Most of Deep's Work Happens Outside the Main Agent's View

Including subagent actions, most Deep tool calls are ordinary file reads (41.6%) and text searches (29.1%), followed by to-do writing, directory listing, and delegation.

But a single delegation opens an entire subagent exploration. Of 2,878 Deep runs, 2,395 delegate at least once. Each run averages 2.1 delegations, and each subagent makes about ten calls. In total, 68.8% of tool calls happen inside subagents, beyond the main agent's direct view.

On Gemini 3 Flash, for example, Semantic averages 8.6 tool calls per question, versus 44.6 for Deep.

Failure Analysis: Handoffs Are the Weak Spot

The authors classify all Fail traces along two independent dimensions: failure mechanism, or why it failed, and answer symptom, or how the answer is wrong. Claude Sonnet 4.6 performs the classification, validated by two authors manually labeling 400 examples. Agreement between those authors is κ = 0.78 for mechanisms and 0.86 for symptoms; their consensus agrees with automated classification at 0.82.

Failure mechanisms by architecture: Semantic is dominated by retrieval or localization failures, while Deep Agentic is dominated by coordination breakdown
Fig. 19 from the paper, excerpted from page 27 of the v1 PDF. Blue on the left is Semantic; orange on the right is Deep Agentic. Numbers are percentages of each architecture's failures.

There are 1,621 failures: 631 Semantic and 990 Deep. Their failure patterns differ sharply.

Semantic mostly fails to find things. The largest category, retrieval or localization failure at the lower left, is 53.6%: despite an average of 12.6 tool calls, it never finds the correct file. Another 18.1% answer confidently after reading too little, and 17.1% find the right file but misunderstand it.

Deep mostly fails at handoffs. The top orange bar, coordination breakdown, accounts for 41.8%. Handoffs between main agent and subagent fail to produce or integrate usable findings. This failure requires a subagent architecture, so Semantic has zero cases.

Most of these coordination breakdowns are also silent. In 91% of them, the agent still produces a fluent, confident answer with no visible sign of trouble.

Another 13.5% of Deep failures involve loops. Overall, 24.2% of its failures produce no answer at all, versus 12.7% for Semantic.

The authors argue that, rather than eliminating failures, Deep Agentic Search adds a new kind of failure, the kind hardest to detect from the output.

The Authors' Own Boundaries

The paper is careful about its scope.

First, every question is independent, read-only, and single-turn. Subagents' real value may be keeping the main context clean across long sessions with multiple tasks. Every question here starts a new conversation, leaving no opportunity for that benefit to improve accuracy. The authors explicitly say their design cannot determine whether the balance changes in long sessions.

Second, Semantic assumes indexing is possible beforehand. File systems that are too large, too volatile, or too irregular may require live exploration. An index is a snapshot: branches keep changing, so it must be updated continuously or answers can become subtly stale. The authors report that embedding all 15 repositories cost under one dollar; the real cost lies in detecting changes, invalidation, and rebuilding. A fixed snapshot, as used here, is especially favorable to indexing.

Third, each paradigm uses only one harness. System prompts, subagent summaries, and step budgets all affect results. The authors do not compare other Deep Agent frameworks or claim that the gap's magnitude is fixed across implementations.

The evaluation also covers only SWE-QA, Python, and four models. These popular repositories may well have appeared in training data.

Conclusion

For this paper's setting—fixed Python repositories that can be indexed, with one read-only question at a time:

  1. Semantic search is more accurate. It has a higher Pass rate for every model, averaging 65.2% versus 46.2%, with gaps from 5.6 to 49.6 percentage points.
  2. Semantic search is cheaper. Cost per correct answer averages 0.32versus0.32 versus 0.74. Deep's additional tokens do not buy higher scores.
  3. Deep's main failure is the handoff. Coordination between main agent and subagent accounts for 41.8% of failures, and 91% of those still produce fluent, confident wrong answers.

The authors recommend defaulting to an indexed retrieval agent for read-only QA when a repository can be indexed, and reserving heavier subagent orchestration for needs that single-question accuracy does not capture, such as clean contexts over long sessions, environments that cannot be indexed, or tasks requiring code writing and execution. A reasonable next step is a router that uses inexpensive semantic indexing ordinarily and sends out subagents only when they are really needed.

Handing off the work does keep the main agent's context clean. But it also has no way to tell whether the answer it gets back is right.