GrepSeek: Training Search Agents for Direct Corpus Interaction
Summary
GrepSeek trains LLM search agents to directly interact with a text corpus using shell commands like grep, using a two-stage training pipeline with cold-start dataset construction and GRPO refinement, achieving strong F1 and Exact Match on open-domain QA benchmarks.
View Cached Full Text
Cached at: 05/29/26, 09:18 AM
# GrepSeek: Training Search Agents for Direct Corpus Interaction
Source: [https://arxiv.org/html/2605.29307](https://arxiv.org/html/2605.29307)
Alireza Salemi1,Chang Zeng1,Atharva Nijasure1,Jui\-Hui Chung2,Razieh Rahimi1, Fernando Diaz3,Hamed Zamani1 1University of Massachusetts Amherst2Princeton University3Carnegie Mellon University \{asalemi,changzeng,anijasure,rahimi,zamani\}@cs\.umass\.edu juihui@princeton\.edudiazf@cmu\.edu
###### Abstract
Large Language Model \(LLM\) search agents have shown strong promise for knowledge\-intensive language tasks through multiple rounds of reasoning and information retrieval\. Most existing systems access information using a retriever that takes a keyword or natural language query and returns a ranked list of documents using an index of pre\-computed document representations\. In this work, we explore a complementary perspective in which the search agent treats the corpus itself as the search environment and finds evidence by issuing executable shell commands\. We introduceGrepSeek, an optimized direct corpus interaction \(DCI\) search agent that trains a compact search agent to find, filter, and compose evidence from large text corpora\. To address the instability of learning behavior directly with reinforcement learning on large corpora, we propose a two\-stage training pipeline\. First, we construct a cold\-start dataset using an answer\-aware Tutor and answer\-blind Planner to generate verified, causally grounded search trajectories\. Second, we refine the initialized policy with Group Relative Policy Optimization \(GRPO\), allowing the agent to improve its task\-oriented search behavior through direct interaction with the corpus\. To make DCI practical at scale, we further use a semantics\-preserving sharded\-parallel execution engine that accelerates shell\-based retrieval by up to7\.6×7\.6\\timeswhile preserving byte\-exact equivalence with sequential execution of the shell command\. Experiments across seven open\-domain question answering benchmarks show thatGrepSeekachieves the strongest overall token\-levelF1F\_\{1\}and Exact Match\. Our analysis also highlights the limitations of purely lexical interaction on queries with substantial surface\-form variation, suggesting DCI as a practical and competitive method for search agents that can complement existing retrieval paradigms in the real world\.
## 1Introduction
Large Language Model \(LLM\) search agents \(orsearch agentsfor short\)\(Liet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib35); Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\)have shown strong promise in addressing complex information needs that may require reasoning, query decomposition, and/or information synthesis from multiple sources\. These agents benefit from multiple interactions with a retrieval model to obtain required information for performing their knowledge\-intensive tasks\. In case of unstructured or semi\-structured text corpora, these interactions are in the form of keyword or natural language queries\. These approaches rely on decades of research in developing retrieval models, from lexical matching\(Salton and Buckley,[1988](https://arxiv.org/html/2605.29307#bib.bib4); Robertsonet al\.,[1994](https://arxiv.org/html/2605.29307#bib.bib30); Ponte and Croft,[1998](https://arxiv.org/html/2605.29307#bib.bib5)\)to semantic matching based on dense representation\(Deerwesteret al\.,[1990](https://arxiv.org/html/2605.29307#bib.bib6); Karpukhinet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib21)\)or sparse representations\(Zamaniet al\.,[2018](https://arxiv.org/html/2605.29307#bib.bib22); Formalet al\.,[2021](https://arxiv.org/html/2605.29307#bib.bib23)\)\. These models operate on pre\-computed representations of documents to construct an index for the corpus\. Relevance scores are also computed per document\.111Document refers to any retrievable entry, regardless of how the given text is chunked\. These chunks should be identified and fixed prior to indexing and are the same for all queries\.
This paper explores a fresh perspective to this problem in whichinformation seeking on unstructured data can be done at any granularity\. In other words, instead of document\-level representations, indexing, and relevance scoring, a piece of text of any size can be retrieved for each query\. This enables us to perform more“surgical”information retrieval as opposed to being restricted with pre\-determined text chunks and representations\. To achieve this,we envision search agents that treat the corpus as an environment\. Under this view, the agent can issue executable \(surgical\) search operations over the corpus, inspect intermediate results, refine constraints, and compose evidence across multiple steps\. This shifts retrieval from a black\-box ranking procedure to an explicit sequence of controllable corpus operations\. Such an interface is especially appealing for many knowledge\-intensive reasoning tasks in which answering a question may require exact entity matching, lexical filtering, symbolic pattern search, or following bridge entities across documents\. This perspective is closely related to recent progress in code agents, where executable search tools such asgrepandripgrepprovide a simple yet effective interface for locating relevant context in code repositories\(Wanget al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib13)\)\. Inspired by this form of tool\-mediated search, we ask whether a similar interaction pattern can be extended beyond code repositories to open\-domain question answering over large textual corpora containing millions of unstructured documents\.
Contemporary to our work,Senet al\.\([2026](https://arxiv.org/html/2605.29307#bib.bib12)\)andLiet al\.\([2026](https://arxiv.org/html/2605.29307#bib.bib14)\)independently propose agents to bypass pre\-computed retrieval indices and searches a raw corpus through Unix\-style shell commands, such as keyword matching or executable text\-processing programs\. These works demonstrate that direct corpus access can serve as an effective interface for exact matching, multi\-step evidence discovery, and compositional question answering\. These methods are primarily built around prompting large proprietary models with strong code\-generation capabilities to orchestrate search at inference time\. For example,Liet al\.\([2026](https://arxiv.org/html/2605.29307#bib.bib14)\)rely on closed\-weight agents such as Claude,222Available at:[https://www\.anthropic\.com/claude/sonnet](https://www.anthropic.com/claude/sonnet)making the resulting system computationally expensive and operationally inefficient, often requiring substantial time, sometimes even one hour or more, to complete a single query\. In contrast, we are interested in methods that are feasible in the real world, thus focusing on training compact models and efficient operation executions at large scale\. In order to be consistent with these contemporary work, we also refer to this category of approaches asDirect Corpus Interaction \(DCI\)\.
Figure 1:Comparison of retrieval\-augmented agentic search and direct corpus interaction\.Left:retrieval\-augmented agentic search relies on pre\-computed indices where the agent queries a retriever that returns top documents\.Right:DCI enables direct corpus access via shell commands, executed by a parallel engine that runs pipelines on shards and aggregates results without requiring an index\.To achieve our goals of effective, efficient, and practical direct corpus interactions, we introduceGrepSeek, an optimized DCI search agent that trains a compact LLM to search, filter, and compose evidence over large text corpora through executable shell commands\. This shifts DCI from an inference\-time prompting strategy with large proprietary models \(as in\(Liet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib14)\)\) to a learned capability of a smaller agent\. Training such an agent is challenging: naively applying reinforcement learning \(RL\) often produces degenerate behavior, such as overly broad commands, excessive context retrieval, or unstable search behavior\. To stabilize learning, we first create a cold\-start dataset that demonstrates successful DCI behavior\. For each training question, an answer\-aware Tutor is given the ground\-truth answer and constructs a backward chain of shell commands whose execution retrieves corpus documents supporting the answer\. This backward construction is particularly useful for complex and multi\-hop questions, as it lets the Tutor identify supporting evidence one hop at a time while maintaining an explicit chain from the final answer back to the original question\. We then convert the verified backward chain into a forward, causally valid trajectory using an answer\-blind Planner\. The Planner generates reasoning traces and commands from the agent’s observable history, simulating how the agent would solve the task at inference time\. The Tutor then aligns these steps with the verified commands and evidence from the backward chain\. This produces trajectories that remain causally grounded in the information observed so far, while allowing the Tutor to guide the Planner toward the verified search path\. Finally, we refine the initialized policy using Group Relative Policy Optimization \(GRPO\)\(Shaoet al\.,[2024](https://arxiv.org/html/2605.29307#bib.bib2)\), allowing the agent to further improve its task\-oriented search behavior through direct interaction with the corpus\.
For a direct corpus interaction agent to be practical in the real world, retrieval latency must remain manageable even when operating over corpora containing millions of documents\. However, executing standard shell pipelines sequentially over large multi\-gigabyte text collections introduces substantial I/O and processing bottlenecks, making naive execution prohibitively slow for interactive agents\. To address this, we develop a semantics\-preserving sharded\-parallel execution engine that dynamically distributes compatible shell pipelines across parallel corpus shards\. This substantially reduces retrieval latency while preserving byte\-exact equivalence with standard sequential execution\.
Figure 2:Workflow ofGrepSeek: iterative interaction with corpus with shell commands\.To evaluateGrepSeek, we conduct experiments across seven knowledge\-intensive question answering benchmarks spanning both single\- and multi\-hop questions\. The single\-hop benchmarks include Natural Questions \(NQ\)\(Kwiatkowskiet al\.,[2019](https://arxiv.org/html/2605.29307#bib.bib10)\), TriviaQA\(Joshiet al\.,[2017](https://arxiv.org/html/2605.29307#bib.bib48)\), and PopQA\(Mallenet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib47)\)\. The multi\-hop benchmarks include HotpotQA\(Yanget al\.,[2018](https://arxiv.org/html/2605.29307#bib.bib46)\), 2WikiMultihopQA\(Hoet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib45)\), MuSiQue\(Trivediet al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib44)\), and Bamboogle\(Presset al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib43)\), all of which require iterative evidence aggregation and compositional reasoning across multiple documents\. Our experiments show thatGrepSeeksubstantially outperforms standard index\-based RAG systems, untrained agentic frameworks, and even search agents optimized with RL to retrieve using dense and sparse retrievers\. In particular,GrepSeekachieves the best token\-levelF1F\_\{1\}performance on four out of seven benchmarks—NQ, HotpotQA, 2WikiMultihopQA, and MuSiQue—with statistically significant improvements on several datasets\.
The gains are especially pronounced on multi\-hop reasoning tasks, where traditional retrieval systems frequently suffer from semantic conflation and entity ambiguity introduced by retrievers\. In contrast, by explicitly executing exact string\-matching shell pipelines \(e\.g\.,rg \-F\),GrepSeekpreserves fine\-grained lexical distinctions and can isolate rare symbolic patterns, exact entity names, and intermediate bridge entities required for compositional reasoning\. Although our approach exhibits minor degradation on datasets with substantial surface\-form variation or semantically broad phrasing,GrepSeekultimately achieves the strongest overall performance, establishing DCI as a highly competitive and practical alternative to search agents with index\-based retrieval\. To make DCI agents practical at scale, our semantics\-preserving sharded\-parallel execution engine accelerates shell\-based retrieval by up to7\.6×7\.6\\times, reducing average search latency from5\.395\.39seconds under standard sequential execution to0\.710\.71seconds with sharded\-parallel execution\. Therefore, this brings down the average overall end\-to\-end latency ofGrepSeek\(including reasoning, multi\-turn information seeking, and final answer generation\) on all datasets to approximately8\.68\.6seconds per query on a single NVIDIA A100 GPU with 80GB VRAM, 32 CPU cores, and 32GB of system RAM\. To support future research on direct corpus interaction agents, we release our codebase, training data, and model checkpoints\.333Available at:[https://github\.com/alirezasalemi7/grepseek](https://github.com/alirezasalemi7/grepseek)
## 2Optimizing Direct Corpus Interaction Search Agents
Contemporary to our work, and independently,Liet al\.\([2026](https://arxiv.org/html/2605.29307#bib.bib14)\)introduce Direct Corpus Interaction \(DCI\), where an agent bypasses pre\-computed retrieval indices and searches a raw corpus through Unix\-style shell commands, such as keyword matching and executable text\-processing programs\. However, their approach treats DCI primarily as an inference\-time prompting strategy, relying on large proprietary models such as Claude with strong code\-generation capabilities to orchestrate search\. This makes the resulting system computationally expensive and operationally inefficient, often requiring substantial time—up to an hour—to answer a single query\. In contrast, our work studies the challenges of optimizing smaller search agents to learn DCI as a trained capability, including unstable optimization on large corpora, overly broad command usage, and excessive context retrieval, enabling compact models to interact with the corpus and solve tasks through learned search behavior\.
##### DCI Search Agent:
Figure[1](https://arxiv.org/html/2605.29307#S1.F1)\(Right\) provides an overview of the DCI agent–corpus interaction, and Figure[2](https://arxiv.org/html/2605.29307#S1.F2)illustrates a representative trajectory\. DCI search agentπθ\\pi\_\{\\theta\}operates within the ReAct framework\(Yaoet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib1)\)\. Given a questionqqand the system prompt shown in Figure[6](https://arxiv.org/html/2605.29307#A1.F6)in Appendix[B](https://arxiv.org/html/2605.29307#A2), the agent interacts directly with a corpus𝒞\\mathcal\{C\},444The corpus does not need to be stored as a single physical file\. We expose it to the agent as a single logical file for simplicity, allowing the model to reason about one unified corpus interface\. Internally, the execution engine can map the same command to the underlying collection of files and execute it accordingly\.where each line corresponds to a document\. The interaction proceeds for at mostTTsteps, producing a trajectoryτ=\{\(ti,ai,oi\)\}i=1T\\tau=\\\{\(t\_\{i\},a\_\{i\},o\_\{i\}\)\\\}\_\{i=1\}^\{T\}, wheretit\_\{i\}denotes the reasoning trace,aia\_\{i\}the action, andoio\_\{i\}the resulting observation\. At stepii, conditioned on the questionqqand the previous actions and observationsτ<i\\tau\_\{<i\}, the policyπθ\\pi\_\{\\theta\}generates a reasoning trace and an action:\(ti,ai\)∼πθ\(⋅∣q,τ<i\)\(t\_\{i\},a\_\{i\}\)\\sim\\pi\_\{\\theta\}\(\\cdot\\mid q,\\tau\_\{<i\}\)\. Reasoning traces are generated within<think\>XML tags\. Actions corresponding to tool invocations are emitted using the Hermes\-style<tool\_call\>format, and the resulting tool outputs are returned to the model within<tool\_response\>tags\. When the agent decides to terminate, it produces the final answery^q\\hat\{y\}\_\{q\}within<answer\>tags\. The actionaia\_\{i\}is either a corpus interaction command555The action space consists of Unix tools, such asrg,grep,find,sed,awk,head,tail,cat,ls,wc,sort,cut,uniq, andtr\. In practice, the agent primarily relies onrgandhead\.\(i\.e\., a shell command\) or a termination that outputs the answer\. Following each command, an execution engine runs the command over the corpus file𝒞\\mathcal\{C\}and returns an observationoio\_\{i\}, which is appended to the trajectory and used for subsequent reasoning and action generation\. The remainder of this section describes the training and efficient tool execution\.
### 2\.1Training DCI Search Agent
We observe that directly optimizing the agent to interact with corpus using RL leads to unstable behavior; the agent struggles to produce effective commands and frequently retrieves excessively large corpus segments, which increases context length and destabilizes optimization\.666We observed that this approach frequently resulted in both VRAM and host RAM out\-of\-memory failures, even on systems provisioned with up to 1024 GB of RAM, which makes the training procedure unstable\.To address this, we adopt a two\-stage training\. First, we automatically construct a cold\-start dataset to improve the agent’s initial tool\-use behavior in interaction with the corpus and impose behavioral constraints on interactions\. The model is first supervised on this cold\-start data before being optimized using RL\.
#### 2\.1\.1Cold\-Start Data Generation
Given a datasetD=\{\(qi,yi\)\}i=1\|D\|D=\\\{\(q\_\{i\},y\_\{i\}\)\\\}\_\{i=1\}^\{\|D\|\}of question\-answer pairs that require information from the corpus𝒞\\mathcal\{C\}, our data generation pipeline \(Algorithm[1](https://arxiv.org/html/2605.29307#alg1)\) consists of two main phases followed by a quality filtering stage\. The process relies on an answer\-aware Tutor LLM \(ℳT\\mathcal\{M\}\_\{T\}\) to construct verified evidence chains, and an answer\-blind Planner LLM \(ℳP\\mathcal\{M\}\_\{P\}\) to synthesize realistic forward reasoning trajectories\.
Algorithm 1Cold\-start Trajectory Generation forGrepSeek1:query
qq, gold answer
yy; corpus
𝒞\\mathcal\{C\}; max refinement iterations
MM; tutor
ℳT\\mathcal\{M\}\_\{T\}, planner
ℳP\\mathcal\{M\}\_\{P\}
2:Verified training trajectory
𝒯train\\mathcal\{T\}\_\{\\mathrm\{train\}\}, orFail
3:// Phase A: Goal\-Aware Decomposition and Backward Verification
4:
\(q1,…,qN\)←ℳT\.\(q\_\{1\},\\dots,q\_\{N\}\)\\leftarrow\\mathcal\{M\}\_\{T\}\.Decompose\(
q,yq,y\)⊳\\trianglerightGenerate ordered sub\-queries;Failif unparsable
5:
a←ya\\leftarrow y;
F←∅F\\leftarrow\\emptyset;
𝒟←∅\\mathcal\{D\}\\leftarrow\\emptyset;
𝒮←⟨⟩\\mathcal\{S\}\\leftarrow\\langle\\,\\rangle⊳\\trianglerightaa: target entity;FF: aliases;𝒟\\mathcal\{D\}: evidence context
6:for
i=Ni=Ndown to
11do
7:
\(success,ci,di\)←\(\\textit\{success\},c\_\{i\},d\_\{i\}\)\\leftarrowDiscover\(
qi,a,F,𝒟q\_\{i\},a,F,\\mathcal\{D\}\);if
¬success\\neg\\,\\textit\{success\}then returnFail
8:
𝒮←𝒮⊕⟨i,qi,a,ci,di⟩\\mathcal\{S\}\\leftarrow\\mathcal\{S\}\\oplus\\langle i,q\_\{i\},a,c\_\{i\},d\_\{i\}\\rangle;
𝒟←𝒟∪\{di\}\\mathcal\{D\}\\leftarrow\\mathcal\{D\}\\cup\\\{d\_\{i\}\\\}
9:if
i\>1i\>1then
10:
\(a,F\)←\(a,F\)\\leftarrowGetBridge\(
q,qi−1,qi,a,diq,q\_\{i\-1\},q\_\{i\},a,d\_\{i\}\);if
a=∅a=\\emptysetthen returnFail
11:endif
12:endfor
13:// Phase B: Forward Assembly \(Answer\-Blind Planner, Tutor\-Guided\)
14:
𝒮←\\mathcal\{S\}\\leftarrowReverse\(
𝒮\\mathcal\{S\}\);
ℋ←⟨⟩\\mathcal\{H\}\\leftarrow\\langle\\,\\rangle⊳\\trianglerightRestore forward order; init state history
15:foreach
⟨i,qi,a,ci,di⟩∈𝒮\\langle i,q\_\{i\},a,c\_\{i\},d\_\{i\}\\rangle\\in\\mathcal\{S\}do
16:
\(θd,cd\)←ℳP\.\(\\theta\_\{d\},c\_\{d\}\)\\leftarrow\\mathcal\{M\}\_\{P\}\.Draft\(
q,ℋq,\\mathcal\{H\}\)⊳\\trianglerightAnswer\-blind prediction of reasoning and action
17:
θ←ℳT\.\\theta\\leftarrow\\mathcal\{M\}\_\{T\}\.Align\(
q,ℋ,θd,cd,ci,diq,\\mathcal\{H\},\\theta\_\{d\},c\_\{d\},c\_\{i\},d\_\{i\}\);if
θ=∅\\theta=\\emptysetthen returnFail
18:
ℋ←ℋ⊕⟨θ,ci,di⟩\\mathcal\{H\}\\leftarrow\\mathcal\{H\}\\oplus\\langle\\theta,c\_\{i\},d\_\{i\}\\rangle⊳\\trianglerightEnsure reasoning is strictly conditioned on causal history
19:endfor
20:// Phase C: Answer Formulation and Quality Assurance
21:
y^←ℳP\.\\hat\{y\}\\leftarrow\\mathcal\{M\}\_\{P\}\.Answer\(
q,ℋq,\\mathcal\{H\}\)
22:
𝒯train←\\mathcal\{T\}\_\{\\mathrm\{train\}\}\\leftarrowFormat\(
q,ℋ,y^q,\\mathcal\{H\},\\hat\{y\}\)
23:if
y^=∅∨F1\(y^,y\)=0∨\\hat\{y\}=\\emptyset\\lor\\mathrm\{F\_\{1\}\}\(\\hat\{y\},y\)=0\\lorJudge\(
q,𝒯trainq,\\mathcal\{T\}\_\{\\mathrm\{train\}\}\)
≠Pass\\neq\\mathrm\{Pass\}then returnFail
24:return
𝒯train\\mathcal\{T\}\_\{\\mathrm\{train\}\}
25:
26:functionDiscover\(
q′,a,F,𝒟q^\{\\prime\},a,F,\\mathcal\{D\}\)⊳\\trianglerightIdentify a target command that retrieves evidence foraa
27:for
t=1,…,Mt=1,\\dots,Mdo
28:
c←ℳT\.c\\leftarrow\\mathcal\{M\}\_\{T\}\.Propose\(
q′,a,\{a\}∪F,𝒟q^\{\\prime\},a,\\\{a\\\}\\cup F,\\mathcal\{D\}\)⊳\\trianglerightStrictly exclude target & aliases
29:
d←d\\leftarrowExec\(
c,𝒞c,\\mathcal\{C\}\);if
ℳT\.\\mathcal\{M\}\_\{T\}\.Check\(
q′,a,d,Fq^\{\\prime\},a,d,F\)
=True=\\mathrm\{True\}then return
\(True,c,d\)\(\\mathrm\{True\},c,d\)
30:endfor
31:return
\(False,∅,∅\)\(\\mathrm\{False\},\\emptyset,\\emptyset\)
32:endfunction
##### Backward Phase:
The Tutor decomposes the queryqqand gold answeryyinto an ordered sequence of sub\-queries \(Algorithm[1](https://arxiv.org/html/2605.29307#alg1), line[4](https://arxiv.org/html/2605.29307#algx1.l4); prompt in Figure[8](https://arxiv.org/html/2605.29307#A2.F8)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. To ensure that the agent learns genuine information\-seeking behavior rather than exploiting access to the answer, we construct the retrieval trajectory in reverse \(N→1N\\rightarrow 1; lines[6](https://arxiv.org/html/2605.29307#algx1.l6)–[10](https://arxiv.org/html/2605.29307#algx1.l10)\)\. At each backward step, the Tutor proposes a shell commandcic\_\{i\}intended to retrieve a documentdid\_\{i\}that entails the current target answeraa\(lines[7](https://arxiv.org/html/2605.29307#algx1.l7)and[28](https://arxiv.org/html/2605.29307#algx1.l28)\)\. Crucially, we enforce a strictanswer\-leak ruleduring command generation \(prompt in Figure[18](https://arxiv.org/html/2605.29307#A2.F18)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\): the proposed command must be target\-masked, forbidding the use of the target entityaaor any of its aliasesFFas retrieval terms\. This is necessary because the backward process has access to future information throughyy; without masking, it can retrieve supporting evidence by querying the answer, resulting in unrealistic retrieval behavior that does not reflect inference\-time behavior\.
To improve retrieval robustness, the Tutor is allowed up toMMrefinement inDiscoverprocedure \(lines[27](https://arxiv.org/html/2605.29307#algx1.l27)–[31](https://arxiv.org/html/2605.29307#algx1.l31)\)\. At each attempt, Tutor proposes a command, executes it, and verifies if the retrieved documents support the target answer using a verification step \(line[29](https://arxiv.org/html/2605.29307#algx1.l29); prompt in Figure[9](https://arxiv.org/html/2605.29307#A2.F9)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. This increases the likelihood of obtaining valid evidence while filtering out brittle or spurious retrieval trajectories\. Once at least one valid document is identified, a bridge extraction step determines the antecedent entity indid\_\{i\}that answers the preceding sub\-queryqi−1q\_\{i\-1\}\(lines[9](https://arxiv.org/html/2605.29307#algx1.l9)–[10](https://arxiv.org/html/2605.29307#algx1.l10); prompt in Figure[11](https://arxiv.org/html/2605.29307#A2.F11)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. The extracted entity then becomes the target answer for the next backward hop\. After completing all backward steps, it produces a multi\-hop chain that connects the original query to the final answer through causally consistent intermediate shell command steps\.
##### Forward Phase:
Upon successfully constructing a verified chain of documents and commands, the sequence is reversed into chronological order \(Algorithm[1](https://arxiv.org/html/2605.29307#alg1), line[14](https://arxiv.org/html/2605.29307#algx1.l14)\) to simulate the information flow available to the agent during inference\. Although the retrieval path is constructed backward for verification purposes, a deployed agent only observes past interactions and retrieved evidence when making decisions\. Reversing the trajectory therefore ensures that training trajectories faithfully match the causal structure encountered at inference time\. At each forward step, the answer\-blind Planner drafts an initial reasoning traceθd\\theta\_\{d\}and action conditioned solely on the current causal historyℋ\\mathcal\{H\}\(line[16](https://arxiv.org/html/2605.29307#algx1.l16); prompt in Figure[12](https://arxiv.org/html/2605.29307#A2.F12)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. Because the Planner does not have access to the verified evidence chain or future retrieval states, its proposed reasoning often lacks the precision necessary to justify the optimal shell commandcic\_\{i\}\. To bridge this gap, the Tutor model performs a constrained alignment step that edits the Planner’s reasoning trace to logically motivatecic\_\{i\}while remaining strictly grounded in the observable interaction history \(line[17](https://arxiv.org/html/2605.29307#algx1.l17); prompt in Figure[15](https://arxiv.org/html/2605.29307#A2.F15)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. The resulting trajectory combines the realism of forward causal reasoning with the reliability of backward\-verified evidence construction\.
##### Automatic Quality Filtering:
To ensure that the cold\-start dataset provides a stable initialization for RL optimization, all assembled trajectories undergo rigorous filtering \(Algorithm[1](https://arxiv.org/html/2605.29307#alg1), lines[21](https://arxiv.org/html/2605.29307#algx1.l21)–[23](https://arxiv.org/html/2605.29307#algx1.l23)\)\. First, the Planner generates a final answery^\\hat\{y\}from the complete interaction historyℋ\\mathcal\{H\}that achieves non\-zero token\-level overlap with the ground\-truth answeryy\(F1\(y^,y\)\>0\\mathrm\{F\_\{1\}\}\(\\hat\{y\},y\)\>0\)\. This ensures that the constructed trajectory contains sufficient information for answer generation\. Second, the formatted trajectory𝒯train\\mathcal\{T\}\_\{\\mathrm\{train\}\}is evaluated by the Tutor for causal and logical consistency \(line[23](https://arxiv.org/html/2605.29307#algx1.l23); prompt in Figure[16](https://arxiv.org/html/2605.29307#A2.F16)in Appendix[B](https://arxiv.org/html/2605.29307#A2)\)\. The judge enforces strict temporal boundaries, discarding trajectories whose reasoning or retrieval commands implicitly reveal entities or facts not yet observable in the agent’s current history\. This is necessary because the backward construction process has access to future information via the gold answer and verified evidence chain, and without explicit verification, subtle forms of future\-state leakage may persist even under explicit answer masking\. Examples of the generated data using our pipeline are shown in Appendix[E](https://arxiv.org/html/2605.29307#A5)\.
#### 2\.1\.2Optimization of DCI Search Agent
##### SFT on Synthetic Trajectories:
After constructing the cold\-start data, we first perform supervised fine\-tuning on them\. Each training example consists of the full interaction sequence, including reasoning traces, tool invocations, tool responses, and the final answer\. The objective of this stage is to initialize the agent with stable retrieval and reasoning behavior before RL\. In particular, SFT teaches the agent to produce concise and causally grounded search commands and avoid pathological retrieval behavior such as excessively broad corpus scans\.
##### Reinforcement Learning with GRPO:
Following the SFT stage, we further optimize the policy using GRPO\(Shaoet al\.,[2024](https://arxiv.org/html/2605.29307#bib.bib2)\)\.777Our method is compatible with standard reinforcement learning algorithms; we adopt GRPO due to its favorable memory efficiency and stability for long\-horizon tool\-use trajectories\.For each queryqq, the policyπθ\\pi\_\{\\theta\}samples a group ofn=5n=5trajectoriesτ\(1\),…,τ\(n\)∼πθ\(⋅∣q\)\\tau^\{\(1\)\},\\dots,\\tau^\{\(n\)\}\\sim\\pi\_\{\\theta\}\(\\cdot\\mid q\), where each trajectory consists of interleaved reasoning traces, tool invocations, tool responses, and a final answer prediction\. Each sampled trajectoryτ\(i\)\\tau^\{\(i\)\}receives an answer rewardRans\(τ\(i\)\)R\_\{\\mathrm\{ans\}\}\(\\tau^\{\(i\)\}\)based on token\-level F1\(Rajpurkaret al\.,[2016](https://arxiv.org/html/2605.29307#bib.bib7)\)overlap between the predicted answery^\(i\)\\hat\{y\}^\{\(i\)\}and the gold answer set𝒴\\mathcal\{Y\}\. To enforce adherence to the required interaction protocol, we additionally define a binary format indicatorϕ\(τ\(i\)\)∈\{0,1\}\\phi\(\\tau^\{\(i\)\}\)\\in\\\{0,1\\\}that verifies whether the trajectory satisfies the expected structural constraints, including properly formed<think\>,<tool\_call\>,<tool\_response\>, and<answer\>blocks\. The final trajectory reward is thereforeR\(τ\(i\)\)=ϕ\(τ\(i\)\)Rans\(τ\(i\)\)R\(\\tau^\{\(i\)\}\)=\\phi\(\\tau^\{\(i\)\}\)\\,R\_\{\\mathrm\{ans\}\}\(\\tau^\{\(i\)\}\), so that only structurally valid trajectories receive non\-zero learning signal\. Details of the reward function are provided in Appendix[B\.3](https://arxiv.org/html/2605.29307#A2.SS3)\. GRPO computes a relative advantage by normalizing rewards within each group:
A\(i\)=R\(τ\(i\)\)−mean\(\{R\(τ\(j\)\)\}j=1n\)std\(\{R\(τ\(j\)\)\}j=1n\)\+ϵ,A^\{\(i\)\}=\\frac\{R\(\\tau^\{\(i\)\}\)\-\\mathrm\{mean\}\(\\\{R\(\\tau^\{\(j\)\}\)\\\}\_\{j=1\}^\{n\}\)\}\{\\mathrm\{std\}\(\\\{R\(\\tau^\{\(j\)\}\)\\\}\_\{j=1\}^\{n\}\)\+\\epsilon\},which encourages trajectories that outperform other samples generated for the same query while reducing sensitivity to reward scale\. The reward formulation primarily incentivizes accurate answer generation while implicitly favoring trajectories that yield successful evidence retrieval and corpus interaction behavior\. Initializing RL from the SFT\-trained policy improves optimization stability, as the policy already exhibits structured retrieval behavior and causally consistent reasoning prior to RL\.
### 2\.2Efficient Corpus Interaction
Unlike RAG that retrieve from a pre\-computed index, the DCI agent performs retrieval by executing shell commands over the corpus, which may contain millions of documents\.888In this paper for our experiments, we use a Wikipedia corpus of2121M passages \(approximately 14GB\)\.The agent interacts with the corpus through Unix tools, includingrg,grep,awk,sed,cut,sort,uniq,wc,head, andtail\. Because a trajectory may involve multiple corpus\-wide scans, efficient command execution is critical for inference throughput\. A key design requirement of an efficient execution engine is that all optimizations remain*semantics preserving*: every command must produce output identical to execution over the original corpus\. To make this practical, we employ a collection of semantics\-preserving optimizations that substantially reduce retrieval latency using shell commands without altering the observations for the agent\. The detailed implementation is provided in Appendix[B\.2](https://arxiv.org/html/2605.29307#A2.SS2)\.
##### Sharded\-Parallel Corpus Search:
To accelerate corpus interaction, we execute compatible shell pipelines in parallel acrossSSline\-aligned corpus shards while preserving byte\-exact equivalence with sequential execution \(Algorithm[2](https://arxiv.org/html/2605.29307#alg2)in Appendix[B\.2](https://arxiv.org/html/2605.29307#A2.SS2)\)\. Given a shell pipelineccconsisting ofmmstages connected via the pipe operator\|, the engine first decomposes the pipeline into its constituent commands\(s1,…,sm\)\(s\_\{1\},\\dots,s\_\{m\}\)and dynamically classifies its reduction semantics to determine whether the pipeline can be safely parallelized or must fall back to sequential execution\. The classification process conservatively guarantees correctness\. If the initial command is not a valid search operator \(s1∉\{rg,grep\}s\_\{1\}\\notin\\\{\\texttt\{rg\},\\texttt\{grep\}\\\}\) or if any stage depends on global or cross\-line state \(∃sjs\.t\.Unsafe\(sj\)\\exists s\_\{j\}\\;\\text\{s\.t\.\}\\;\\textsc\{Unsafe\}\(s\_\{j\}\)\), the pipeline is executed sequentially over the original corpus\. Otherwise, the engine identifies pipelines composed entirely of shard\-independent stateless transformations \(e\.g\.,cut,tr, and line\-wisesed\), which can be evaluated independently on each shard\. For valid pipelines, execution proceeds independently across theSSshards, producing partial outputs\{R1,…,RS\}\\\{R\_\{1\},\\dots,R\_\{S\}\\\}\.
The final output is reconstructed using a strategy\-specific reduction rule determined by the terminal stage in the pipeline, following the first applicable case: \(1\) purely stateless pipelines are merged through deterministic shard\-order concatenation \(⨄iRi\\biguplus\_\{i\}R\_\{i\}\); \(2\) purely stateless pipelines ending inhead \-napply local top\-NNtruncation on each shard to reduce memory usage, then concatenate the shard outputs, followed by a final top\-NNtruncation; \(3\) purely stateless pipelines ending in count operations such aswc \-laggregate shard counts through scalar summation \(∑iInt\(Ri\)\\sum\_\{i\}\\mathrm\{Int\}\(R\_\{i\}\)\); \(4\) pipelines involvingsort, optionally followed byuniq, and terminated byhead \-n, are merged using a deterministickk\-way merge procedure\(Cormenet al\.,[2001](https://arxiv.org/html/2605.29307#bib.bib8)\)before the final top\-NNselection; and \(5\) any other pipeline is conservatively executed sequentially over the original corpus\.
The engine supports arbitrary piped shell commands, allowing the agent to compose complex multi\-stage retrieval programs during inference\. By restricting shard\-parallel execution only to pipelines whose outputs can be reconstructed exactly from shard\-local computations, the system substantially improves retrieval throughput while remaining behaviorally identical to sequential execution\.999In practice, the vast majority of pipelines generated by the agent are compatible with shard\-parallel execution, with non\-parallel or globally stateful commands occurring only rarely\.
##### Persistent Search Daemon:
To further reduce latency, we keep the corpus in memory and execute retrieval commands through a persistent search daemon shared across the rollout\. The daemon maintains long\-lived search workers that avoid repeated process startup and corpus loading across successive tool calls, which is important because a single trajectory may involve many retrieval operations\. Commands are executed using memory\-mapped search primitives, and in practice most generated queries correspond to simple fixed\-string filtering operations implemented withrg\. As a result, retrieval performance is primarily limited by memory bandwidth and data access patterns rather than by the computation performed by the search operators themselves\.101010These optimizations affect only execution efficiency and are not required for correctness\. The system can also operate directly on disk\-resident corpora with identical outputs\.
## 3Experiments
### 3\.1Experimental Setup
##### Datasets & Evaluation:
Following prior work\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\), we evaluate on seven benchmark datasets: three single\-hop datasets—NaturalQuestions \(NQ\)\(Kwiatkowskiet al\.,[2019](https://arxiv.org/html/2605.29307#bib.bib10)\), TriviaQA\(Joshiet al\.,[2017](https://arxiv.org/html/2605.29307#bib.bib48)\), and PopQA\(Mallenet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib47)\)—and four multi\-hop datasets—HotpotQA\(Yanget al\.,[2018](https://arxiv.org/html/2605.29307#bib.bib46)\), 2WikiMultihopQA \(2Wiki\)\(Hoet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib45)\), MuSiQue\(Trivediet al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib44)\), and Bamboogle\(Presset al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib43)\)\.111111All datasets are obtained from[https://hf\.co/datasets/RUC\-NLPIR/FlashRAG\_datasets](https://hf.co/datasets/RUC-NLPIR/FlashRAG_datasets)\.Unless otherwise specified, we report results on the official test splits; otherwise, we use the development sets when test labels are not available\. For training, we use only the training sets of NQ and HotpotQA, and evaluate generalization on the remaining datasets as out\-of\-distribution test sets\. Dataset statistics are reported in Table[4](https://arxiv.org/html/2605.29307#A1.T4)in Appendix[A](https://arxiv.org/html/2605.29307#A1)\. We use the 2018 Wikipedia dump\(Karpukhinet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib21)\)of 21M documents as the corpus\.121212Available at:[https://hf\.co/datasets/PeterJinGo/wiki\-18\-corpus](https://hf.co/datasets/PeterJinGo/wiki-18-corpus),∼14GB\\sim 14GBtext\.For evaluation, we use token\-level F1as the primary metric, as it captures partial correctness under surface\-form variation, and report exact match \(EM\) in the appendix for completeness\(Rajpurkaret al\.,[2016](https://arxiv.org/html/2605.29307#bib.bib7)\)\.
##### Training & Inference Settings:
We use Qwen3\.5\-9B131313Available at:[https://hf\.co/Qwen/Qwen3\.5\-9B](https://hf.co/Qwen/Qwen3.5-9B)\(Qwen Team,[2026](https://arxiv.org/html/2605.29307#bib.bib42)\)as the LLM\. To trainGrepSeekin SFT stage, we construct a 10k\-sample cold\-start SFT dataset with a balanced mixture of HotpotQA and NQ\. As the Tutor and Planner, we use Qwen3\.5\-27B141414Available at:[https://hf\.co/Qwen/Qwen3\.5\-27B](https://hf.co/Qwen/Qwen3.5-27B), with a maximum ofM=5M=5refinements\. The model is trained for one epoch on this dataset\. Following the SFT, the policy is optimized using GRPO\(Shaoet al\.,[2024](https://arxiv.org/html/2605.29307#bib.bib2)\)for 200 steps with a group size ofn=5n=5on the full HotpotQA and NQ datasets\. During inference, the agent uses nucleus sampling\(Holtzmanet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib41)\)with temperature0\.60\.6, a maximum ofT=6T=6turns, and a context length of 16,384 tokens to support multi\-turn corpus interaction\. A complete list of hyperparameters and system configurations for the SFT, GRPO, and inference phases is provided in Tables[5](https://arxiv.org/html/2605.29307#A2.T5),[6](https://arxiv.org/html/2605.29307#A2.T6), and[7](https://arxiv.org/html/2605.29307#A2.T7)in Appendix[B\.4](https://arxiv.org/html/2605.29307#A2.SS4)\.
##### Baselines:
Following prior work\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\), we compare against a range of baselines, including \(1\) a direct LLM inference setting without external search, and \(2\) retrieval\-augmented methods: RAG\(Lewiset al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib37)\), IRCoT\(Trivediet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib36)\), Search\-O1\(Liet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib35)\), rejection sampling with a search engine and Search\-R1\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\)\(GRPO\-optimized\)\.151515While many recent agentic frameworks focus on improving reasoning\(Jinet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib31); Sunet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib33)\)or multi\-agent orchestration\(Chenet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib32)\), our primary goal is to isolate the effect of the retrieval mechanism itself\. Therefore, we focus on methods that differ mainly in how evidence is retrieved—namely, traditional sparse and dense retrievers versus corpus direct interaction\. Improvements proposed by other orchestration\-based methods are largely orthogonal and could in principle be integrated with either paradigm\.All baselines use the same backbone LLM and are trained \(when applicable\) and evaluated under the same settings as our method for a fair comparison \(Appendix[B\.4](https://arxiv.org/html/2605.29307#A2.SS4)\)\. We use three retrievers to retrieve top\-3 documents from the corpus: BM25\(Robertsonet al\.,[1994](https://arxiv.org/html/2605.29307#bib.bib30)\)as a sparse lexical baseline, E5\(Wanget al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib29)\)as a dense embedding \(110M parameters\),161616Available at:[https://hf\.co/intfloat/e5\-base\-v2](https://hf.co/intfloat/e5-base-v2)and a large\-scale Qwen3 embedding model\(Zhanget al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib28)\)\(4B parameters\)\.171717Available at:[https://hf\.co/Qwen/Qwen3\-Embedding\-4B](https://hf.co/Qwen/Qwen3-Embedding-4B)This allows us to systematically assess performance across both traditional and strong neural retrievers\. Dense retrievers are implemented using FAISS181818Available at:[https://github\.com/facebookresearch/faiss](https://github.com/facebookresearch/faiss)\(Douzeet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib26)\)with HNSW index\(Malkov and Yashunin,[2020](https://arxiv.org/html/2605.29307#bib.bib27)\)\(M=32M=32,efConstruction=128\\text\{efConstruction\}=128,efSearch=128\\text\{efSearch\}=128\) for fast retrieval over the vector database\.
### 3\.2Main Findings
Table 1:Model performance in terms ofF1F\_\{1\}\(EM is reported in Table[8](https://arxiv.org/html/2605.29307#A2.T8)in Appendix[C](https://arxiv.org/html/2605.29307#A3)\) across QA datasets\. Superscript∗shows the datasets used during training, while all others are evaluated out\-of\-distribution\. Superscript↑shows a statistically significant improvement using student t\-test, while↓denotes a statistically significant degradation compared to the best\-performing baseline \(p<0\.05p<0\.05\)\.##### Comparison of Performance with Baselines:
We compareGrepSeekagainst a range of retrieval\-augmented agentic search baselines, with results reported in Table[1](https://arxiv.org/html/2605.29307#S3.T1)\. Overall,GrepSeeksubstantially outperforms non\-agentic approaches \(Direct and standard RAG\), untrained agentic methods \(IRCoT and Search\-O1\), and trained agentic baselines \(Rejection Sampling\), regardless of the underlying sparse or dense retriever\. Among baselines, Search\-R1 is the strongest competitor due to its reinforcement learning optimization\. Nevertheless,GrepSeekachieves the best performance on 4 out of the 7 benchmarks \(NQ, HotpotQA, 2Wiki, and MuSiQue\), with statistically significant improvements on 3 \(↑\)\. Notably, the largest gains are observed on multi\-hop reasoning benchmarks, whereGrepSeekin most cases outperforms dense retrieval baselines\. This suggests that direct corpus interaction is particularly effective for iterative evidence aggregation and maintaining strict entity precision across reasoning steps—for instance, correctly distinguishing a specific subsidiary from a parent company \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\), or avoiding cascading name\-collision errors common to dense retrievers \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\)\. While performance decreases slightly on TriviaQA and Bamboogle, the observed differences are not statistically significant\. The only statistically significant drop of our method compared to the baseline occurs on the PopQA dataset \(↓\)\.
These performance trade\-offs are closely tied to the retrieval behavior ofGrepSeek\. Since the agent directly interacts with the raw text corpus through shell\-based retrieval \(e\.g\.,rg\), its search is primarily driven by explicit lexical constraints and iterative filtering operations\. This surgical strategy is highly effective for compositional reasoning and queries containing strong textual anchors, such as rare chemical formulas \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\), distinctive phrasing \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\), and exact full\-name matches \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\), which frequently confound semantic embeddings\. However, datasets with limited lexical overlap or intentionally ambiguous phrasing present a greater challenge\. For example, PopQA focuses on long\-tail entities where our agent’s reliance on exact string matching makes it brittle to surface\-form variations and diacritics \(e\.g\., missing an entity entirely due to an unexpected accent mark, as seen in Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\)\. Furthermore, becauserglacks semantic relevance ranking, the agent can struggle when target keywords are heavily overloaded, occasionally burying the most authoritative document in favor of chronologically earlier matches \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)in Appendix[D](https://arxiv.org/html/2605.29307#A4)\)\. In such settings, dense retrievers hold a distinct advantage by mapping lexical variations to shared embedding spaces\. Despite these limitations on the semantic tail,GrepSeekachieves the strongest overall micro\-average score \(0\.56910\.5691\), significantly outperforming the best dense retrieval baseline \(p<0\.05p<0\.05\)\. These results indicate that while direct corpus interaction may occasionally falter on heavily semantic queries, it provides a highly precise, scalable, and effective alternative to dense retrieval systems for general\-purpose open\-domain question answering and complex multi\-hop reasoning\.
Table 2:Ablation study ofGrepSeekacross single\-hop and multi\-hop datasets \(F1scores, EM is in Table[9](https://arxiv.org/html/2605.29307#A2.T9)in Appendix[C](https://arxiv.org/html/2605.29307#A3)\)\. Superscript↑indicates a statistically significant improvement using student t\-test over both ablated variants after Bonferroni correction\.Figure 3:Efficiency and cost analysis ofGrepSeekcompared to dense retrieval baselines \(E5 and Qwen3\-4B\)\. \(a\) Inference latency per query, broken down into LLM generation and tool execution time\. \(b\) Memory footprint \(RAM\) required for the retrieval index\. \(c\) Offline indexing cost measured in A100\-hours\. \(d\) Search tool latency ofGrepSeekscaling with the number of shards\.
##### Comparison of Latency with Best\-Performing Baselines:
Based on the results in Table[1](https://arxiv.org/html/2605.29307#S3.T1), the Search\-R1 variants using E5 and Qwen3 embeddings emerge as the strongest dense retrieval baselines\. To analyze the efficiency trade\-offs ofGrepSeekrelative to these systems, we compare inference latency, runtime retrieval memory footprint, and offline indexing cost\. The results are shown in Figure[3](https://arxiv.org/html/2605.29307#S3.F3)\(a–c\)\. All efficiency experiments are conducted on a machine with 32 CPU cores \(on a set of 50 examples from each dataset, total of 350 examples\), while dense retriever indexing is performed using a single NVIDIA A100 GPU\. As shown in Figure[3](https://arxiv.org/html/2605.29307#S3.F3)a,GrepSeekhas a higher end\-to\-end inference latency per query \(8\.678\.67s\) compared to E5 \(4\.774\.77s\) and Qwen3\-4B \(6\.076\.07s\), primarily due to longer reasoning trajectories and increased LLM decoding time \(7\.867\.86s\)\. However, the optimized execution engine keeps the actual retrieval execution cost low, requiring only0\.810\.81s for tool interaction\. Despite this latency overhead,GrepSeekprovides substantial efficiency advantages in memory and preprocessing cost\. As shown in Figure[3](https://arxiv.org/html/2605.29307#S3.F3)b,GrepSeekrequires only1414GB of host memory, corresponding directly to the raw corpus size, whereas dense retrieval systems require substantially larger memory footprints to store embeddings and indexing structures \(7070GB for E5 and221221GB for Qwen3\-4B\)\. Moreover, Figure[3](https://arxiv.org/html/2605.29307#S3.F3)c shows thatGrepSeekcompletely eliminates offline embedding precomputation, requiring only approximately11minute of setup time, compared to3\.23\.2and62\.462\.4A100\-hours for E5 and Qwen3\-4B, respectively\.
We additionally study how the optimized execution engine scales with increasing shard parallelism\. Figure[3](https://arxiv.org/html/2605.29307#S3.F3)d reports command execution latency as the number of corpus shards increases fromS∈\{1,2,4,8,16,32\}S\\in\\\{1,2,4,8,16,32\\\}\. The results show near\-linear speedups at smaller shard counts, reducing latency from5\.395\.39s at a single shard to1\.221\.22s at88shards\. Increasing the shard count further continues to improve performance, reaching0\.710\.71s at3232shards, although gains gradually plateau at larger values ofSS\. This is expected, as execution becomes bottlenecked by hardware constraints such as memory bandwidth saturation, process scheduling overhead, and the cost of merging shard\-local outputs\.
Figure 4:Effect of the number of SFT trajectories on F1scores \(EM is in Figure[17](https://arxiv.org/html/2605.29307#A2.F17)in Appendix[C](https://arxiv.org/html/2605.29307#A3)\) after RL training\.
##### Ablations ofGrepSeek:
To study the contribution of each training stage, we perform an ablation analysis by comparingGrepSeekagainst variants without SFT or without RL optimization\. Results are reported in Table[2](https://arxiv.org/html/2605.29307#S3.T2)for F1and Table[9](https://arxiv.org/html/2605.29307#A2.T9)in Appendix[C](https://arxiv.org/html/2605.29307#A3)for EM\.191919As discussed earlier, directly optimizing the base model without SFT initialization was highly unstable\. For thew/o SFTsetting, we therefore report results from the final checkpoint before training collapse\.The results show thatGrepSeeksignificantly outperforms both ablated variants across all datasets, demonstrating that both the synthetic cold\-start SFT stage and the subsequent RL optimization are critical for strong retrieval and reasoning performance\. In particular, removing RL substantially degrades multi\-hop reasoning performance, while removing SFT leads to severe instability and the largest overall performance drop, highlighting the importance of structured trajectory initialization before reinforcement learning\.
To further study the effect of cold\-start data scale on downstream RL performance, we evaluate policies initialized with varying amounts of trajectories: 0 \(base model\), 2\.5k, 5k, and 10k\. Each initialization is subsequently optimized using the same GRPO configuration\. The resulting token\-level F1scores are shown in Figure[4](https://arxiv.org/html/2605.29307#S3.F4), while the corresponding EM results are provided in Figure[17](https://arxiv.org/html/2605.29307#A2.F17)in Appendix[C](https://arxiv.org/html/2605.29307#A3)\. The results show that even a relatively small supervised initialization of 2\.5k trajectories substantially improves performance over the untuned base model across all benchmarks, highlighting the importance of inducing command\-generation for retrieval behavior prior to RL optimization\. Increasing the dataset size to 5k and 10k trajectories further improves performance, although gains become progressively smaller, with the micro\-average beginning to plateau beyond 5k examples\.
##### Training Dynamics:
Figure[5](https://arxiv.org/html/2605.29307#S3.F5)shows the training dynamics over 200 GRPO steps\. As shown in Figure[5](https://arxiv.org/html/2605.29307#S3.F5)a,GrepSeekachieves higher average rewards throughout training compared to all Search\-R1 baseline variants using dense or sparse retrievers \(E5, BM25, and Qwen3\-Emb\-4B\)\. This improvement, however, comes with increased computational cost\. Figure[5](https://arxiv.org/html/2605.29307#S3.F5)b shows thatGrepSeekgenerates longer sequences, due to both extended reasoning traces and the inclusion of raw retrieved corpus context, resulting in lower inference throughput as explained earlier\. Interestingly, the retrieval behavior ofGrepSeekevolves differently from retrieval\-based baselines\. As shown in Figure[5](https://arxiv.org/html/2605.29307#S3.F5)c, baselines tend to increase the number of retrieval queries during training before eventually stabilizing\. In contrast,GrepSeekgradually reduces the number of executed search commands over time\. We observe that the agent initially relies on multiple independent retrieval operations, but progressively learns to compose more expressive multi\-stage shell pipelines by chaining operators through piping, allowing more information to be extracted per command invocation\.
Figure 5:Training dynamics over 200 steps comparingGrepSeekwith retrieval baselines \(E5, BM25, and Qwen3\-Emb\-4B\)\. \(a\) Mean reward score during training\. \(b\) Average response length measured in tokens\. \(c\) Average number of search queries generated per example\.
### 3\.3Analysis
##### Retrieval Behavior:
Table 3:Evolution of trajectory characteristics during RL training ofGrepSeek\.
Because the DCI agent interacts with the corpus through shell rather than retrievers, its retrieval strategy is inherently interpretable\. An analysis of the generated commands reveals a highly structured and selective policy\. Across all evaluation benchmarks, the agent consistently limits output verbosity by using\| headin all invocations, and relies on exact\-string matching \(\-Fin almost all cases\), avoiding unintended regular\-expression generalization\. In addition, a large fraction of commands \(approximately 70%\) employ cascaded filtering \(e\.g\.,rg … \| rg …\) to iteratively narrow the search space\. The agent also adapts its search effort to task difficulty, issuing more retrieval commands on multi\-hop datasets \(2\.6–3\.4 on HotpotQA, MuSiQue, and 2WikiMultihopQA\) than on single\-hop datasets \(2\.0–2\.4 on NQ, TriviaQA, and PopQA\)\.
To disentangle behaviors induced by cold\-start SFT from those learned during RL, we track trajectory statistics across training steps \(Table[3](https://arxiv.org/html/2605.29307#S3.T3)\)\. We observe that low\-level syntactic properties of the generated pipelines—such as pipe depth, use of fixed\-string matching, truncation patterns, and cascaded filtering—remain largely stable throughout RL training, indicating that these structural retrieval “primitives” are established during SFT\. In contrast, RL primarily shapes higher\-level search behavior\. As training progresses, the agent reduces the number of commands per trajectory \(from3\.063\.06to2\.562\.56\), increases the amount of context extracted per query \(e\.g\.,head \-ngrowing from approximately 5 to 10 lines\), and allocates substantially more tokens to reasoning \(4,251→6,4094\{,\}251\\rightarrow 6\{,\}409\)\. Overall, RL refines an already structured retrieval interface by improving efficiency and encouraging more reasoning, while preserving the underlying interaction patterns established during SFT\.
##### Case Studies:
To qualitatively analyze the operational characteristics ofGrepSeek, we compare its trajectories against the strongest dense retrieval baseline \(Search\-R1 with Qwen3\-Emb\-4B\) across our benchmark suite \(see detailed transcripts in Appendix[D](https://arxiv.org/html/2605.29307#A4)\)\. The empirical traces show that direct execution of shell pipelines over raw text enables a high degree of lexical precision\. In particular,GrepSeekcan isolate rare symbolic patterns such as chemical formulas \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\) and exact entity names \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\) in a singlerg \-Fquery, whereas dense retrievers may merge closely related entities due to embedding\-level smoothing\. The agent also performs effective multi\-hop evidence linking via explicit keyword composition \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\) and reliably resolves entity collisions, such as distinguishing subsidiaries from parent organizations \(Examples[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)and[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\)\. At the same time, the analysis highlights inherent limitations of lexical search\. Because standard Unix tools do not perform semantic ranking and instead return matches in file order, relevant evidence can sometimes be preceded by irrelevant or less informative passages \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\)\. Moreover, reliance on exact string matching introduces brittleness to surface\-form variation: small spelling differences or missing diacritics \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\) can prevent retrieval of relevant content, forcing reliance on downstream reasoning or parametric knowledge\. In such cases, dense retrieval methods can be more robust due to their ability to generalize across lexical variations in embedding space\.
## 4Related Work
##### Retrieval\-Augmented Agentic Search:
Knowledge\-intensive question answering is challenging for LLMs because many questions require facts that may be missing, outdated, or unreliable in the model’s parametric memory\(Mallenet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib47)\)\. Access to external knowledge is central to improving factuality and coverage\. Retrieval\-Augmented Generation \(RAG\)\(Lewiset al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib37)\)addresses this need by retrieving relevant evidence from an external corpus and conditioning generation on the retrieved context\. More broadly, this can be viewed as an instance of retrieval\-enhanced machine learning\(Zamaniet al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib38)\)\. In this paradigm, the retrieval module determines what information is exposed to the model, typically through an index\-based interface such as sparse lexical retrieval with BM25\(Robertsonet al\.,[1994](https://arxiv.org/html/2605.29307#bib.bib30)\)or dense retrieval with embedding models such as E5\(Wanget al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib29)\)and Qwen3\-Embedding\(Zhanget al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib28)\)\. This retrieval step gives the model access to non\-parametric knowledge and has become a standard approach for knowledge\-intensive tasks\.
However, a single retrieval step is often insufficient for complex questions\. Many information needs require intermediate reasoning: the system may need to identify an entity, use that entity to form a follow\-up query, retrieve additional evidence, and then compose information across documents\. This motivates retrieval\-augmented reasoning methods, where retrieval is not merely a preprocessing step but part of a multi\-turn reasoning process\. Such multi\-turn behavior is important for both unstructured corpora and structured settings, where systems may need to inspect intermediate results, refine constraints, and issue follow\-up operations over databases or tables, as in STARQA\(Maddelaet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib3)\)\. IRCoT\(Trivediet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib36)\)interleaves chain\-of\-thought reasoning with retrieval, while more recent search\-agent systems extend this idea to longer\-horizon tool\-use trajectories, including Search\-R1\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\)and Search\-O1\(Liet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib35)\)\.
Recent agentic search methods differ in which parts of the pipeline are optimized\. Some systems treat both the LLM and the retriever or search engine as black boxes, relying on prompting or inference\-time orchestration to decide when and how to search, as in Search\-O1\(Liet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib35)\)\. Other methods train the language model to issue better search queries and reason over retrieved evidence while keeping the underlying retriever fixed, as in Search\-R1\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\)\. A third line of work jointly optimizes the reasoning policy and the retrieval or ranking component, as in CoSearch\(Zenget al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib49)\)\. These approaches primarily differ in how they improve reasoning, planning, or retrieval over a conventional search interface\. Our work studies a complementary direction: instead of training an agent to better use a fixed retriever, we train a compact open\-weight model to interact directly with the corpus through deterministic shell\-based search operations\.
Question answering is widely used to evaluate retrieval\-augmented and agentic search systems because it directly tests whether a system can retrieve sufficient evidence and synthesize the correct answer\. Multi\-hop QA benchmarks are especially relevant because they require multi\-turn search behavior: a model must often retrieve one piece of evidence, use it to identify a new information need, and then combine evidence across steps\. Following prior search\-agent work such as Search\-R1\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\), we evaluate on both single\-hop and multi\-hop QA benchmarks\. We acknowledge that broader deep\-search benchmarks, such as BrowseComp\(Weiet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib50)\)and Total Recall QA\(Rafieeet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib51)\), also evaluate important aspects of long\-horizon information seeking\. We leave evaluation on these broader deep\-research settings to future work\.
##### Direct Interaction with Corpus:
Direct Corpus Interaction \(DCI\) provides a different way to connect language models with external information\. Instead of relying on a retriever to rank passages, the agent issues explicit operations over the raw corpus and controls how evidence is matched, filtered, and composed\. Prior work has studied direct textual search in code and repository settings\(Di Grazia and Pradel,[2023](https://arxiv.org/html/2605.29307#bib.bib11); Wanget al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib13)\), as well as recent DCI\-style agents for open\-domain retrieval over large\-scale corpora\(Senet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib12); Liet al\.,[2026](https://arxiv.org/html/2605.29307#bib.bib14); Subramanianet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib15)\)\. This direction is also related to systems work on efficient string and regular\-expression search over large or compressed text collections, including Succinct and Swift\(Agarwalet al\.,[2015](https://arxiv.org/html/2605.29307#bib.bib52); Navarro,[2003](https://arxiv.org/html/2605.29307#bib.bib53)\)\. We view these systems primarily as efficiency\-oriented predecessors rather than agentic\-search baselines: they improve the execution substrate for direct search, while our focus is on whether an LLM can learn when and how to use direct corpus operations as part of multi\-step reasoning\.
## 5Conclusion & Future Work
We introducedGrepSeek, a Direct Corpus Interaction \(DCI\) search agent that bypasses traditional pre\-computed search indexes by operating directly over raw text corpora using standard Unix shell commands\. Through a two\-stage training pipeline—consisting of synthetically generated cold\-start SFT followed by RL with GRPO—we demonstrated that search agents can learn to execute highly effective, interpretable, and lexically precise retrieval programs\.GrepSeekachieves strong performance on challenging multi\-hop reasoning benchmarks by precisely isolating symbolic patterns and enforcing strict entity\-level constraints, succeeding in scenarios where dense embedding\-based models often fail due to semantic conflation\. In addition, our optimized sharded\-parallel execution engine substantially reduces runtime memory requirements and eliminates the expensive offline indexing stage required by dense retrieval systems\. Despite these advantages, our analysis also highlighted the limitations of purely lexical retrieval, including sensitivity to surface\-form variation \(e\.g\., diacritics\) and the absence of semantic relevance ranking\.
Future work will explore several directions to address these issues\. First, we plan to investigate hybrid retrieval architectures that combine direct corpus interaction with index\-based retrieval models\. Second, we aim to enhance the expressiveness and robustness of the shell\-based interface by incorporating richer matching primitives, including fuzzy matching and more advanced regular\-expression operators\. Finally, we will focus on improving inference efficiency by reducing decoding overhead from long reasoning traces, through techniques such as more compact trajectory generation and improved context management, enabling more efficient deployment in high\-throughput settings\. We further plan to expand our evaluation to long\-form question answering, adhoc document retrieval, and retrieval from unseen corpora\.
## Acknowledgments
This work was supported in part by the Center for Intelligent Information Retrieval, in part by the Office of Naval Research contract \#N000142412612, in part by the National Science Foundation grant \#2402873 and \#2402874, and with support from Google\.org\. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of the sponsors\.
## References
- Succinct: enabling queries on compressed data\.In12th USENIX Symposium on Networked Systems Design and Implementation \(NSDI 15\),Oakland, CA,pp\. 337–350\.External Links:ISBN 978\-1\-931971\-218,[Link](https://www.usenix.org/conference/nsdi15/technical-sessions/presentation/agarwal)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- Y\. Chen, L\. Yan, Z\. Yang, E\. Zhang, J\. Zhao, S\. Wang, D\. Yin, and J\. Mao \(2026\)Beyond monolithic architectures: a multi\-agent search and knowledge optimization framework for agentic search\.External Links:2601\.04703,[Link](https://arxiv.org/abs/2601.04703)Cited by:[footnote 15](https://arxiv.org/html/2605.29307#footnote15)\.
- T\. H\. Cormen, C\. E\. Leiserson, R\. L\. Rivest, and C\. Stein \(2001\)Introduction to algorithms\.MIT Press\.Cited by:[§2\.2](https://arxiv.org/html/2605.29307#S2.SS2.SSS0.Px1.p2.6)\.
- S\. Deerwester, S\. T\. Dumais, G\. W\. Furnas, T\. K\. Landauer, and R\. Harshman \(1990\)Indexing by latent semantic analysis\.Journal of the American Society for Information Science41\(6\),pp\. 391–407\.External Links:[Document](https://dx.doi.org/https%3A//doi.org/10.1002/%28SICI%291097-4571%28199009%2941%3A6%3C391%3A%3AAID-ASI1%3E3.0.CO%3B2-9)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1)\.
- L\. Di Grazia and M\. Pradel \(2023\)Code search: a survey of techniques for finding code\.ACM Comput\. Surv\.55\(11\)\.External Links:ISSN 0360\-0300,[Link](https://doi.org/10.1145/3565971),[Document](https://dx.doi.org/10.1145/3565971)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- M\. Douze, A\. Guzhva, C\. Deng, J\. Johnson, G\. Szilvasy, P\. Mazaré, M\. Lomeli, L\. Hosseini, and H\. Jégou \(2025\)The faiss library\.External Links:2401\.08281,[Link](https://arxiv.org/abs/2401.08281)Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3)\.
- T\. Formal, B\. Piwowarski, and S\. Clinchant \(2021\)SPLADE: sparse lexical and expansion model for first stage ranking\.InProceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval,SIGIR ’21,New York, NY, USA,pp\. 2288–2292\.External Links:ISBN 9781450380379,[Document](https://dx.doi.org/10.1145/3404835.3463098)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1)\.
- X\. Ho, A\. Duong Nguyen, S\. Sugawara, and A\. Aizawa \(2020\)Constructing a multi\-hop QA dataset for comprehensive evaluation of reasoning steps\.InProceedings of the 28th International Conference on Computational Linguistics,D\. Scott, N\. Bel, and C\. Zong \(Eds\.\),Barcelona, Spain \(Online\),pp\. 6609–6625\.External Links:[Link](https://aclanthology.org/2020.coling-main.580/),[Document](https://dx.doi.org/10.18653/v1/2020.coling-main.580)Cited by:[2nd item](https://arxiv.org/html/2605.29307#A1.I2.i2.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- A\. Holtzman, J\. Buys, L\. Du, M\. Forbes, and Y\. Choi \(2020\)The curious case of neural text degeneration\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=rygGQyrFvH)Cited by:[§B\.4](https://arxiv.org/html/2605.29307#A2.SS4.SSS0.Px1.p1.7),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px2.p1.4)\.
- B\. Jin, H\. Zeng, Z\. Yue, J\. Yoon, S\. O\. Arik, D\. Wang, H\. Zamani, and J\. Han \(2025\)Search\-r1: training LLMs to reason and leverage search engines with reinforcement learning\.InSecond Conference on Language Modeling,External Links:[Link](https://openreview.net/forum?id=Rwhi91ideu)Cited by:[Appendix A](https://arxiv.org/html/2605.29307#A1.p1.1),[§1](https://arxiv.org/html/2605.29307#S1.p1.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p2.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p3.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p4.1)\.
- J\. Jin, A\. Paladugu, and C\. Xiong \(2026\)Beneficial reasoning behaviors in agentic search and effective post\-training to obtain them\.External Links:2510\.06534,[Link](https://arxiv.org/abs/2510.06534)Cited by:[footnote 15](https://arxiv.org/html/2605.29307#footnote15)\.
- M\. Joshi, E\. Choi, D\. Weld, and L\. Zettlemoyer \(2017\)TriviaQA: a large scale distantly supervised challenge dataset for reading comprehension\.InProceedings of the 55th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),R\. Barzilay and M\. Kan \(Eds\.\),Vancouver, Canada,pp\. 1601–1611\.External Links:[Link](https://aclanthology.org/P17-1147/),[Document](https://dx.doi.org/10.18653/v1/P17-1147)Cited by:[2nd item](https://arxiv.org/html/2605.29307#A1.I1.i2.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- V\. Karpukhin, B\. Oguz, S\. Min, P\. Lewis, L\. Wu, S\. Edunov, D\. Chen, and W\. Yih \(2020\)Dense passage retrieval for open\-domain question answering\.InProceedings of the 2020 conference on empirical methods in natural language processing \(EMNLP\),pp\. 6769–6781\.Cited by:[§A\.1](https://arxiv.org/html/2605.29307#A1.SS1.SSS0.Px2.p2.1),[§1](https://arxiv.org/html/2605.29307#S1.p1.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- T\. Kwiatkowski, J\. Palomaki, O\. Redfield, M\. Collins, A\. Parikh, C\. Alberti, D\. Epstein, I\. Polosukhin, J\. Devlin, K\. Lee, K\. Toutanova, L\. Jones, M\. Kelcey, M\. Chang, A\. M\. Dai, J\. Uszkoreit, Q\. Le, and S\. Petrov \(2019\)Natural questions: a benchmark for question answering research\.Transactions of the Association for Computational Linguistics7,pp\. 452–466\.External Links:[Link](https://aclanthology.org/Q19-1026/),[Document](https://dx.doi.org/10.1162/tacl%5Fa%5F00276)Cited by:[1st item](https://arxiv.org/html/2605.29307#A1.I1.i1.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- P\. Lewis, E\. Perez, A\. Piktus, F\. Petroni, V\. Karpukhin, N\. Goyal, H\. Küttler, M\. Lewis, W\. Yih, T\. Rocktäschel, S\. Riedel, and D\. Kiela \(2020\)Retrieval\-augmented generation for knowledge\-intensive nlp tasks\.InProceedings of the 34th International Conference on Neural Information Processing Systems,NIPS ’20,Red Hook, NY, USA\.External Links:ISBN 9781713829546Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- X\. Li, G\. Dong, J\. Jin, Y\. Zhang, Y\. Zhou, Y\. Zhu, P\. Zhang, and Z\. Dou \(2025\)Search\-o1: agentic search\-enhanced large reasoning models\.InProceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,C\. Christodoulopoulos, T\. Chakraborty, C\. Rose, and V\. Peng \(Eds\.\),Suzhou, China,pp\. 5420–5438\.External Links:[Link](https://aclanthology.org/2025.emnlp-main.276/),[Document](https://dx.doi.org/10.18653/v1/2025.emnlp-main.276),ISBN 979\-8\-89176\-332\-6Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p2.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p3.1)\.
- Z\. Li, H\. Zhang, C\. Wei, P\. Lu, P\. Nie, Y\. Lu, Y\. Bai, S\. Feng, H\. Zhu, M\. Zhong, Y\. Zhang, J\. Xie, Y\. Choi, J\. Zou, J\. Han, W\. Chen, J\. Lin, D\. Jiang, and Y\. Zhang \(2026\)Beyond semantic similarity: rethinking retrieval for agentic search via direct corpus interaction\.External Links:2605\.05242,[Link](https://arxiv.org/abs/2605.05242)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p3.1),[§1](https://arxiv.org/html/2605.29307#S1.p4.1),[§2](https://arxiv.org/html/2605.29307#S2.p1.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- I\. Loshchilov and F\. Hutter \(2019\)Decoupled weight decay regularization\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=Bkg6RiCqY7)Cited by:[§B\.4](https://arxiv.org/html/2605.29307#A2.SS4.SSS0.Px1.p2.2)\.
- M\. Maddela, L\. Xie, D\. Preotiuc\-Pietro, and Mausam \(2025\)STARQA: a question answering dataset for complex analytical reasoning over structured databases\.InProceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,Suzhou, China,pp\. 34487–34499\.External Links:[Link](https://aclanthology.org/2025.emnlp-main.1749/),[Document](https://dx.doi.org/10.18653/v1/2025.emnlp-main.1749),ISBN 979\-8\-89176\-332\-6Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p2.1)\.
- Y\. A\. Malkov and D\. A\. Yashunin \(2020\)Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs\.IEEE Trans\. Pattern Anal\. Mach\. Intell\.42\(4\),pp\. 824–836\.External Links:ISSN 0162\-8828,[Link](https://doi.org/10.1109/TPAMI.2018.2889473),[Document](https://dx.doi.org/10.1109/TPAMI.2018.2889473)Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3)\.
- A\. Mallen, A\. Asai, V\. Zhong, R\. Das, D\. Khashabi, and H\. Hajishirzi \(2023\)When not to trust language models: investigating effectiveness of parametric and non\-parametric memories\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),A\. Rogers, J\. Boyd\-Graber, and N\. Okazaki \(Eds\.\),Toronto, Canada,pp\. 9802–9822\.External Links:[Link](https://aclanthology.org/2023.acl-long.546/),[Document](https://dx.doi.org/10.18653/v1/2023.acl-long.546)Cited by:[3rd item](https://arxiv.org/html/2605.29307#A1.I1.i3.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- G\. Navarro \(2003\)Regular expression searching on compressed text\.Journal of Discrete Algorithms1\(5\),pp\. 423–443\.External Links:ISSN 1570\-8667,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/S1570-8667%2803%2900036-4),[Link](https://www.sciencedirect.com/science/article/pii/S1570866703000364)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- J\. M\. Ponte and W\. B\. Croft \(1998\)A language modeling approach to information retrieval\.InProceedings of the 21st Annual International ACM SIGIR Conference on Research and Development in Information Retrieval,SIGIR ’98,New York, NY, USA,pp\. 275–281\.External Links:ISBN 1581130155,[Link](https://doi.org/10.1145/290941.291008),[Document](https://dx.doi.org/10.1145/290941.291008)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1)\.
- O\. Press, M\. Zhang, S\. Min, L\. Schmidt, N\. Smith, and M\. Lewis \(2023\)Measuring and narrowing the compositionality gap in language models\.InFindings of the Association for Computational Linguistics: EMNLP 2023,H\. Bouamor, J\. Pino, and K\. Bali \(Eds\.\),Singapore,pp\. 5687–5711\.External Links:[Link](https://aclanthology.org/2023.findings-emnlp.378/),[Document](https://dx.doi.org/10.18653/v1/2023.findings-emnlp.378)Cited by:[4th item](https://arxiv.org/html/2605.29307#A1.I2.i4.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- Qwen Team \(2026\)Qwen3\.5: towards native multimodal agents\.External Links:[Link](https://qwen.ai/blog?id=qwen3.5)Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px2.p1.4)\.
- M\. Rafiee, H\. Soudani, Z\. Abbasiantaeb, M\. Aliannejadi, F\. Hasibi, and H\. Zamani \(2026\)Total recall qa: a verifiable evaluation suite for deep research agents\.External Links:2603\.18516,[Link](https://arxiv.org/abs/2603.18516)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p4.1)\.
- P\. Rajpurkar, J\. Zhang, K\. Lopyrev, and P\. Liang \(2016\)SQuAD: 100,000\+ questions for machine comprehension of text\.InProceedings of the 2016 Conference on Empirical Methods in Natural Language Processing,J\. Su, K\. Duh, and X\. Carreras \(Eds\.\),Austin, Texas,pp\. 2383–2392\.External Links:[Link](https://aclanthology.org/D16-1264/),[Document](https://dx.doi.org/10.18653/v1/D16-1264)Cited by:[§A\.3](https://arxiv.org/html/2605.29307#A1.SS3.p1.1),[§B\.3](https://arxiv.org/html/2605.29307#A2.SS3.SSS0.Px1.p1.16),[§2\.1\.2](https://arxiv.org/html/2605.29307#S2.SS1.SSS2.Px2.p1.11),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- S\. E\. Robertson, S\. Walker, S\. Jones, M\. Hancock\-Beaulieu, and M\. Gatford \(1994\)Okapi at trec\-3\.InText Retrieval Conference,External Links:[Link](https://api.semanticscholar.org/CorpusID:3946054)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- G\. Salton and C\. Buckley \(1988\)Term\-weighting approaches in automatic text retrieval\.Information Processing & Management24\(5\),pp\. 513–523\.External Links:ISSN 0306\-4573,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/0306-4573%2888%2990021-0),[Link](https://www.sciencedirect.com/science/article/pii/0306457388900210)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1)\.
- S\. Sen, A\. Kasturi, E\. Lumer, A\. Gulati, and V\. K\. Subbiah \(2026\)Is grep all you need? how agent harnesses reshape agentic search\.External Links:2605\.15184,[Link](https://arxiv.org/abs/2605.15184)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p3.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- Z\. Shao, P\. Wang, Q\. Zhu, R\. Xu, J\. Song, M\. Zhang, Y\. K\. Li, Y\. Wu, and D\. Guo \(2024\)DeepSeekMath: pushing the limits of mathematical reasoning in open language models\.ArXivabs/2402\.03300\.External Links:[Link](https://api.semanticscholar.org/CorpusID:267412607)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p4.1),[§2\.1\.2](https://arxiv.org/html/2605.29307#S2.SS1.SSS2.Px2.p1.11),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px2.p1.4)\.
- S\. Subramanian, A\. Akinfaderin, Y\. Zhang, I\. Singh, M\. Khanuja, S\. Singh, and M\. L\. Tanke \(2025\)Keyword search is all you need: achieving rag\-level performance without vector databases using agentic tool use\.External Links:2602\.23368,[Link](https://arxiv.org/abs/2602.23368)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- S\. Sun, H\. Song, Y\. Wang, R\. Ren, J\. Jiang, J\. Zhang, F\. Bai, J\. Deng, W\. X\. Zhao, Z\. Liu, L\. Fang, Z\. Wang, and J\. Wen \(2025\)SimpleDeepSearcher: deep information seeking via web\-powered reasoning trajectory synthesis\.InFindings of the Association for Computational Linguistics: EMNLP 2025,C\. Christodoulopoulos, T\. Chakraborty, C\. Rose, and V\. Peng \(Eds\.\),Suzhou, China,pp\. 13705–13720\.External Links:[Link](https://aclanthology.org/2025.findings-emnlp.739/),[Document](https://dx.doi.org/10.18653/v1/2025.findings-emnlp.739),ISBN 979\-8\-89176\-335\-7Cited by:[footnote 15](https://arxiv.org/html/2605.29307#footnote15)\.
- H\. Trivedi, N\. Balasubramanian, T\. Khot, and A\. Sabharwal \(2022\)MuSiQue: multihop questions via single\-hop question composition\.Transactions of the Association for Computational Linguistics10,pp\. 539–554\.External Links:[Link](https://aclanthology.org/2022.tacl-1.31/),[Document](https://dx.doi.org/10.1162/tacl%5Fa%5F00475)Cited by:[3rd item](https://arxiv.org/html/2605.29307#A1.I2.i3.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- H\. Trivedi, N\. Balasubramanian, T\. Khot, and A\. Sabharwal \(2023\)Interleaving retrieval with chain\-of\-thought reasoning for knowledge\-intensive multi\-step questions\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),A\. Rogers, J\. Boyd\-Graber, and N\. Okazaki \(Eds\.\),Toronto, Canada,pp\. 10014–10037\.External Links:[Link](https://aclanthology.org/2023.acl-long.557/),[Document](https://dx.doi.org/10.18653/v1/2023.acl-long.557)Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p2.1)\.
- B\. Wang, X\. Wang, G\. Li, C\. Zhi, J\. Han, X\. Zhao, N\. Wang, S\. Deng, and J\. Yin \(2026\)GrepRAG: an empirical study and optimization of grep\-like retrieval for code completion\.External Links:2601\.23254,[Link](https://arxiv.org/abs/2601.23254)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p2.1),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px2.p1.1)\.
- L\. Wang, N\. Yang, X\. Huang, B\. Jiao, L\. Yang, D\. Jiang, R\. Majumder, and F\. Wei \(2022\)Text embeddings by weakly\-supervised contrastive pre\-training\.ArXivabs/2212\.03533\.External Links:[Link](https://api.semanticscholar.org/CorpusID:254366618)Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- J\. Wei, Z\. Sun, S\. Papay, S\. McKinney, J\. Han, I\. Fulford, H\. W\. Chung, A\. T\. Passos, W\. Fedus, and A\. Glaese \(2025\)Browsecomp: a simple yet challenging benchmark for browsing agents\.arXiv preprint arXiv:2504\.12516\.Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p4.1)\.
- Z\. Yang, P\. Qi, S\. Zhang, Y\. Bengio, W\. Cohen, R\. Salakhutdinov, and C\. D\. Manning \(2018\)HotpotQA: a dataset for diverse, explainable multi\-hop question answering\.InProceedings of the 2018 Conference on Empirical Methods in Natural Language Processing,E\. Riloff, D\. Chiang, J\. Hockenmaier, and J\. Tsujii \(Eds\.\),Brussels, Belgium,pp\. 2369–2380\.External Links:[Link](https://aclanthology.org/D18-1259/),[Document](https://dx.doi.org/10.18653/v1/D18-1259)Cited by:[1st item](https://arxiv.org/html/2605.29307#A1.I2.i1.p1.1.1),[§1](https://arxiv.org/html/2605.29307#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px1.p1.1)\.
- S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. R\. Narasimhan, and Y\. Cao \(2023\)ReAct: synergizing reasoning and acting in language models\.InThe Eleventh International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=WE_vluYUL-X)Cited by:[§2](https://arxiv.org/html/2605.29307#S2.SS0.SSS0.Px1.p1.17)\.
- H\. Zamani, M\. Dehghani, W\. B\. Croft, E\. Learned\-Miller, and J\. Kamps \(2018\)From neural re\-ranking to neural ranking: learning a sparse representation for inverted indexing\.InProceedings of the 27th ACM International Conference on Information and Knowledge Management,CIKM ’18,New York, NY, USA,pp\. 497–506\.External Links:ISBN 9781450360142,[Document](https://dx.doi.org/10.1145/3269206.3271800)Cited by:[§1](https://arxiv.org/html/2605.29307#S1.p1.1)\.
- H\. Zamani, F\. Diaz, M\. Dehghani, D\. Metzler, and M\. Bendersky \(2022\)Retrieval\-enhanced machine learning\.InProceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval,SIGIR ’22,New York, NY, USA,pp\. 2875–2886\.External Links:ISBN 9781450387323,[Link](https://doi.org/10.1145/3477495.3531722),[Document](https://dx.doi.org/10.1145/3477495.3531722)Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- H\. Zeng, L\. Collins, B\. Kumar, N\. Shah, and H\. Zamani \(2026\)COSEARCH: joint training of reasoning and document ranking via reinforcement learning for agentic search\.arXiv preprint arXiv:2604\.17555\.Cited by:[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p3.1)\.
- Y\. Zhang, M\. Li, D\. Long, X\. Zhang, H\. Lin, B\. Yang, P\. Xie, A\. Yang, D\. Liu, J\. Lin, F\. Huang, and J\. Zhou \(2025\)Qwen3 embedding: advancing text embedding and reranking through foundation models\.arXiv preprint arXiv:2506\.05176\.Cited by:[§3\.1](https://arxiv.org/html/2605.29307#S3.SS1.SSS0.Px3.p1.3),[§4](https://arxiv.org/html/2605.29307#S4.SS0.SSS0.Px1.p1.1)\.
- Y\. Zhao, A\. Gu, R\. Varma, L\. Luo, C\. Huang, M\. Xu, L\. Wright, H\. Shojanazeri, M\. Ott, S\. Shleifer, A\. Desmaison, C\. Balioglu, P\. Damania, B\. Nguyen, G\. Chauhan, Y\. Hao, A\. Mathews, and S\. Li \(2023\)PyTorch fsdp: experiences on scaling fully sharded data parallel\.External Links:2304\.11277,[Link](https://arxiv.org/abs/2304.11277)Cited by:[§B\.4](https://arxiv.org/html/2605.29307#A2.SS4.SSS0.Px1.p2.2)\.
## Appendix ADatasets
Following prior work\(Jinet al\.,[2025](https://arxiv.org/html/2605.29307#bib.bib9)\), we evaluate our method on a comprehensive suite of seven knowledge\-intensive benchmark datasets\. These datasets are carefully selected to evaluate both single\-step fact retrieval and complex, multi\-step reasoning\. To standardize the formatting and evaluation protocol, all datasets are obtained from the FlashRAG repository\.202020Available at:[https://hf\.co/datasets/RUC\-NLPIR/FlashRAG\_datasets](https://hf.co/datasets/RUC-NLPIR/FlashRAG_datasets)
### A\.1Evaluation Benchmarks
The evaluation suite is divided into single\-hop and multi\-hop datasets to isolate the agent’s ability to perform targeted retrieval versus iterative corpus exploration\.
##### Single\-Hop Datasets
These tasks require retrieving a single, highly relevant fact or document to answer the user’s query:
- •Natural Questions \(NQ\)\(Kwiatkowskiet al\.,[2019](https://arxiv.org/html/2605.29307#bib.bib10)\):A dataset of real user queries issued to Google Search\. We use the open\-domain split, which requires systems to retrieve relevant Wikipedia passages to answer questions formulated by users without prior knowledge of the target\.
- •TriviaQA\(Joshiet al\.,[2017](https://arxiv.org/html/2605.29307#bib.bib48)\):A collection of complex trivia questions authored by trivia enthusiasts\. While the questions often contain compositional linguistic structures, the answers can typically be derived from a single retrieved document\.
- •PopQA\(Mallenet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib47)\):An entity\-centric QA dataset specifically designed to probe long\-tail knowledge\. The dataset is constructed from Wikidata triples and focuses on rare entities where parametric knowledge in LLMs typically fails, strictly necessitating accurate external retrieval\.
Table 4:Dataset sizes for training and evaluation\. Datasets marked with an asterisk \(∗\) indicate those utilized during the training phase for SFT and RL optimization\.
##### Multi\-Hop Datasets
These tasks require the agent to execute multiple interdependent search queries, gathering partial information to inform subsequent retrieval steps:
- •HotpotQA\(Yanget al\.,[2018](https://arxiv.org/html/2605.29307#bib.bib46)\):A dataset requiring reasoning across at least two distinct Wikipedia articles\. Questions are specifically designed to require information from multiple sources to synthesize and produce a correct the final answer\.
- •2WikiMultihopQA \(2Wiki\)\(Hoet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib45)\):Constructed using Wikidata properties to generate compositional questions\. This dataset introduces explicit logical structures to the multi\-hop reasoning process, requiring the agent to follow strict reasoning chains across multiple documents\.
- •MuSiQue\(Trivediet al\.,[2022](https://arxiv.org/html/2605.29307#bib.bib44)\):A rigorous multi\-hop QA dataset designed to minimize “shortcut” reasoning\. The questions are composed by chaining multiple single\-hop questions, heavily filtered to ensure that models cannot guess the answer through lexical overlap or single\-document retrieval\.
- •Bamboogle\(Presset al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib43)\):A smaller but highly challenging dataset consisting of questions manually authored to defeat standard search engines\. It requires deep, multi\-step evidence gathering that cannot be resolved using surface\-level web snippets or simple entity linking\.
`DCI Agent System Prompt`Figure 6:System prompt forGrepSeek\.
### A\.2Data Splits and Training Protocol
To evaluate the generalization capabilities of our approach, we employ a strict split between in\-distribution training datasets and out\-of\-distribution evaluation datasets\. For the training phase, the agent is trained exclusively on a combined dataset consisting of the training splits ofNQ\(79,16879,168examples\) andHotpotQA\(90,44790,447examples\)\. This provides the agent with exposure to both fundamental single\-hop retrieval dynamics and complex multi\-hop reasoning strategies, totaling169,615169,615training examples\. During inference, we evaluate the system across all seven datasets to test both held\-out in\-domain performance and generalization to unseen datasets\. We utilize the official test splits for datasets where they are publicly available\. The final evaluation encompasses51,71351,713total queries across the seven benchmarks\. Full dataset sizes and split statistics are detailed in Table[4](https://arxiv.org/html/2605.29307#A1.T4)\.
### A\.3Evaluation Metrics
To assess the performance of the agent across all benchmark datasets, we evaluate the generated responses using standard metrics for open\-domain question answering: Exact Match \(EM\) and token\-level F1score\(Rajpurkaret al\.,[2016](https://arxiv.org/html/2605.29307#bib.bib7)\)\.
- •Exact Match \(EM\):This measures the percentage of predictions that match the gold answer exactly\. It serves as a measure of final answer correctness\. Prior to comparison, both the predicted and ground truth answers undergo a standard normalization procedure, which includes lowercasing, punctuation removal, and the stripping of definite and indefinite articles \(e\.g\., “a”, “an”, “the”\)\.
- •F1Score:To provide a more granular measure of partial correctness and answer overlap, we compute the token\-level F1score\. This calculates the harmonic mean of precision and recall over the individual tokens present in the predicted and reference answers, applying the same text normalization steps as EM\. For examples where the dataset provides multiple reference answers for a single query, we compute the score against all references and report the maximum F1score\.
In the main body of the paper, we report F1, while EM is additionally provided in the appendix\.
`Corpus description \(shared by all roles\)`Figure 7:System prompt describing the corpus and allowed shell tools\.
## Appendix BGrepSeek’s Implementation Details
This section provides implementation details and settings used forGrepSeek\.
### B\.1Prompts
The main system prompt for the DCI agent is shown in Figure[6](https://arxiv.org/html/2605.29307#A1.F6)\. The prompts described in this section collectively define the instructional framework used to generate synthetic cold\-start training trajectories\. All agent roles share a common system prompt that specifies the corpus structure, interaction format, and permissible shell tools \(Figure[7](https://arxiv.org/html/2605.29307#A1.F7)\)\.
`Decomposition`Figure 8:Tutor prompt for decomposing multi\-hop questions into single\-hop steps\.InPhase A, the pipeline employs an Answer\-Aware Tutor to decompose multi\-hop questions into ordered single\-hop sub\-queries \(prompt in Figure[8](https://arxiv.org/html/2605.29307#A2.F8)\)\. Guided by system instructions that enforce the anti\-leak constraint \(prompt in Figure[18](https://arxiv.org/html/2605.29307#A2.F18)\), the Tutor iteratively constructs a backward retrieval trajectory through an initial command proposal stage \(prompt in Figure[19](https://arxiv.org/html/2605.29307#A2.F19)\) followed by targeted refinement steps \(prompt in Figure[10](https://arxiv.org/html/2605.29307#A2.F10)\)\. Each retrieved document is validated using a per\-hop entailment judge \(Figure[9](https://arxiv.org/html/2605.29307#A2.F9)\), after which a dedicated bridge extraction prompt identifies the intermediate entity required to connect the current retrieval step to the preceding sub\-query \(prompt in Figure[11](https://arxiv.org/html/2605.29307#A2.F11)\)\.
`Per\-hop judge \(does the doc confirm the answer?\)`Figure 9:Prompt for judging if the retrieved document entails the target answer\.`Backward command – refine attempt`Figure 10:Tutor prompt for refining a failed retrieval command\.After constructing a verified retrieval path,Phase Btransitions to an Answer\-Blind Planner operating under a separate forward\-acting system prompt \(prompt in Figure[12](https://arxiv.org/html/2605.29307#A2.F12)\)\. At each step, the Planner generates an initial history\-conditioned reasoning trace and retrieval action proposal \(prompt in Figure[13](https://arxiv.org/html/2605.29307#A2.F13)\)\. A Tutor\-edit stage then refines the Planner’s reasoning to align it with the verified retrieval command while remaining strictly grounded in the observable interaction history \(prompt in Figure[15](https://arxiv.org/html/2605.29307#A2.F15)\)\. This process produces trajectories that preserve realistic forward causal reasoning while avoiding future\-state leakage introduced by backward evidence construction\.
`Bridge\-entity extraction`Figure 11:Prompt for extracting the bridging entity required for backward chaining\.`Planner – system \(answer\-blind agent\)`Figure 12:System prompt for the Planner agent used during forward assembly\.`Planner – step user prompt`Figure 13:Standard user prompt for the Planner agent during trajectory generation\.`Final answer user prompt`Figure 14:User prompt for the final answer formulation step\.`Tutor edit \(rewrite think to reach target command\)`Figure 15:Tutor prompt for steering agent reasoning toward verified actions\.Finally, inPhase C, the Planner generates a final answer conditioned exclusively on the accumulated interaction trajectory \(prompt in Figure[14](https://arxiv.org/html/2605.29307#A2.F14)\)\. The completed trajectory is then evaluated by a Trajectory Coherence Judge \(prompt in Figure[16](https://arxiv.org/html/2605.29307#A2.F16)\), which enforces strict temporal consistency constraints and rejects trajectories that implicitly reveal target entities, retrieval terms, or unobserved facts before they become available within the agent’s causal history\.
`Trajectory coherence judge`Figure 16:Prompt for the final quality gate checking for information leakage\.
### B\.2Efficient Corpus Interaction
Algorithm 2Sharded\-Parallel Corpus Search1:command containing pipe \(\|\)
cc; corpus
𝒞\\mathcal\{C\}split into
SScontiguous shards
CiC\_\{i\}s\.t\.
⨄iCi=𝒞\\biguplus\_\{i\}C\_\{i\}=\\mathcal\{C\}
2:Byte\-exact output identical to sequential execution of
ccon
𝒞\\mathcal\{C\}
3:
\(s1,…,sm\)←Decompose\(c\)\(s\_\{1\},\\dots,s\_\{m\}\)\\leftarrow\\textsc\{Decompose\}\(c\)⊳\\trianglerightSplit pipeline intommdistinct stages based on pipe operator\(\|\)
4:
\(τ,N\)←Classify\(s1,…,sm\)\(\\tau,N\)\\leftarrow\\textsc\{Classify\}\(s\_\{1\},\\dots,s\_\{m\}\)⊳\\trianglerightClassify the type of reduction
5:ifτ=Sequential\\tau=\\textsc\{Sequential\}thenreturn
Exec\(c,𝒞\)\\textsc\{Exec\}\(c,\\mathcal\{C\}\)⊳\\trianglerightRun on full corpus if it can only be sequentially
6:parallel for
Ci∈𝒞C\_\{i\}\\in\\mathcal\{C\}do
Ri←Exec\(c,Ci\)R\_\{i\}\\leftarrow\\textsc\{Exec\}\(c,C\_\{i\}\)⊳\\trianglerightPerform the operation on each shard in parallel
7:if
τ=Concat\\tau=\\textsc\{Concat\}thenreturn
⨄iRi\\biguplus\_\{i\}R\_\{i\}⊳\\trianglerightConcat result of operations
8:else if
τ=Head\\tau=\\textsc\{Head\}thenreturn
TOP\(⨄iRi,N\)\\mathrm\{TOP\}\(\\biguplus\_\{i\}R\_\{i\},\\;N\)⊳\\trianglerightConcat result of operations and select topNN
9:else if
τ=COUNT\\tau=\\textsc\{COUNT\}thenreturn
∑iInt\(Ri\)\\sum\_\{i\}\\mathrm\{Int\}\(R\_\{i\}\)⊳\\trianglerightAdd results of operations
10:else if
τ=SortHead\\tau=\\textsc\{SortHead\}thenreturn
TOP\(Merge\(R1,…,RS\),N\)\\mathrm\{TOP\}\(\\mathrm\{Merge\}\(R\_\{1\},\\dots,R\_\{S\}\),\\;N\)⊳\\trianglerightMerge results based on value and return topNN
11:
12:functionClassify\(
s1,…,sms\_\{1\},\\dots,s\_\{m\}\)⊳\\trianglerightmmis the final stage of the pipeline
13:if
s1∉\{rg,grep\}∨∃sjs\.t\.Unsafe\(sj\)s\_\{1\}\\notin\\\{\\texttt\{rg\},\\texttt\{grep\}\\\}\\lor\\exists s\_\{j\}\\;\\text\{s\.t\.\}\\;\\textsc\{Unsafe\}\(s\_\{j\}\)then
14:return
\(Sequential,∅\)\(\\textsc\{Sequential\},\\emptyset\)⊳\\trianglerightReject non\-search or cross\-line context
15:endif
16:
𝒮←\{si∈\(s1,…,sm\)∣Stateless\(si\)\}\\mathcal\{S\}\\leftarrow\\\{s\_\{i\}\\in\(s\_\{1\},\\dots,s\_\{m\}\)\\mid\\textsc\{Stateless\}\(s\_\{i\}\)\\\}⊳\\trianglerighte\.g\.,cut,tr, line\-wisesed
17:if
sm=head \-nN∧∀j<m,sj∈𝒮s\_\{m\}=\\texttt\{head \-n \}N\\land\\forall j<m,\\;s\_\{j\}\\in\\mathcal\{S\}then
18:return
\(Head,N\)\(\\textsc\{Head\},N\)⊳\\trianglerightPattern: Stateless maps→\\toearly termination
19:elseif
sm=wc \-l∧∀j<m,sj∈𝒮s\_\{m\}=\\texttt\{wc \-l\}\\land\\forall j<m,\\;s\_\{j\}\\in\\mathcal\{S\}then
20:return
\(Count,∅\)\(\\textsc\{Count\},\\emptyset\)⊳\\trianglerightPattern: Stateless maps→\\toglobal line count
21:elseif
sm−1∈\{sort,sort\|uniq\}∧sm=head \-nNs\_\{m\-1\}\\in\\\{\\texttt\{sort\},\\;\\texttt\{sort\|uniq\}\\\}\\land s\_\{m\}=\\texttt\{head \-n \}Nthen
22:return
\(SortHead,N\)\(\\textsc\{SortHead\},N\)⊳\\trianglerightPattern: Stateless maps→\\toTop\-KKfilter
23:elseif
∀j≤m,sj∈𝒮\\forall j\\leq m,\\;s\_\{j\}\\in\\mathcal\{S\}then
24:return
\(Concat,∅\)\(\\textsc\{Concat\},\\emptyset\)⊳\\trianglerightPattern: Entire pipeline is purely stateless
25:else
26:return
\(Sequential,∅\)\(\\textsc\{Sequential\},\\emptyset\)⊳\\trianglerightRevert unsupported complex pipelines
27:endif
28:endfunction
This appendix provides a comprehensive technical overview of the system\-level optimizations employed by the DCI agent’s command\-execution engine\. The engine is designed under a strict correctness\-first principle: any pipeline whose parallel execution cannot be guaranteed to be byte\-identical to sequential execution is safely executed via a single\-file fallback mechanism\.
#### B\.2\.1Corpus Sharding and Parallel Fan\-Out
The primary bottleneck in evaluating shell pipelines over large\-scale corpora \(e\.g\., a 14 GB JSONL file\) is the inherently sequential execution model of standard Unix search tools\. To address this, the engine performs a one\-time, idempotent, line\-aligned sharding of the corpus intoSSdisjoint partitions\.
- •Line\-Aligned Sharding:The corpus is partitioned along line boundaries \(e\.g\., viasplit \-d \-n l/S\), ensuring that each JSON record remains intact within a single shard\. By construction, concatenating all shards in order reconstructs the original corpus without byte\-level modification\.
- •Thread\-Level Fan\-Out:At inference time, shell pipelines are executed concurrently across theSSshards using a thread pool\. Since each shard is processed via independentsubprocess\.runcalls \(which in turn invoke tools such asrg\), threading avoids Python\-level process management overhead while allowing all shard executions to proceed in parallel\. This reduces end\-to\-end latency for full\-corpus scans approximately proportional to the number of shards, up to the I/O and memory bandwidth limits of the system that is hosting the optimized engine\.
#### B\.2\.2Pipeline Classification and Merge Strategies
To guarantee exact behavioral equivalence with sequential corpus execution, the engine employs a conservative pipeline parser that dynamically classifies each shell pipeline and routes it to one of five deterministic execution strategies\. If a pipeline begins with an unsupported primitive or contains stateful operations that violate shard independence—such as line\-indexing flags \(e\.g\.,\-n\), count\-based modes \(e\.g\.,\-c\), contextual windowing \(e\.g\.,\-A,\-B,\-C\), or in\-place transformations \(e\.g\.,sed \-i\)—it is immediately executed via the single\-file fallback path\. For supported pipelines, the engine aggregates the per\-shard partial outputs\{R1,…,RN\}\\\{R\_\{1\},\\dots,R\_\{N\}\\\}using the following semantics:
CONCAT:Applied to fully stateless pipelines \(e\.g\.,rg,grep,cut,tr,sed\)\. The engine executes the pipeline on each shard independently and concatenates the outputsRiR\_\{i\}in shard order\.
HEAD:Applied to pipelines terminating inhead \-n K\. The engine applies the truncation locally per shard to bound memory usage toK×NK\\times Nlines\. The bounded outputs are concatenated in shard order, and a final globalhead \-n Kis applied\.
COUNT:Applied to pipelines terminating in counting operations \(e\.g\.,wc \-l\)\. The engine extracts the scalar count from each shard and computes the global sum\.
SORTHEAD:Applied to top\-KKretrieval pipelines containingsort, optionallyuniq, and terminating inhead \-n K\. The engine appliessort \| head \-n Kto each shard\. The resulting sorted streams are merged using a deterministickk\-way merge \(sort \-m\), followed by an optional globaluniqand a final globalhead \-n K\.
SEQUENTIAL:Applied to any unrecognized, unparseable, or globally stateful pipeline\. The pipeline is executed sequentially against the unified single\-file corpus to guarantee correctness\.
#### B\.2\.3I/O and System\-Level Optimizations
Table 5:Hyperparameters used for synthetic cold\-start trajectory generation \(Algorithm[1](https://arxiv.org/html/2605.29307#alg1)\) and Supervised Fine\-Tuning \(SFT\) of the DCI agent inside theverlFSDP training framework\.PhaseHyperparameterValueCold\-StartTutor \(ℳT\\mathcal\{M\}\_\{T\}\) & Planner \(ℳP\\mathcal\{M\}\_\{P\}\) BackboneQwen3\.5\-27BDataMax Refinement Iterations \(MM\)5GenerationSFT Dataset Size10,000Default Top\-pp1\.0Tutor \(Backward Phase\) Temperature0\.4\+\(0\.1×iteration\)0\.4\+\(0\.1\\times\\text\{iteration\}\)Planner \(Forward Phase\) Temperature0\.70\.7Judge Phase Temperature0\.60\.6SupervisedPolicy Model \(πθ\\pi\_\{\\theta\}\)Qwen3\.5\-9BFine\-TuningEpochs1\(SFT\)OptimizerAdamWOptimizer Betas \(β1,β2\\beta\_\{1\},\\beta\_\{2\}\)\(0\.9, 0\.999\)Optimizer Epsilon \(ϵ\\epsilon\)1×10−81\\times 10^\{\-8\}Peak Learning Rate5×10−65\\times 10^\{\-6\}Learning Rate SchedulerConstant with WarmupLinear Warmup Ratio0\.05Weight Decay0\.01Gradient Clipping Norm1\.0Max Sequence Length16,384Global Batch Size32Precisionbfloat16Hardware ParallelismUlysses \(size = 4\)Because the engine predominantly evaluates fixed\-string filtering operations, retrieval latency is largely determined by memory bandwidth and I/O access patterns\. To maximize throughput, the system implements a tiered I/O optimization stack\.
##### RAM\-Resident Corpus Placement:
When system memory permits, the corpus and all shards are staged in a RAM\-backed filesystem \(e\.g\.,/dev/shm\)\. This ensures that all reads are served directly from main memory, avoiding filesystem and disk latency\. In addition, the engine proactively warms the page cache at startup to eliminate cold\-start penalties on the first retrieval query\.
##### Deterministic Execution Flags:
The engine injects a set of deterministic performance flags into supported Unix tools\. Memory\-mapped I/O \(e\.g\.,\-\-mmapforrgandgrep\) reduces system\-call overhead, while\-\-no\-configdisables user\-level configuration to ensure reproducibility\. The environment is also fixed toLC\_ALL=C, enabling bytewise matching and avoiding locale\-dependent overhead without affecting literal search semantics\.
#### B\.2\.4Persistent Daemon Architecture and Telemetry
To eliminate the recurring costs of Python wrapper initialization and process startup across multiple tool calls within a single trajectory, the execution engine is deployed as a long\-running persistent daemon\. The evaluation loop communicates with the persistentShardedSearchEnginevia a length\-prefixed JSON protocol over a Unix socket, amortizing per\-call overhead and reducing latency by approximately 1–3 milliseconds per invocation\. Finally, the engine preserves standard Unix failure semantics \(e\.g\., returning exit code 0 if any shard produces a match\) and deduplicates standard error streams to avoid redundant global error logging\. Each tool invocation additionally records fine\-grained telemetry—including the parsed command, selected merge strategy, shard configuration, and fallback decision—enabling detailed analysis of fast\-path utilization during inference\.
### B\.3Reward Function
##### Correctness reward:
Lety^\\hat\{y\}denote the agent’s final answer, extracted from the last<answer\>⋯</answer\>\\texttt\{<answer\>\}\\cdots\\texttt\{</answer\>\}block in the trajectory, and let𝒴=\{y1,…,ym\}\\mathcal\{Y\}=\\\{y\_\{1\},\\dots,y\_\{m\}\\\}be the set of gold reference answers\. We compute a token\-levelF1F\_\{1\}score betweeny^\\hat\{y\}and the reference set\. Following prior work\(Rajpurkaret al\.,[2016](https://arxiv.org/html/2605.29307#bib.bib7)\), each prediction and reference answer is normalized by lowercasing, removing punctuation, dropping articles \(“a”, “an”, “the”\), and tokenizing on whitespace\. For a normalized predictiony^\\hat\{y\}and a reference answery∈𝒴y\\in\\mathcal\{Y\}, letPPandGGdenote their respective token multisets\. We define the overlap as the multiset intersectiono=∑tmin\(P\(t\),G\(t\)\)o=\\sum\_\{t\}\\min\(P\(t\),G\(t\)\), whereP\(t\)P\(t\)andG\(t\)G\(t\)denote token counts\. If\|P\|=0\|P\|=0or\|G\|=0\|G\|=0, we setF1\(y^,y\)=0F\_\{1\}\(\\hat\{y\},y\)=0\. Otherwise, precision, recall, andF1F\_\{1\}are defined as:
p=o\|P\|,r=o\|G\|,F1\(y^,y\)=2p⋅rp\+r\.\\mathrm\{p\}=\\frac\{o\}\{\|P\|\},\\quad\\mathrm\{r\}=\\frac\{o\}\{\|G\|\},\\quad F\_\{1\}\(\\hat\{y\},y\)=\\frac\{2\\,\\mathrm\{p\}\\cdot\\mathrm\{r\}\}\{\\mathrm\{p\}\+\\mathrm\{r\}\}\.\(1\)Since multiple surface forms may be valid, the final answer rewardRans∈\[0,1\]R\_\{\\mathrm\{ans\}\}\\in\[0,1\]is defined as the maximum score over all reference answers:
Rans=maxy∈𝒴F1\(y^,y\)\.R\_\{\\mathrm\{ans\}\}=\\max\_\{y\\in\\mathcal\{Y\}\}F\_\{1\}\(\\hat\{y\},y\)\.\(2\)This provides a dense learning signal that assigns partial credit to partially correct answers, rather than relying on a sparse binary exact\-match reward\.
Table 6:Hyperparameters used for reinforcement learning optimization via Group Relative Policy Optimization \(GRPO\) inside theverltraining framework\.PhaseHyperparameterValueGRPOGroup Size \(nn\)5AlgorithmPPO Clip Ratio \(ϵ\\epsilon\)0\.2KL Divergence Coefficient0\.0 \(Disabled\)PPO Epochs1Policy Entropy Coefficient0\.0Rollout &Sampling Temperature1\.0SamplingSampling Top\-pp1\.0Max Sequence Length16,384Max Assistant Turns6OptimizationOptimizerAdamW& BatchingOptimizer Betas \(β1,β2\\beta\_\{1\},\\beta\_\{2\}\)\(0\.9, 0\.999\)Optimizer Epsilon \(ϵ\\epsilon\)1×10−81\\times 10^\{\-8\}Peak Learning Rate5×10−65\\times 10^\{\-6\}Learning Rate SchedulerConstant with WarmupLinear Warmup Ratio0\.05Weight Decay0\.0Gradient Clipping Norm1\.0Global Training Batch Size256 questionsPPO Mini\-batch Size32PPO Micro\-batch Size per GPU1Precisionbfloat16Hardware ParallelismUlysses \(size = 2\)Total Training Steps200
##### Format reward:
We define a binary format indicatorϕ∈\{0,1\}\\phi\\in\\\{0,1\\\}to evaluate the structural validity of a trajectory\. A rollout is valid \(ϕ=1\\phi=1\) if and only if it satisfies three strict formatting criteria: \(1\) all special tags \(e\.g\.,<think\>,<tool\_call\>,<tool\_response\>, and<answer\>\) are properly balanced and non\-overlapping; \(2\) the trajectory follows the prescribed state\-transition structure \(reasoning→\\rightarrowtool invocation→\\rightarrowenvironment response→\\rightarrowfinal answer\), with no text generated outside the designated blocks; and \(3\) the trajectory terminates within a closing</answer\>tag\.
This constraint mirrors the strictly formatted interaction protocol enforced during cold\-start supervised fine\-tuning \(SFT\), where all trajectories are structurally valid by construction\. Consequently,ϕ\\phiacts as a gate that isolates and penalizes formatting violations introduced by the policy during reinforcement learning exploration phase\.
##### Combined reward:
The final reward during reinforcement learning optimization is defined as:
R=ϕ⋅Rans=ϕ⋅maxy∈𝒴F1\(y^,y\)\.R=\\phi\\cdot R\_\{\\mathrm\{ans\}\}=\\phi\\cdot\\max\_\{y\\in\\mathcal\{Y\}\}F\_\{1\}\(\\hat\{y\},y\)\.\(3\)Thus, only structurally valid trajectories receive a non\-zero learning signal, preventing the policy from exploiting the reward function through malformed or out\-of\-format outputs\.
### B\.4Experimental Settings & Hyperparameters
##### SFT Training Phase:
Table[5](https://arxiv.org/html/2605.29307#A2.T5)summarizes the configuration for both synthetic cold\-start data generation and the subsequent Supervised Fine\-Tuning \(SFT\) stage\. For data generation, we use the 27B variant of Qwen3\.5 as both the answer\-aware Tutor \(ℳT\\mathcal\{M\}\_\{T\}\) and answer\-blind Planner \(ℳP\\mathcal\{M\}\_\{P\}\) to construct a 10,000\-trajectory dataset\. During the Tutor’s backward discovery phase, we apply a dynamic temperature schedule0\.4\+0\.1×iter0\.4\+0\.1\\times\\text\{iter\}\(up toM=5M=5refinement steps\) with Nucleus Sampling\(Holtzmanet al\.,[2020](https://arxiv.org/html/2605.29307#bib.bib41)\)to encourage broader exploration when initial retrieval attempts fail\. In contrast, the Planner’s forward assembly and the final coherence judge use fixed temperatures of0\.70\.7and0\.60\.6, respectively, with top\-p=1\.0p=1\.0across all stages\.
For SFT, the 9B Qwen3\.5 policy model \(πθ\\pi\_\{\\theta\}\) is trained for one epoch using AdamW\(Loshchilov and Hutter,[2019](https://arxiv.org/html/2605.29307#bib.bib40)\)with a peak learning rate of5×10−65\\times 10^\{\-6\}and a global batch size of 32\. We use a linear warmup over the first 5% of training steps followed by a constant learning rate schedule\. The maximum sequence length is set to 16,384 tokens to accommodate long interaction trajectories, including tool calls and retrieved context\. Training is performed in theverl222222Available at:[https://github\.com/verl\-project/verl](https://github.com/verl-project/verl)framework using FSDP\(Zhaoet al\.,[2023](https://arxiv.org/html/2605.29307#bib.bib39)\)withbfloat16precision and Ulysses sequence parallelism \(degree 4\)\. The experiments are conducted on 4 Nvidia A100 \(80GB\) GPUs on a machine with 1024GB memory\.
Table 7:Hyperparameters and configurations used during the inference phase of the DCI agent\.
##### GRPO Training Phase:
Table[6](https://arxiv.org/html/2605.29307#A2.T6)lists the configuration parameters employed during the reinforcement learning phase using Group Relative Policy Optimization \(GRPO\) inside theverlframework\. The agent policy \(πθ\\pi\_\{\\theta\}\) is initialized from the checkpoint optimized during the Supervised Fine\-Tuning \(SFT\) stage and is further trained for a total of 200 global steps\. For each input query, the policy samples a group ofn=5n=5independent trajectories to compute relative advantages\. Trajectory rewards are determined by the continuous token\-levelF1F\_\{1\}score, multiplied by a binary formatting gate to strictly penalize structural violations\. Computed rewards are centered around the group mean and normalized by their standard deviation, providing a comparative learning signal that optimizes the policy without requiring an explicit critic network\. We use a symmetric PPO clip ratio of 0\.2 and disable the explicit KL divergence penalty to the reference policy, running exactly 1 proximal epoch per training step to minimize policy degradation\.
Figure 17:Effect of the number of Supervised Fine\-Tuning \(SFT\) trajectories on the Exact Match \(EM\) score after RL training\.During rollout generation via the vLLM engine,232323Available at:[https://vllm\.ai/](https://vllm.ai/)sampling parameters are configured with a temperature of 1\.0 and a top\-ppof 1\.0 to encourage diverse tool\-use exploration while preserving syntax consistency\. To support deep, multi\-turn interactions over the corpus, the trajectory budget is capped at a maximum sequence length of 16,384 tokens and a maximum of 6 assistant turns\. Policy updates are calculated using the AdamW optimizer with a peak learning rate of5×10−65\\times 10^\{\-6\}and a constant schedule following a 5% linear warmup\. The optimization runs across a global batch size of 256 questions per step, evaluated in mini\-batches of 32 and micro\-batches of 1 per GPU\. Distributed processing is managed inbfloat16mixed precision utilizing a Ulysses sequence parallel size of 2 for both the actor and reference models\. The experiments are conducted on a machine with 4 NVIDIA A100 \(80GB\) GPUs and 1024 GB of system memory, taking approximately 4 days to complete\.
##### Inference Setting:
Table[7](https://arxiv.org/html/2605.29307#A2.T7)outlines the core configuration parameters and architectural settings used during the inference phase of our finalized DCI agent\. At evaluation time, the agent policy leverages a decoding temperature restricted to0\.60\.6alongside a top\-ppof1\.01\.0to ensure highly stable, syntactic consistency during multi\-turn tool interaction\. To prevent context space saturation from excessively broad document retrieval, the maximum length for any individual shell tool output is explicitly bounded via thetool\_max\_tokensparameter to2,0482,048tokens\. In strict alignment with the environment constraints used during reinforcement learning, the maximum depth of a single interaction trajectory is capped at66assistant turns, providing a consistent structural framework for the model’s sequential reasoning\. To maximize throughput and safely accommodate long\-context interaction histories, the inference infrastructure relies on a maximum sequence length of16,38416,384tokens\. The model is served using a specialized high\-concurrency configuration capable of handling a maximum of256256sequences simultaneously, utilizing a high GPU memory allocation threshold of0\.900\.90\. The physical compute layer is provisioned across a hardware infrastructure consisting of2×2\\timesNVIDIA A100 GPUs, orchestrated with a tensor parallel size of22to optimize distributed memory access and minimize generation latency during dense search rollouts\.
Table 8:Performance \(EM scores\) across multiple QA datasets\. Superscript∗shows the datasets included in the training set, while all others are evaluated out\-of\-distribution\. Superscript↑indicates a statistically significant improvement, while↓denotes a statistically significant decrease compared to the best\-performing baseline\. We use McNemar’s test because significance is computed over paired binary exact\-match outcomes for the same set of questions \(p<0\.05p<0\.05\)\.Table 9:Ablation study ofGrepSeekacross single\-hop and multi\-hop benchmark datasets \(EM scores\)\. Superscript↑indicates a statistically significant improvement over both ablated variants\. We use McNemar’s test because significance is computed over paired binary exact\-match outcomes for the same set of questions, and apply Bonferroni correction \(p<0\.05p<0\.05\)\.`Backward command – system`Figure 18:System instructions for the backward retrieval task, emphasizing the anti\-leak rule\.`Backward command – first attempt`Figure 19:Tutor prompt for the initial attempt at backward evidence retrieval\.
## Appendix CAdditional Results
In this section, we present supplementary results evaluated using the stricter Exact Match \(EM\) metric\. While the main text reports token\-levelF1F\_\{1\}as the primary evaluation measure, EM is included here to provide a more stringent assessment of answer correctness\. Importantly, all key conclusions derived from theF1F\_\{1\}analysis remain consistent under EM, indicating that the observed improvements reflect genuine gains rather than partial\-match artifacts\. Table[8](https://arxiv.org/html/2605.29307#A2.T8)reports the performance of all evaluated methods under EM\. Consistent with the token\-levelF1F\_\{1\}results,GrepSeekmaintains a strong performance advantage, achieving the highest overall micro\-average EM score of0\.49480\.4948, representing a statistically significant improvement over the best dense retrieval baseline \(p<0\.05p<0\.05\)\.
At the dataset level,GrepSeekachieves the best EM scores on four of the seven benchmarks \(NQ, HotpotQA, 2Wiki, and MuSiQue\), with statistically significant gains on NQ, HotpotQA, and 2Wiki \(↑\)\. This trend strongly corroborates our main findings: direct corpus interaction is particularly effective in scenarios requiring precise multi\-hop reasoning, iterative evidence aggregation, and exact lexical matching\. Conversely, EM also highlights the inherent limitations of purely lexical filtering\. BecauseGrepSeekrelies on exact string\-level matching, it is sensitive to surface\-form variation and semantic paraphrasing\. This limitation is most evident in the statistically significant performance drop on PopQA \(↓\), as well as lower performance on TriviaQA and Bamboogle compared to the strongest Search\-R1 configurations using the Qwen3\-4B dense retriever\. Despite these localized trade\-offs on semantically broad or long\-tail queries, the aggregate EM results confirm thatGrepSeekremains a highly precise and competitive alternative to index\-based retrieval systems\.
The EM ablation results \(Table[9](https://arxiv.org/html/2605.29307#A2.T9)\) further support the importance of each training stage\. The fullGrepSeekmodel consistently outperforms both ablated variants across all datasets \(↑\)\. Removing RL optimization \(w/o GRPO\) reduces the micro\-average EM from0\.49480\.4948to0\.35690\.3569, highlighting the role of policy optimization in improving sequential tool\-use decisions\. Removing the SFT initialization \(w/o SFT\) leads to a more severe degradation, collapsing EM to0\.28360\.2836, which reflects instability when RL is applied without structured trajectory bootstrapping\. Similarly, Figure[17](https://arxiv.org/html/2605.29307#A2.F17)shows the scaling behavior of the cold\-start SFT stage under EM across different dataset sizes \(0,2\.52\.5k,55k, and1010k trajectories\)\. The trends closely match those observed inF1F\_\{1\}: even a small initialization of2\.52\.5k trajectories yields a substantial improvement over the base model, while further scaling provides diminishing but consistent gains, with performance gradually plateauing beyond55k examples\.
## Appendix DCase Studies
In this section, we present qualitative case studies comparing the reasoning and retrieval trajectories of our DCI agent \(GrepSeek\) against the strongest dense retrieval baseline, Search\-R1 with the Qwen3\-Emb\-4B retriever\. These examples illustrate the different behaviors, strengths, and failure modes of direct corpus interaction through shell commands versus embedding\-based semantic retrieval\. For each example, we provide the original question, the ground\-truth answer, and the generated reasoning traces, retrieval commands, and retrieved observations produced by both systems\. The examples highlight two key phenomena observed throughout evaluation:
- •Lexical Precision and Multi\-Hop Evidence Isolation:GrepSeekperforms particularly well in settings that require exact lexical matching and iterative evidence filtering\. Using shell operators such asrgandgrep, the agent can isolate rare symbolic strings, progressively refine intermediate retrieval results, and compose multi\-stage retrieval pipelines that accurately bridge evidence across documents \(see Examples[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1),[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1),[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), and[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\)\. This behavior is especially beneficial for multi\-hop reasoning, entity disambiguation, and cases where small lexical details determine correctness\. In contrast, dense retrievers may smooth over these distinctions due to embedding\-level semantic compression, sometimes leading to incorrect generalization or entity confusion\.
- •Surface\-Form Sensitivity and Ranking Limitations:At the same time, direct corpus interaction inherits the limitations of lexical retrieval\. Since shell\-based search lacks a learned semantic ranking mechanism, relevant documents may appear later in the retrieval stream despite containing the correct evidence \(see Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\)\. Moreover, strict surface\-form matching can make the agent sensitive to lexical variations such as spelling differences or omitted diacritics, causing failures in cases where dense retrievers naturally generalize through semantic similarity \(see Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\)\.
##### Discussion of Qualitative Examples:
Here we discuss and explain the provided case studies:
- •Symbolic and Rare\-Token Matching \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\):This example demonstratesGrepSeek’s ability to locate highly specific strings like chemical formulas that dense retrievers often struggle to represent in vector space\. While the dense retriever returns semantically “chemistry\-adjacent” documents, it fails to identify the exact formula\. Our agent usesrg \-Ffor an exact match, proving the utility of direct symbolic interaction for technical queries\.
- •Entity Precision and Disambiguation \(Examples[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)and[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\):These cases illustrate how lexical precision prevents the “semantic collapse” often seen in dense models\. In Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), our agent distinguishes between a subsidiary studio and its parent brand\. In Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), the agent uses the full, unique school name to isolate a single location, whereas the dense retriever retrieves a different school with a similar name, causing the reasoning to cascade into a geographical error\.
- •Multi\-Hop Evidence Composition \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\):Here, we highlight the agent’s ability to filter retrieval results iteratively\. By searching for a specific band and then filtering for “singer,” the agent isolates the relevant person\. It then effectively parses a “highest \[noun\]” construction, showing that DCI can handle complex, multi\-step queries by treating the corpus as a structured database\.
- •Temporal and Stale Information \(Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\):This highlights the importance of precise record\-keeping\. Our agent retrieves the document explicitly referencing the “current” record holder, while the dense retriever is misled by a document containing stale information about the previous record holder \(CN Tower\)\.
- •Limitations of Ranking and Surface Forms \(Examples[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1),[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), and[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)\):These examples expose the failure modes of DCI\. In Example[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), the lack of ranking forces the agent to rely on file order, burying the correct answer\. In Examples[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1)and[D](https://arxiv.org/html/2605.29307#A4.SS0.SSS0.Px1), we see that if the agent does not guess the exact surface form \(e\.g\., handling diacritics or name variants\), it fails where semantic models would intuitively generalize, underscoring the trade\-off between lexical control and semantic robustness\.
Example 1\.WINHotpotQA – symbolic / rare\-token matchQ:Which component of shellite has the formula \(ON\)CHOH?Gold:picric acidOurs \(grep agent\)✓\[think\]I need to identify the specific component of shellite that corresponds to the formula \(ON\)CHOH\. Since no search has been run yet, I will first query the corpus for "shellite" to locate its definition and list its constituent components\.$ rg \-F "shellite" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"Glossary of British ordnance terms" TNT\. After World War I the term "common lyddite" was dropped, and remaining stocks of lyddite\-filled shells were referred to as HE \(high explosive\) shell filled lyddite\. Hence "common" faded from use, replaced by "HE" as the explosive shell designation\. Com …\[think\]The search results confirm that Shellite is an explosive mixture of picric acid and dinitrophenol \(or hexanitrodiphenylamine\)\. To determine which of these components corresponds to the formula \(ON\)CHOH, I need to search the corpus for this specific chemical notation\.$ rg \-F "\(ON\)CHOH" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"Picric acid" Picric acid Picric acid is an organic compound with the formula \(ON\)CHOH\. Its IUPAC name is 2,4,6\-trinitrophenol \(TNP\)\. The name "picric" comes from the Greek \("pikros"\), meaning "bitter", reflecting its bitter taste\. It is one of the most acidic phenols\. Like other highly …\[think\]The search results confirm that the chemical formula \(ON\)CHOH corresponds to picric acid\. The earlier search established that Shellite is an explosive mixture primarily composed of picric acid and dinitrophenol\. Therefore, the component of shellite with the formula \(ON\)CHOH is picric acid\.answer:picric acidSearch\-R1 \+ Qwen3\-Emb\-4B✗\[think\]The user is asking about the chemical composition of Shellite, specifically which component has the formula \(ON\)CHOH\. Let me search for information about Shellite and its components\.$ search ’Shellite component formula \(ON\)CHOH’↪\\hookrightarrowDoc 1 \(Title: Limpet\) matrix, this can have varying profound effects on the formation of the goethite crystals\. The space in between the crystals and the chitin matrix is filled with an amorphous hydrated silica \(SiO\)\. The most prominent metal by percent composition is iron in the form of goethite\. …\[think\]The search results don’t directly answer the question about Shellite and the formula \(ON\)CHOH\. Let me search more specifically about Shellite and its components\.$ search ’Shellite explosive components formula’↪\\hookrightarrowDoc 1 \(Title: "Shellite \(explosive\)"\) Shellite \(explosive\) Shellite \(known as Tridite in US service\) is an explosive mixture of picric acid and dinitrophenol or picric acid and hexanitrodiphenylamine in a ratio of 70/30\. It was typically used as a filling in Royal Navy armour\-piercing shells during …\[think\]The search results tell me that Shellite is an explosive mixture of picric acid and dinitrophenol or picric acid and hexanitrodiphenylamine in a ratio of 70/30\. However, I need to find which component has the formula \(ON\)CHOH\. Let me search more specifically about the formula \(ON\)CHOH and its relation to Shellite components\.$ search ’\(ON\)CHOH chemical formula compound’↪\\hookrightarrowDoc 1 \(Title: CH3O\) CH3O The molecular formula CHO may refer to: The chemical name for CH3O is methoxide\. It is a base formed from methanol by replacement of the hydroxyl hydrogen with a metal\. A strong base and a good nucleophile\. Methoxide contains one atom of carbon, three atoms of hydrogen and o …\[think\]The search results don’t directly give me the answer about Shellite and the formula \(ON\)CHOH\. Let me search more specifically about dinitrophenol or hexanitrodiphenylamine, which are components of Shellite, to see if either of them matches the formula \(ON\)CHOH\. Actually, looking at the formula \(ON\)CHOH, this looks like it might be referring to a specific compound\. Let me search more specifically about this formula in relation to explosives or Shellite components\.$ search ’Shellite dinitrophenol formula \(ON\)CHOH’↪\\hookrightarrowDoc 1 \(Title: 2,4\-Dinitrophenol\) 2,4\-Dinitrophenol 2,4\-Dinitrophenol \(2,4\-DNP or simply DNP\) is an organic compound with the formula HOCH\(NO\)\. It is a yellow, crystalline solid that has a sweet, musty odor\. It sublimes, is volatile with steam, and is soluble in most organic solvents as well as aqueo …\[think\]Based on the search results, I can see that: 1\. Shellite is a mixture of picric acid and dinitrophenol \(or picric acid and hexanitrodiphenylamine\) 2\. 2,4\-Dinitrophenol has the formula HOCH\(NO\), which can be written as \(ON\)CHOH The formula \(ON\)CHOH matches the formula for 2,4\-Dinitrophenol \(also known as DNP\), which is one of the components of Shellite\. So the answer should be dinitrophenol \(or specifically 2,4\-dinitrophenol\)\.answer:dinitrophenolWhy:The answer is keyed by a literal symbolic string\. Lexical grep matches it exactly; a dense retriever cannot embed a chemical formula and returns chemistry\-shaped but wrong passages\.
Example 2\.WINHotpotQA – entity precision \(subsidiary vs\. parent\)Q:Paul DeBoy is known for an appearance in the Western action\-adventure game developed by which company?Gold:Rockstar San DiegoOurs \(grep agent\)✓\[think\]To answer the question, I first need to identify which Western action\-adventure game Paul DeBoy is known for appearing in\. I will search the Wikipedia corpus for "Paul DeBoy" to find details about his filmography and any specific video game roles\.$ rg \-F "Paul DeBoy" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"PJ DeBoy" PJ DeBoy Paul J\. "PJ" DeBoy \(born June 7, 1971\) is an American actor and talk show host\. DeBoy was born in Baltimore, Maryland\. He shares his name with his cousin, actor Paul DeBoy\. He and Paul are cousins of Delegate Steven J\. DeBoy Sr\. DeBoy started his career in New York, where he pe …\[think\]The search results confirm that Paul DeBoy is best known for his appearance in "Red Dead Redemption" as Jimmy Saint\. The question describes this as a "Western action\-adventure game," which matches the genre of \*Red Dead Redemption\*\. To answer the question, I now need to identify the company that developed this specific game\.$ rg \-F "Red Dead Redemption" corpus\.jsonl \| rg \-i \-F "developed" \| head \-n 8↪\\hookrightarrow"Red Dead" Red Dead Red Dead is a series of Western\-themed action\-adventure video games published by Rockstar Games\. The first entry in the series, "Red Dead Revolver", was released on the PlayStation 2 and Xbox on May 3, 2004\. Originally developed by Capcom, "Red Dead Revolver" borrowed element …\[think\]Based on the search results, Paul DeBoy is known for his appearance in the Western action\-adventure game \*Red Dead Redemption\*, where he played the character Jimmy Saint\. The corpus confirms that \*Red Dead Redemption\* was developed by Rockstar San Diego \(a subsidiary of Rockstar Games\)\.answer:Rockstar San DiegoSearch\-R1 \+ Qwen3\-Emb\-4B✗\[think\]The user is asking about Paul DeBoy and which company developed a Western action\-adventure game that he appeared in\. Let me search for information about Paul DeBoy and his video game appearances\.$ search ’Paul DeBoy video game appearance Western action\-adventure game’↪\\hookrightarrowDoc 1 \(Title: "Paul DeBoy"\) Paul DeBoy Paul DeBoy \(born September 14, 1955 in Baltimore, Maryland\) is an American actor\. He is best known for appearances in "A Dirty Shame" as Wendell Doggett, "Red Dead Redemption" as Jimmy Saint, "Haber" as Bernhard Moritz and for episodes of "Law & Order" and "Law …\[think\]Based on the search results, I can see that Paul DeBoy is known for appearing in "Red Dead Redemption" as Jimmy Saint\. Red Dead Redemption is a Western action\-adventure game\. I need to find out which company developed Red Dead Redemption\. Let me search for more information about Red Dead Redemption’s developer\.$ search ’Red Dead Redemption developer company’↪\\hookrightarrowDoc 1 \(Title: "Red Dead Redemption 2"\) Sadie, and Charles\. Afterward, Sadie and Charles leave for other pursuits\. The final scene shows Pinkerton agents Ross and Fordham observing John’s ranch, initiating the events of "Red Dead Redemption"\. "Red Dead Redemption 2" was developed by Rockstar Studios, …\[think\]Based on my search results, I can see that: 1\. Paul DeBoy appeared in "Red Dead Redemption" as Jimmy Saint \(according to Doc 1\) 2\. Red Dead Redemption is a Western\-themed action\-adventure game 3\. The game was developed by Rockstar San Diego and published by Rockstar Games \(according to Doc 3\) The question asks which company developed the game\. The game was developed by Rockstar San Diego \(a studio of Rockstar Games\)\. The main company is Rockstar Games\. So the answer should be Rockstar Games\.answer:Rockstar GamesWhy:Ours retrieves the precise developing studio; the dense baseline collapses to the better\-known parent brand\.
Example 3\.WINHotpotQA – name\-collision disambiguationQ:What major city is the Faith Lutheran Middle School and High School located by?Gold:Las VegasOurs \(grep agent\)✓\[think\]I need to first identify the specific location of Faith Lutheran Middle School and High School before I can determine which major city it is near\. I will search the corpus for the school’s name to find its entry and extract the location details\.$ rg \-F "Faith Lutheran Middle School and High School" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"Vernon Fox" Vernon Fox Vernon Lee Fox, III \(born October 9, 1979\) is a retired American football safety\. He was signed by the San Diego Chargers as an undrafted free agent after the 2002 NFL Draft\. He played college football at Fresno State\. Fox is currently a professional motivational speaker\. In …\[think\]The search results confirm that Faith Lutheran Middle School and High School is located in Las Vegas, Nevada\. Las Vegas is a major city in the United States, known for being the county seat of Clark County and a global hub for tourism and entertainment\.answer:Las VegasSearch\-R1 \+ Qwen3\-Emb\-4B✗\[think\]The user is asking about the location of Faith Lutheran Middle School and High School\. I need to search for this information to find out which major city this school is located near\. Let me search for information about Faith Lutheran Middle School and High School to find its location\.$ search ’Faith Lutheran Middle School and High School location city’↪\\hookrightarrowDoc 1 \(Title: "Faith Lutheran High School"\) Faith Lutheran High School Faith Lutheran High School, commonly referred to as Faith or FLHS, is a private high school located in Crystal Lake, Illinois\. It is affiliated with the Lutheran Church–Missouri Synod and serves students of McHenry County, Illino …\[think\]The result is Faith Lutheran High School in Crystal Lake, Illinois – but the question names "Faith Lutheran Middle School and High School", and Crystal Lake is not a major city\. The nearest major city would be Chicago\. Let me search again in case a differently named school matches\. \[…\]$ search ’Faith Lutheran Middle School and High School location city Illinois’↪\\hookrightarrowDoc 1 \(Title: "Faith Lutheran High School"\) Faith Lutheran High School Faith Lutheran High School, commonly referred to as Faith or FLHS, is a private high school located in Crystal Lake, Illinois\. It is affiliated with the Lutheran Church–Missouri Synod and serves students of McHenry County, Illino …\[think\]Same result again – Crystal Lake, Illinois\. Since Crystal Lake is not a major city, the nearest one is Chicago\. Let me try once more in case the intended school is elsewhere\. \[…\]$ search ’Faith Lutheran Middle School and High School location Chicago’↪\\hookrightarrowDoc 1 \(Title: "Faith Lutheran High School"\) Faith Lutheran High School Faith Lutheran High School, commonly referred to as Faith or FLHS, is a private high school located in Crystal Lake, Illinois\. It is affiliated with the Lutheran Church–Missouri Synod and serves students of McHenry County, Illino …\[think\]All results return Faith Lutheran High School in Crystal Lake, Illinois, which I take to be the same institution\. Crystal Lake is not a major city, so the question is probably asking for the nearest one; it lies in the Chicago metropolitan area, so the answer would be Chicago\. \[…\]answer:ChicagoWhy:The exact full name pins the right entity in one hop; dense retrieval grabs a same\-named school and the error cascades into a wrong city\.
Example 4\.WINHotpotQA – multi\-hop bridge \+ distinctive phraseQ:The Joggers are a four\-piece band whose lead singer is the son of an American chemist who received the highest what?Gold:Hirsch index ratingOurs \(grep agent\)✓\[think\]I need to identify the lead singer of the band "The Joggers" to determine who the son of an American chemist is\. I will search the corpus for "The Joggers" and filter for mentions of "singer" to quickly locate the relevant biographical details\.$ rg \-F "The Joggers" corpus\.jsonl \| rg \-i \-F "singer" \| head \-n 8↪\\hookrightarrow"George T\. Whitesides" is married to Loretta Hidalgo Whitesides, and they plan to be the first couple to honeymoon in space\. His father is George M\. Whitesides, a professor of chemistry at Harvard University\. His brother is the lead singer of The Joggers, a Portland, Oregon\-based band\. George T\. Whi …\[think\]The search results confirm that Ben Whitesides is the lead singer of The Joggers and the son of George M\. Whitesides, an American chemist\. The question asks for the "highest what" he received, which likely refers to a specific, top\-tier honor or distinction in his field\. Since the snippet mentions he "received the highest Hirsch index rating," this might be a distractor or a specific detail, but the question phrasing "highest \[noun\]" suggests a standard award title like "highest honor" or "highest award\." To find the specific answer, I should search for George M\. Whitesides in the context of awards or honors, filtering for the word "highest" to match the question’s phrasing\.$ rg \-F "George M\. Whitesides" corpus\.jsonl \| rg \-i \-F "highest" \| head \-n 8↪\\hookrightarrowGenzyme Best Companies to Work for”\. The company donated $83 million worth of products worldwide; in 2006, it made $11 million in cash donations\. In 2005, Genzyme was awarded the National Medal of Technology, the highest level of honor awarded by the president of the United States to America’s leadi …\[think\]The question asks for the "highest what" received by the American chemist, George M\. Whitesides, who is the father of The Joggers’ lead singer\. The search results explicitly state that he "received the highest Hirsch index rating of all living chemists in 2011\." While he received many awards, the specific phrasing "highest" in the context of his achievements points directly to this metric\.answer:Hirsch index ratingSearch\-R1 \+ Qwen3\-Emb\-4B✗\[think\]User is asking about a band called "The Joggers"\. I need to find out who the lead singer is, their father’s profession \(specifically that he was an American chemist\), and what the highest award or recognition that chemist received\. Let me search for information about "The Joggers" band and their lead singer\.$ search ’The Joggers band lead singer son of American chemist’↪\\hookrightarrowDoc 1 \(Title: "The Joggers"\) The Joggers The Joggers, formerly known as Stateside, are a four\-piece band from Portland, Oregon\. They play complex songs with elements of math rock which retain a pop sensibility\. The guitar style of \(lead singer and songwriter\) Ben Whitesides and the second guitarist …\[think\]Based on the results, I found that: 1\. The Joggers is a four\-piece band from Portland, Oregon 2\. The lead singer is Ben Whitesides 3\. Ben Whitesides is the son of George M\. Whitesides, who is described as "one of the most decorated and wealthy chemists in the world" Now I need to find out what George M\. Whitesides received \- specifically the "highest" award or recognition\. I need to search for more information about George M\. Whitesides and what prestigious awards he received\.$ search ’George M\. Whitesides highest award American chemist’↪\\hookrightarrowDoc 1 \(Title: "George M\. Whitesides"\) George M\. Whitesides George McClelland Whitesides \(born August 3, 1939\) is an American chemist and professor of chemistry at Harvard University\. He is best known for his work in the areas of NMR spectroscopy, organometallic chemistry, molecular self\-assembly, so …\[think\]Whitesides received many awards\. The Priestley Medal \(2007\) is the "highest honor conferred by the ACS", but the National Medal of Science \(1998\) is generally considered the highest US scientific honor\. Since it asks for the "highest" award, the National Medal of Science seems the best fit; let me confirm\. \[…\]$ search ’George M\. Whitesides National Medal of Science highest award’↪\\hookrightarrowDoc 1 \(Title: "George M\. Whitesides"\) Welch Award in Chemistry \(2005\), the AIC Gold Medal \(2007\), and the Priestley Medal \(2007\), the highest honor conferred by the ACS\. More recently, George Whitesides received the 2009 Dreyfus Prize in the Chemical Sciences from The Camille and Henry …\[think\]The National Medal of Science \(1998\) is the highest scientific honor in the US, awarded by the President, so that is the "highest" award Whitesides received\. The answer is National Medal of Science\.answer:National Medal of ScienceWhy:Both reach the bridge entity \(the father\); ours matches the distinctive “highest \_\_\_” phrasing to the exact fact, while the baseline substitutes a generic award\.
Example 5\.WINBamboogle – current vs\. stale record\-holderQ:In what year was the tallest self\-supporting tower completed?Gold:2012Ours \(grep agent\)✓\[think\]To answer the question, I first need to identify which structure is the tallest self\-supporting tower\. I will search the Wikipedia corpus for the phrase "tallest self\-supporting tower" to locate the relevant entry and confirm the specific structure before proceeding to find its completion date\.$ rg \-F "tallest self\-supporting tower" corpus\.jsonl \| head \-n 8↪\\hookrightarrowTehran and Tehran has been a destination for mass migrations from all over Iran since the 20th century\. Tehran is home to many historical collections, including the royal complexes of Golestan, Sa’dabad, and Niavaran, where the two last dynasties of the former Imperial State of Iran were seated\. Teh …\[think\]The search results confirm that the Tokyo Skytree is currently the tallest self\-supporting tower in the world, while the CN Tower is also noted as the world’s tallest self\-supporting tower in specific contexts\. To answer the question, I need to identify the specific year the tallest such tower was completed\. Since the Tokyo Skytree is explicitly cited as the current tallest, I will search for its completion date to see if it holds the record or if the question refers to a historical milestone\.$ rg \-F "Tokyo Skytree" corpus\.jsonl \| rg \-i \-F "completed" \| head \-n 8↪\\hookrightarrow"Tokyo Skytree" Tokyo Skytree The tower is the primary television and radio broadcast site for the Kantō region; the older Tokyo Tower no longer gives complete digital terrestrial television broadcasting coverage because it is surrounded by high\-rise buildings\. Skytree was completed on Leap Day, 29 …\[think\]The question asks for the year the tallest self\-supporting tower was completed\. Based on the search results, the Tokyo Skytree is currently the tallest self\-supporting tower in the world, and the text explicitly states it was completed on February 29, 2012\. While other towers like the CN Tower were once the tallest, the current record holder’s completion date represents the answer to "the tallest self\-supporting tower" in the present context\.answer:2012Search\-R1 \+ Qwen3\-Emb\-4B✗\[think\]The user is asking about the completion year of the tallest self\-supporting tower in the world\. I need to search for this information to get the most accurate and up\-to\-date data\. Let me search for this information\.$ search ’tallest self\-supporting tower completed year’↪\\hookrightarrowDoc 1 \(Title: "CN Tower"\) The proposed Chicago Spire was expected to exceed the height of the CN Tower, but its construction was halted early due to financial difficulties amid the Great Recession, and was eventually cancelled in 2010\. "Guinness World Records" has called the CN Tower "the world’s ta …\[think\]The search results mention that the CN Tower is recognized by Guinness World Records as the world’s tallest self\-supporting tower\. However, I need to find out when the CN Tower was completed\. The search results don’t explicitly state the completion year of the CN Tower\. Let me search more specifically for the CN Tower completion year\.$ search ’CN Tower completion year’↪\\hookrightarrowDoc 1 \(Title: "CN Tower"\) CN Tower The CN Tower \(\) is a concrete communications and observation tower located in Downtown Toronto, Ontario, Canada\. Built on the former Railway Lands, it was completed in 1976\. Its name "CN" originally referred to Canadian National, the railway company that built the …\[think\]Based on the search results, the CN Tower was completed in 1976\. The CN Tower is recognized by Guinness World Records as the world’s tallest self\-supporting tower\. It held this record for 32 years until 2007 when it was surpassed by the Burj Khalifa \(though the Burj Khalifa is classified as a building, not a tower\)\. However, I should note that the search results mention the CN Tower held the record for the world’s tallest free\-standing structure until 2007\. But the question asks about the tallest self\-supporting tower completion year\. The CN Tower was completed in 1976 and is recognized as the world’s tallest self\-supporting tower \(free\-standing tower\)\. The tower was completed in 1976\. So the answer is 1976\.answer:1976Why:Ours resolves the current record\-holder \(Tokyo Skytree\); the dense baseline anchors on CN Tower’s stale Guinness label\.
Example 6\.FAILUREBamboogle – grep has no relevance rankingQ:Who was president of the United States in the year that Citibank was founded?Gold:james madisonOurs \(grep agent\)✗\[think\]To answer the question, I first need to determine the specific year Citibank was founded\. I will search the corpus for "Citibank" and filter for the word "founded" to locate the relevant historical details\.$ rg \-F "Citibank" corpus\.jsonl \| rg \-i \-F "founded" \| head \-n 8↪\\hookrightarrow"Relativity Media" Relativity Media Relativity Media was an American media company headquartered in Beverly Hills, California, founded in 2004 by Lynwood Spinks and Ryan Kavanaugh\. The studio was the third largest mini\-major globally until bankruptcy on July 30, 2015\. Its full\-scale film studio acqu …\[think\]The previous results did not explicitly state the founding year of Citibank, so I need to search more specifically for the bank’s origin\. Since the question asks for the year it was founded, the answer likely lies in an article describing the bank’s history or a specific event related to its establishment\. I will search for "Citibank" combined with the word "founded" to try and locate the specific date or event mentioned in the corpus\.$ rg \-F "Citibank" corpus\.jsonl \| rg \-i \-F "founded" \| head \-n 8↪\\hookrightarrow"Relativity Media" Relativity Media Relativity Media was an American media company headquartered in Beverly Hills, California, founded in 2004 by Lynwood Spinks and Ryan Kavanaugh\. The studio was the third largest mini\-major globally until bankruptcy on July 30, 2015\. Its full\-scale film studio acqu …\[think\]The previous search results mention that the First National Bank of the City of New York, a forerunner of Citibank, was chartered in 1863, but the specific founding date of the entity known as Citibank requires clarification\. However, historical context and the mention of the 1863 charter strongly suggest the bank’s origins date back to that period\. To ensure I have the correct date and can definitively answer the question, I should search for the specific founding event or the "Citibank" article’s history section to confirm the exact year\. Since the corpus might not have a direct "founded" snippet, I will search for "Citibank" combined with "1863" to see if this date is explicitly linked to the bank’s establishment in the text\.$ rg \-F "Citibank" corpus\.jsonl \| rg \-F "1863" \| head \-n 8↪\\hookrightarrow"George Fisher Baker" Club, having been elected in 1895\. He married Florence Tucker Baker \(daughter of Benjamin Franklin Baker and Sophronia J\. Whitney\) in 1869, and was the father of: In 1863, Baker, along with his mentor, John Thompson, and Thompson’s sons Frederick Ferris Thompson and Samuel C\. T …\[think\]Based on the search results, the First National Bank of the City of New York, which became the forerunner of Citibank, was chartered in 1863\. While the specific entity "Citibank" as a modern name came later, the bank’s origins trace back to this 1863 charter\. To answer the question, I need to identify the U\.S\. President in 1863\. Abraham Lincoln was the President of the United States from 1861 to 1865, covering the year 1863\.answer:Abraham LincolnSearch\-R1 \+ Qwen3\-Emb\-4B✓\[think\]The user is asking about who was president of the United States in the year Citibank was founded\. I need to find out when Citibank was founded first\. Let me search for when Citibank was founded\.$ search ’when was Citibank founded’↪\\hookrightarrowDoc 1 \(Title: Citibank\) Citibank Citibank is the consumer division of financial services multinational Citigroup\. Citibank was founded in 1812 as the "City Bank of New York", and later became "First National City Bank of New York"\. Citibank provides credit cards, mortgages, personal loans, commercia …\[think\]Based on the search results, Citibank was founded in 1812 as the "City Bank of New York"\. Now I need to find out who was president of the United States in 1812\. Let me search for who was president of the United States in 1812\.$ search ’who was president of the United States in 1812’↪\\hookrightarrowDoc 1 \(Title: "1812 United States presidential election"\) 1812 United States presidential election The United States presidential election of 1812, the seventh quadrennial American presidential election, was held from Friday, October 30, 1812 to Wednesday, December 2, 1812\. Taking place in the shado …\[think\]Based on the search results, I can see that: 1\. Citibank was founded in 1812 as the "City Bank of New York" 2\. In 1812, James Madison was the President of the United States The search results clearly state that James Madison was the incumbent Democratic\-Republican President in 1812\. He won the 1812 election and was serving as president during that year\. So the answer is James Madison\.answer:James MadisonWhy:Grep returns matches in file order with no ranking, so the authoritative entity page is buried; dense retrieval ranks it first and the two hops resolve cleanly\.
Example 7\.WINPopQA – exact name beats semantic blurQ:In what city was Walter W\. Arndt born?Gold:Istanbul, İstanbulOurs \(grep agent\)✓\[think\]I need to locate the Wikipedia passage about Walter W\. Arndt to find his birth details\. Since no commands have been run yet, I will start by searching the corpus for his name to identify the relevant article\.$ rg \-F "Walter W\. Arndt" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"Walter W\. Arndt" Walter W\. Arndt Walter Werner Arndt \(May 4, 1916\-February 15, 2011\) was a world\-renowned scholar and translator of Russian, German and Polish\. At the time of his death, he was the Sherman Fairchild Professor of Humanities, Emeritus, of Russian Language and Literature at Dartmouth…\[think\]The search results explicitly state in the second passage that "Arndt was born to German parents in Istanbul, Turkey, in 1916\." This directly answers the question regarding the city of his birth\.answer:IstanbulSearch\-R1 \+ Qwen3\-Emb\-4B✗\[think\]User is asking about the birthplace of Walter W\. Arndt\. I need to search to find where he was born\.$ search ’Walter W\. Arndt birthplace’↪\\hookrightarrowDoc 1 \(Title: "Walter Arndt"\) Walter Arndt Walter \[Walther\] Arndt \(8 January 1891 in Landeshut, Silesia, now Kamienna Góra, Poland – 26 June 1944 in Brandenburg\) was a German zoologist and physician\. Arndst studied medicine and zoology at the University of Breslau\. Even as a student, several compani …\[think\]Based on the search results, I found information about two different people named Walter Arndt: 1\. Walter Arndt \(1891\-1944\) \- A German zoologist and physician, born in Landeshut, Silesia \(now Kamienna Góra, Poland\) 2\. Walter W\. Arndt \(1916\-2011\) \- A scholar and translator, but his birthplace is not mentioned in the search results\. The question asks about "Walter W\. Arndt" specifically, which refers to the second person \(Walter Werner Arndt, 1916\-2011\), the scholar and translator\. However, the search results don’t mention where Walter W\. Arndt was born\. Let me search more specifically for his birthplace\.$ search ’Walter W\. Arndt birthplace’↪\\hookrightarrowDoc 1 \(Title: "Walter Arndt"\) Walter Arndt Walter \[Walther\] Arndt \(8 January 1891 in Landeshut, Silesia, now Kamienna Góra, Poland – 26 June 1944 in Brandenburg\) was a German zoologist and physician\. Arndst studied medicine and zoology at the University of Breslau\. Even as a student, several compani …\[think\]The search results still don’t show the birthplace of Walter W\. Arndt \(1916\-2011\)\. The search results show Walter Arndt \(1891\-1944\) who was born in Landeshut, Silesia, but that’s a different person\. The question asks about Walter W\. Arndt \(1916\-2011\), the scholar and translator\.$ search ’Walter W\. Arndt born city birthplace’↪\\hookrightarrowDoc 1 \(Title: "Walter Arndt"\) Walter Arndt Walter \[Walther\] Arndt \(8 January 1891 in Landeshut, Silesia, now Kamienna Góra, Poland – 26 June 1944 in Brandenburg\) was a German zoologist and physician\. Arndst studied medicine and zoology at the University of Breslau\. Even as a student, several compani …\[think\]The results still don’t show the birthplace of Walter W\. Arndt \(1916\-2011\)\. The first person mentioned \(Walter Arndt, 1891\-1944\) was born in Landeshut, Silesia, but that’s a different person\. The question asks about Walter W\. Arndt \(1916\-2011\)\. Let me try a more specific search to find Walter W\. Arndt’s birthplace\.$ search ’Walter W\. Arndt born 1916 birthplace city’↪\\hookrightarrowDoc 1 \(Title: "Walter Arndt"\) Walter Arndt Walter \[Walther\] Arndt \(8 January 1891 in Landeshut, Silesia, now Kamienna Góra, Poland – 26 June 1944 in Brandenburg\) was a German zoologist and physician\. Arndst studied medicine and zoology at the University of Breslau\. Even as a student, several compani …\[think\]Results still don’t show the birthplace of Walter W\. Arndt \(1916\-2011\)\. Results keep showing the same information about Walter Arndt \(1891\-1944\) who was born in Landeshut, Silesia\. However, based on the information I have, Walter W\. Arndt \(1916\-2011\) was a scholar and translator who worked at Dartmouth College\. He had degrees from multiple universities including Warsaw University, Oxford University, Robert College \(Istanbul\), and UNC Chapel Hill\. Let me try a more specific search to find his birthplace\.$ search ’Walter W\. Arndt born where birthplace’↪\\hookrightarrowDoc 1 \(Title: "Walter Arndt"\) Walter Arndt Walter \[Walther\] Arndt \(8 January 1891 in Landeshut, Silesia, now Kamienna Góra, Poland – 26 June 1944 in Brandenburg\) was a German zoologist and physician\. Arndst studied medicine and zoology at the University of Breslau\. Even as a student, several compani …\[think\]Results are still not showing the birthplace of Walter W\. Arndt \(1916\-2011\)\. The information I have doesn’t mention where Walter W\. Arndt was born\.$ search ’Walter W\. Arndt Dartmouth College biography born’↪\\hookrightarrowDoc 1 \(Title: "Walter W\. Arndt"\) Walter W\. Arndt Walter Werner Arndt \(May 4, 1916\-February 15, 2011\) was a world\-renowned scholar and translator of Russian, German and Polish\. At the time of his death, he was the Sherman Fairchild Professor of Humanities, Emeritus, of Russian Language and Literature …answer:\(no answer\)Why:Exact full\-name match pins the right entity; dense similarity conflates two near\-identically named people, and the agent loops to max\_turns\.
Example 8\.FAILUREPopQA – diacritic / surface\-form brittlenessQ:In what city was Édouard Vaillant born?Gold:VierzonOurs \(grep agent\)✗\[think\]I need to find the birth city of Édouard Vaillant\. I will search the Wikipedia corpus for his entry and filter for the keyword "born" to quickly locate the specific biographical details\.$ rg \-F "Édouard Vaillant" corpus\.jsonl \| rg \-i \-F "born" \| head \-n 8↪\\hookrightarrow\(no results\)\[think\]The previous search for "born" yielded no results, which suggests the corpus might not contain that specific keyword or the entry is structured differently\. Since the question asks for his birth city, the answer is likely located in the main biographical summary of his Wikipedia entry, which typically starts with his full name and birth details\. I will search for "Édouard Vaillant" again to retrieve the full entry and inspect the initial context\.$ rg \-F "Édouard Vaillant" corpus\.jsonl \| head \-n 8↪\\hookrightarrow\(no results\)\[think\]The initial search for "Édouard Vaillant" returned no results, which suggests the corpus may not contain an entry for him or the text is formatted differently\. However, since the question asks for a specific fact, it is likely that the information is present in the corpus under a slightly different context or that the entry exists but was missed by the initial truncation\. Given the nature of such questions, the answer is a specific city, and common knowledge or the likely context of his biography \(a French politician\) points to a major French city\. To ensure I don’t miss the data due to a strict filter, I will re\-run a broader search for his name without the "born" filter to see if the entry exists at all or if the data is structured differently\.$ rg \-F "Edouard Vaillant" corpus\.jsonl \| head \-n 8↪\\hookrightarrow"Jolyon Howorth" This synthesis led to the creation of the only unified socialist party in French history, the Section Française de l’Internationale Ouvrière \(SFIO\)\. The united left lasted only between 1905 and 1920\. Howorth’s first book, "Edouard Vaillant et la création de l’unité socialiste en Fr …\[think\]The previous searches for "Édouard Vaillant" in the corpus did not return a direct biographical entry, but the question implies a specific fact is available\. Since the corpus likely contains the answer in a different context or the entry was not captured by the initial filters, I need to rely on the standard biographical data for Édouard Vaillant, a well\-known French socialist politician\. Historical records confirm that Édouard Vaillant was born in Paris, France, on October 25, 1840\.answer:ParisSearch\-R1 \+ Qwen3\-Emb\-4B✓\[think\]The user is asking about the birthplace of Édouard Vaillant\. Let me search for this information to get accurate information\.$ search ’Édouard Vaillant birthplace’↪\\hookrightarrowDoc 1 \(Title: "Edouard Vaillant"\) Édouard Vaillant Marie Édouard Vaillant \(26 January 1840 – 18 December 1915\) was a French politician\. Born in Vierzon, Cher, son of a lawyer, Édouard Vaillant studied engineering at the École Centrale des Arts et Manufactures, graduating in 1862, and then law at th …\[think\]Based on the search results, I can see that Édouard Vaillant was born in Vierzon, Cher, France\. The search results clearly state: "Born in Vierzon, Cher" So the answer is Vierzon\.answer:VierzonWhy:Grep is brittle to diacritics/surface form; when the page is not lexically reachable the agent falls back to wrong parametric memory\. Dense retrieval is robust to the accent\.
## Appendix EExamples of Generated Synthetic Trajectories
This appendix presents a collection of synthetic trajectories generated through our data construction pipeline for supervising and training the DCI agent\. These examples illustrate how the model learns to maintain coherent multi\-turn reasoning while effectively using shell\-based search operations\. In particular, SFT Example[E](https://arxiv.org/html/2605.29307#A5)shows the agent resolving geographical intersections, while SFT Examples[E](https://arxiv.org/html/2605.29307#A5)and[E](https://arxiv.org/html/2605.29307#A5)demonstrate multi\-hop compositional reasoning and cross\-domain bridging, respectively\. Each trajectory illustrates the step\-by\-step evolution of reasoning as the agent generates shell commands to retrieve supporting evidence\.
SFT Example 1\.multi\-hop intersection \(3 hops\)Q:What country holds both Fetteresso Castle and Cowie Castle?\[think\]I need to identify the country containing both Fetteresso Castle and Cowie Castle\. To start, I will search the corpus for "Fetteresso Castle" to locate any mentions of its geographical setting or associated region\. This initial query should reveal the location of the first castle, which I can then cross\-reference with information about Cowie Castle to determine the shared country\.$ rg \-F "Fetteresso Castle" corpus\.jsonl \| head \-n 3↪\\hookrightarrowCatterline Catterline Catterline is a coastal village on the North Sea in Aberdeenshire, Scotland\. It is situated about south of Stonehaven; nearby to the north are Dunnottar Castle and Fowlsheugh Nature Reserve\. Other noted architectural or historic features …\[think\]The search results confirm that Fetteresso Castle is located in Aberdeenshire, Scotland, and the third result also mentions Cowie Castle as a notable feature near Cowie, which is in Kincardineshire, Scotland\. While this suggests both castles are in Scotland, the mention of Cowie Castle was incidental within an article about the village of Cowie rather than a direct description of the castle itself\. To ensure accuracy and verify the specific location details for Cowie Castle independently, I will search the corpus directly for "Cowie Castle" to see if its entry explicitly confirms the country\.$ rg \-F "Cowie Castle" corpus\.jsonl \| head \-n 3↪\\hookrightarrow"Cowie, Aberdeenshire" Cowie, Aberdeenshire Cowie is an historic fishing village in Kincardineshire, Scotland\. This village has existed since the Middle Ages…\[think\]The search results confirm that Fetteresso Castle is in Aberdeenshire, Scotland, and Cowie Castle is also located in Scotland, specifically near Stonehaven\. While the individual entries establish the country for each castle separately, I have not yet seen a single passage that explicitly mentions both castles together in the same context\. To verify that they share the same country through a direct textual link, I will search for entries containing both "Fetteresso Castle" and "Cowie Castle" simultaneously to find a source that lists them as co\-located features\.$ rg \-F "Fetteresso Castle" corpus\.jsonl \| rg \-F "Cowie Castle" \| head \-n 3↪\\hookrightarrow"Cowie, Aberdeenshire" Cowie, Aberdeenshire Cowie is an historic fishing village in Kincardineshire, Scotland\. This village has existed since the Middle Ages, but in current times it is effectively subsumed into the town of Stonehaven\. William Camden recorded …answer:Scotland
SFT Example 2\.compositional \(2 hop\)Q:Who developed the prototype pacemaker used by the 34th President of the USA?\[think\]To answer this question, I first need to identify the 34th President of the USA\. I will search the corpus for the phrase "34th president" and filter for results that explicitly mention "United States" to ensure I find the correct historical figure\. Once the president is identified, I can proceed to search for details about the pacemaker they used and its developer\.$ rg \-F "34th president" corpus\.jsonl \| rg \-i \-F "United States" \| head \-n 3↪\\hookrightarrow"Bonus Army" later the 34th president of the United States, served as one of MacArthur’s junior aides\. Believing it wrong for the Army’s highest\-ranking officer…\[think\]The search results confirm that Dwight D\. Eisenhower was the 34th President of the United States\. To answer the question, I now need to locate information specifically linking Eisenhower to a pacemaker and identifying the developer of that prototype\. I will search for "Eisenhower" combined with "pacemaker" to find the relevant passage describing the device and its creator\.$ rg \-F "Eisenhower" corpus\.jsonl \| rg \-i \-F "pacemaker" \| head \-n 5↪\\hookrightarrow"R Adams Cowley" being one of the first surgeons to perform open\-heart surgery and invented both a surgical clamp that bears his name and a prototype pacemaker that was used by Dwight D\. Eisenhower …answer:R Adams Cowley
SFT Example 3\.two\-role bridge \(3 hops\)Q:Which actress plays both Iris Carr in The Lady Vanishes, and Riley Blue in Sense8?\[think\]I need to identify the actress who played Iris Carr in \*The Lady Vanishes\* and Riley Blue in \*Sense8\*\. Since the corpus likely contains plot summaries or cast details for these specific productions, I will start by searching for \*The Lady Vanishes\* and filtering for the character name "Iris Carr" to locate the relevant entry\. This approach should surface the specific adaptation and its cast information, which I can then cross\-reference with the \*Sense8\* role\.$ rg \-F "The Lady Vanishes" corpus\.jsonl \| rg \-i \-F "Iris Carr" \| head \-n 3↪\\hookrightarrow"The Lady Vanishes \(2013 film\)" The Lady Vanishes \(2013 film\) The Lady Vanishes is a 2013 British television mystery thriller film directed by Diarmuid Lawrence, and a co\-production of the BBC and Masterpiece Films\. It is based on the novel "The Wheel Spins" …\[think\]The search results confirm that Tuppence Middleton played Iris Carr in the 2013 film adaptation of \*The Lady Vanishes\*\. To determine if she also portrayed Riley Blue in \*Sense8\*, I need to locate cast information for that series\. I will search the corpus for the character name "Riley Blue" and filter for mentions of \*Sense8\* to identify the actress associated with that role\.$ rg \-F "Riley Blue" corpus\.jsonl \| rg \-i \-F "Sense8" \| head \-n 3↪\\hookrightarrow"KK \(musician\)" next recording there and in Iceland\. In 2010 he played with his band at the World Expo in Shanghai, representing Iceland\. KK appeared as supporting character "Gunnar", an Icelandic musician that is the father of Tuppence Middleton’s character …\[think\]The search results confirm that Tuppence Middleton played Iris Carr in the 2013 film \*The Lady Vanishes\* and also portrayed Riley Blue in \*Sense8\*, which appears to answer the question directly\. However, to ensure completeness and rule out other adaptations or actresses, I should verify if there are any other mentions of "Iris Carr" in the corpus that might reference a different production or actress\. I will broaden the search to retrieve all entries containing "Iris Carr" to check for any conflicting or additional information\.$ rg \-F "Iris Carr" corpus\.jsonl \| head \-n 20↪\\hookrightarrow"The Lady Vanishes \(2013 film\)" The Lady Vanishes \(2013 film\) The Lady Vanishes is a 2013 British television mystery thriller film directed by Diarmuid Lawrence, and a co\-production of the BBC and Masterpiece Films\. It is based on the novel "The Wheel Spins" …answer:Tuppence MiddletonSimilar Articles
Is Grep All You Need? How Agent Harnesses Reshape Agentic Search
This empirical study compares grep and vector retrieval strategies in LLM agent workflows, finding that grep generally yields higher accuracy across different agent harnesses and tool-calling styles, with performance heavily dependent on harness choice and context engineering.
A New Role for Relevance: Guiding Corpus Interaction in Agentic Search
This paper introduces the Relevance-Aware RipGrep Search Agent (RARG), which uses relevance as an execution prior for corpus interaction in agentic search, improving accuracy and efficiency over existing methods.
@omarsar0: // Is Grep All You Need? // Pay attention to this on, AI devs. (bookmark it) They find that grep-style text search, whe…
A research paper from PwC finds that grep-style text search, when properly integrated into agent harnesses, can match or beat embedding-based retrieval for coding-agent tasks, suggesting vector databases may not be essential for many use cases.
@jerryjliu0: There’s an open question on whether grep is all you need for agentic search. This recent paper by @PwCUS (Sen et al.) s…
Recent paper investigates whether grep outperforms vector search for agentic retrieval, finding grep yields higher accuracy in conversational memory tests, but limitations around enterprise document corpora are noted.
@tom_doerr: Fully open sources training data for 30B scale search agents https://github.com/PolarSeeker/OpenSeeker…
OpenSeeker fully open-sources training data and models for 30B-scale ReAct-based search agents, achieving state-of-the-art performance on multiple benchmarks including BrowseComp and Humanity's Last Exam. It is the first purely academic project to reach frontier search benchmark performance while releasing complete training data.