Manuscript Offprint
arXiv:2610.29250Let Agents Design How They Search: Automatic Interface Optimization for Agentic Search
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Agentic search depends on the interface through which a language-model agent accesses and explores a corpus. Existing interface designs are fixed by hand and applied unchanged to every corpus, although effective designs may depend on the corpus. We introduce SearchWeaver, a framework for automatic search interface optimization guided by downstream search performance. A proposer uses execution trajectories and task rewards to jointly revise corpus artifacts, executable tools, and usage instructions. This process optimizes what information is prepared in advance, which operations tools perform, and which decisions remain with the search agent. With GPT-5.4-nano, the optimized interfaces improve answer accuracy from 71.6% to 78.4% on BrowseComp-Plus and average nDCG@10 from 45.7 to 55.0 across four BRIGHT subsets over Direct Corpus Interaction. These findings highlight the value of jointly optimizing corpus artifacts, executable tools, and usage instructions to develop effective search interfaces.
1 Introduction
Language-model agents search for evidence by issuing queries, inspecting retrieved information, and deciding what to explore next (Yao et al., 2023; Asai et al., 2024). These decisions depend on the search interface provided to the agent: how documents are organized, which operations are available, and what instructions guide their use. The interface determines what evidence the agent can access at each step and how it can act on that evidence. Designing this interface is therefore central to both the quality and the cost of agentic search.
Existing approaches provide different interfaces for accessing a corpus. Retrieval-augmented generation supplies passages selected by a retriever (Lewis et al., 2020), while Direct Corpus Interaction (DCI) lets agents search and read raw documents with general-purpose terminal tools (Li et al., 2026). More recent approaches combine retrieval with direct exploration: DR-DCI dynamically expands a local workspace with retrieved documents, and RISE constructs a bounded interaction space for the agent (Lu et al., 2026; Zhuang et al., 2026). Each approach makes design choices about which information to expose and which operations the agent can perform. However, these approaches generally specify an interface design in advance and apply it unchanged across corpora, despite the fact that the most effective design depends on corpus size and structure, the types of queries, and the language model used for search.
This raises the question of how to design a search interface for a given corpus and language-model agent. The goal is to determine what corpus information to prepare, which search operations to expose, and how to guide their use so as to improve the agent's downstream search performance. An effective search interface must align the information and operations it provides with how the agent uses them. For example, a title index can help locate documents about a candidate entity, but its usefulness depends on tools that expose those documents and instructions that guide the agent to inspect them and verify the query's clues. These components therefore need to be designed together.
To tackle this, we propose SearchWeaver, a framework that iteratively optimizes search interfaces using feedback from agent search trajectories and task rewards. Specifically, a proposer analyzes failures and bottlenecks in these trajectories to jointly revise which corpus artifacts to prepare, how to structure executable tools, and how to guide the agent in using them. Each revised interface is evaluated on search tasks, producing new trajectories and rewards that guide subsequent revisions. In this way, optimization shapes the division of
Equal contribution; Corresponding author.
work between corpus preparation, tool execution, and agent reasoning.
Experiments with GPT-5.4-nano show that the optimized interfaces improve answer accuracy from 71.6% to 78.4% on BrowseComp-Plus (Chen et al., 2026b) and average nDCG@10 from 45.7 to 55.0 across four BRIGHT (Su et al., 2025) subsets over plain DCI, while reducing mean tool execution time by 42% on BRIGHT. The discovered interfaces use distinct strategies across corpora, including restricting retrieval to a topic directory and combining agent judgments with retrieval rankings. The BRIGHT interfaces also improve search performance and reduce tool execution time when reused by Gemini 3.5 Flash-Lite without re-optimization. These findings support treating the search interface as a reusable corpus resource that can be optimized through agent execution.
2.1 Problem Definition
Given a fixed corpus C and a language-model agent , a search interface comprises the corpus artifacts, executable tools, and usage instructions through which the agent searches for evidence and produces task outputs. It determines which operations are available, what information they return, and how the agent is guided to use them. The interface can thus change the agent's actions and outcomes even when the model and corpus remain the same.
Let denote an admissible search interface design, and let denote the agent's output for query q using that design. Given a set of optimization queries Q, we seek
where R measures task success (answer accuracy or nDCG@10 in our experiments) and the model parameters remain fixed. A single interface is reused across queries, while the agent chooses its actions in response to each query and the evidence it observes. The optimization therefore seeks a reusable way of organizing and guiding search across queries.
2.2 SearchWeaver: Automatic Search Interface Optimization
Search Interface Design. Starting from DCI, in which an agent explores raw documents with terminal tools (Li et al., 2026), SearchWeaver seeks the information and operations that best extend this interface for each corpus. SearchWeaver represents each candidate interface as corpus artifacts, executable tools, and usage instructions; a candidate may also replace the agent's base system prompt and its context-management policy. Artifacts organize corpus information before query execution for reuse across queries; tools expose operations over these artifacts and raw documents; instructions guide the agent in using those operations. Tools can use the supplied BM25 (Robertson and Zaragoza, 2009) and dense (Karpukhin et al., 2020) retrieval resources, restrict exploration to a subset of the corpus, or combine retrieval rankings with the agent's document judgments. Returned documents retain their raw corpus paths for source inspection. These components are designed jointly: a tool that uses agent judgments also requires instructions specifying when to inspect documents and how to pass those judgments to the tool. The search space thus couples corpus preparation with query-time interaction, allowing what is prepared to change with how the agent accesses and uses it.
Trajectory-Guided Revision. To explore this design space, we use a coding-agent proposal–evaluation loop inspired by Meta-Harness (Lee et al., 2026). Whereas prompt optimizers revise text (Khattab et al., 2024; Agrawal et al., 2026) and Meta-Harness revises a model's harness code, SearchWeaver revises the interface the agent is given: corpus artifacts, executable tools, and usage instructions. A proposer inspects the corpus and previous candidates, writes a new interface, and receives feedback from the search agent's execution with that interface. This feedback includes per-query rewards and full execution trajectories containing commands, tool outputs, and final responses. Rewards indicate which queries a candidate handles well or poorly; trajectories show how the agent uses the interface and where its search fails. Gold document identifiers for optimization queries provide additional diagnostic feedback. The proposer uses this evidence to revise artifacts, tools, and instructions, changing what information is exposed, which operations are implemented in tools, and which judgments are requested from the agent.
Evaluation and Selection. Each candidate’s artifacts and tools are prepared over the corpus before the fixed search agent runs on Q. We record the resulting trajectories and per-query rewards and
| Method | BCP | BRIGHT | ||||
|---|---|---|---|---|---|---|
| Bio. | Earth | Econ. | Rob. | Avg. | ||
| DCI | 71.6 | 61.6 | 51.5 | 31.3 | 38.2 | 45.7 |
| Agentic Search (Dense) | 62.6 | 58.2 | 51.4 | 34.6 | 35.7 | 45.0 |
| Agentic Search (BM25) | 47.5 | 48.8 | 41.6 | 30.2 | 35.4 | 39.0 |
| RISE | 65.0 | 34.9 | 29.4 | 17.7 | 21.7 | 25.9 |
| DR-DCI | 73.1 | 54.4 | 43.4 | 31.7 | 39.0 | 42.1 |
| SearchWeaver (Ours) | 78.4 | 74.6 | 64.6 | 38.3 | 42.4 | 55.0 |
Table 1: Main results with GPT-5.4-nano. Accuracy (%) on BCP and nDCG@10 on BRIGHT.
make them available to the proposer for subsequent revisions. Every evaluated candidate contributes this feedback, regardless of whether it improves the current best score. After a fixed number of iterations, we select the candidate with the highest mean reward on Q and evaluate it on test queries, which never enter proposer feedback. We provide the algorithm for SearchWeaver in Appendix A.
3 Experiments
3.1 Experimental Setup
Benchmarks and Metrics. We evaluate Search-Weaver on BrowseComp-Plus (BCP; Chen et al., 2026b) for question answering and BRIGHT (Su et al., 2025) for reasoning-intensive retrieval. On BCP, the agent searches a fixed web corpus to produce a short answer, and we measure answer accuracy judged by GPT-4.1 (OpenAI, 2025). We use 30 queries for interface optimization and 800 for testing. On BRIGHT, the agent returns a ranked list of documents, which we evaluate using nDCG@10 (Järvelin and Kekäläinen, 2002). We use four subsets (Biology, Earth Science, Economics, and Robotics) with 213 optimization and 210 test queries in total.
Baselines. We compare against DCI (Li et al., 2026), which searches raw documents using a shell and file reader. Agentic Search (Dense) and Agentic Search (BM25) iteratively reformulate queries for a search tool returning five document snippets per call (Chen et al., 2026b). The dense variant uses Qwen3-Embedding-8B (Zhang et al., 2025) on BCP and ReasonEmbed-Qwen3-4B (Chen et al., 2026a) on BRIGHT. RISE (Zhuang et al., 2026) retrieves documents into a restricted workspace for shell-based exploration and augments documents with model-generated tables of contents and section anchors. DR-DCI (Lu et al., 2026) lets the agent pull dense-retrieved documents into an initially empty workspace and explore them with shell commands. SearchWeaver uses execution feed-
(a) Optimized Interface
Artifact titles.tsv (normalized title index) king diamond → .../King Diamond - Wikipedia.txt
Tools scout.py (search: dense + BM25) search Q → snippets + ranked titles pages NAME → raw paths via title index locate PATH WORDS → passages within PATH verify NAME → clue pointers for NAME
Instructions. Search the full question; inspect titles; read raw evidence; judge each clue before answering.
(b) Example of Agent Interactions
Q. Band formed in 1970–1990? Founder's clues: organ / flower bands; triple bypass; voice acting.
1 search "<question>"
Rank 56 King Diamond (title list)
2 pages "King Diamond" D1: King Diamond - Wikipedia.txt
3 locate D1 "Brainstorm" → Passages within D1 verify "King Diamond" → Pointers to clue lines Agent judgment: all four clues supported
Organ / flower Brainstorm / Black Rose D1:L23 Surgery Triple bypass D1:L51 Voice acting Metalocalypse D1:L65
4 read D2: Mercyful Fate - Wikipedia.txt Mercyful Fate (formed 1981) D2:L18
Figure 1: The optimized BrowseComp-Plus interface and selected agent interactions on a test query.
back to automatically optimize a DCI agent's corpus artifacts, search tools, and usage instructions.
Implementation Details. Our search agent is implemented using Pi (Zechner, 2026) with GPT-5.4-nano (OpenAI, 2026), following DCI (Li et al., 2026). The proposer uses Claude Code (Anthropic, 2025) with Claude Opus 5.5 (Anthropic, 2026). We optimize an interface for each corpus, starting from the default DCI interface and evaluating one candidate interface per iteration for ten iterations. We provide the proposer with BM25 and Qwen3-Embedding-4B retrieval on BCP, and BM25 and the released ReasonEmbed-Qwen3-8B rankings (Chen et al., 2026a) on BRIGHT. See Appendix B for more implementation details.
3.2 Main Results and Analyses
Search Performance. Table 1 shows that Search-Weaver outperforms all evaluated baselines on both BCP and BRIGHT, including each of the four BRIGHT subsets. Compared with DCI, it improves BCP accuracy from to and average BRIGHT nDCG@10 from 45.7 to 55.0. The relative performance of existing approaches varies across corpora: DR-DCI improves over DCI on

Mean tool time (s)
★ SearchWeaver
DCI
● Agentic Search (Dense)
- Agentic Search (BM25)
▽ RISE
DR-DCI
Figure 2: SearchWeaver is Pareto-optimal among the evaluated methods on both benchmarks.
BCP but falls below it on BRIGHT. In contrast, SearchWeaver improves over DCI on both benchmarks and all four BRIGHT subsets, supporting the value of optimizing interfaces for each corpus.
Discovered Interfaces. We examine the interfaces discovered by optimization for each corpus. These interfaces differ in how they combine retrieval, source inspection, and agent judgments. On BCP, as shown in Figure 1, the generated title index maps candidate names to raw documents, and the tools support hybrid candidate retrieval and targeted evidence lookup. The instructions guide the agent to use these operations to check each clue against source evidence. The agent checks the clues about King Diamond against source lines and then confirms the formation year of Mercyful Fate from its own page. We provide the full trajectory in Appendix F. On BRIGHT, the interfaces target document ranking: Biology restricts retrieval to a topic directory, Earth Science introduces retrieval only when constructing the final ranking, and Economics and Robotics incorporate agent judgments through document ordering and relevance grades, respectively (Appendix G).
Tool Execution Time. Figure 2 shows that SearchWeaver achieves these performance gains while using less tool execution time than DCI. Mean tool execution time per query, which excludes model inference, decreases from 42.4 s to 32.9 s on BCP and from 63.2 s to 36.6 s on BRIGHT, reductions of 22% and 42%, respectively. The reduction holds across all four BRIGHT subsets (Appendix D). These savings are consistent with the more targeted corpus access provided by the optimized interfaces. For example, the Biology interface restricts retrieval to a topic directory, while the BCP interface uses a title index to locate candidate documents and passage retrieval to check specific clues.
| Method | BCP | BRIGHT | ||||
|---|---|---|---|---|---|---|
| Bio. | Earth | Econ. | Rob. | Avg. | ||
| DCI | 71.6 | 61.6 | 51.5 | 31.3 | 38.2 | 45.7 |
| Prompt Optimization | 75.6 | 71.4 | 56.2 | 41.8 | 38.8 | 52.0 |
| SearchWeaver | 78.4 | 74.6 | 64.6 | 38.3 | 42.4 | 55.0 |
| w/o artifacts and tools | 72.5 | 64.9 | 53.1 | 38.8 | 38.0 | 48.7 |
Table 2: Comparison with prompt optimization and ablation of generated artifacts, tools, and their instructions.
| Method | BCP | BRIGHT | |
|---|---|---|---|
| Acc. (%) | nDCG@10 | TT (s) | |
| DCI | 60.9 | 50.7 | 23.1 |
| Agentic Search (Dense) | 53.3 | 46.3 | 33.2 |
| Agentic Search (BM25) | 44.6 | 38.1 | 0.4 |
| RISE | 69.1 | 42.4 | 6.6 |
| DR-DCI | 69.6 | 47.0 | 4.3 |
| SearchWeaver | 73.9 | 58.8 | 15.5 |
Table 3: Search interface transfer to Gemini 3.5 Flash-Lite without re-optimization. TT: mean tool execution time per query.
Does generating artifacts and tools improve search? Table 2 first compares SearchWeaver with Prompt Optimization, which uses the same optimization loop as SearchWeaver but restricts candidates to instructions, excluding artifacts, tools, and retrieval resources. Prompt Optimization improves over DCI on both benchmarks, but SearchWeaver achieves higher BCP accuracy and average BRIGHT nDCG@10, supporting the value of the broader interface design space. We also evaluate the optimized interface after removing the generated artifacts and tools and the instructions for using them, without further optimization. This removal reduces performance on both benchmarks, indicating that the generated artifacts and tools, together with their usage instructions, contribute to the gains.
Do the optimized interfaces transfer across language models? We next test whether the discovered interfaces remain useful with another language model. Table 3 evaluates Gemini 3.5 Flash-Lite (Google DeepMind, 2026) using the interfaces optimized with GPT-5.4-nano, without re-optimization. Compared with DCI, the transferred interfaces improve BCP accuracy and average BRIGHT nDCG@10 while reducing mean tool execution time on BRIGHT. The performance gains hold across all four BRIGHT subsets (Appendix E), suggesting that the optimized interfaces remain useful beyond the model used for optimization.
Limitations
Our experiments evaluate interfaces optimized for fixed corpora. As documents are added or revised, corpus artifacts and the tools that use them may require updates. We do not study when these updates become necessary or whether they can be performed incrementally without repeating the full optimization process. Extending SearchWeaver to evolving corpora would therefore require mechanisms for maintaining corpus artifacts and assessing whether previously optimized interfaces remain effective.
References
Lakshya A. Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J. Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab. 2026. GEPA: Reflective prompt evolution can outperform reinforcement learning. In International Conference on Learning Representations (ICLR).
Anthropic. 2025. Claude Code.
Anthropic. 2026. Introducing Claude Opus 5.5.
Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi. 2024. Self-RAG: Learning to retrieve, generate, and critique through self-reflection. In International Conference on Learning Representations (ICLR).
Jinheon Baek, Soyeong Jeong, Yumin Choi, Dongsu Han, and Sung Ju Hwang. 2026. RunningTab: Direct workspace interaction with environment-side tabs. arXiv preprint arXiv:2610.10444.
Weili Cao, Xunjian Yin, Bhuwan Dhingra, and Shuyan Zhou. 2026. Coding agents are effective long-context processors. arXiv preprint arXiv:2603.20432.
Jianlyu Chen, Junwei Lan, Chaofan Li, Defu Lian, and Zheng Liu. 2026a. ReasonEmbed: Enhanced text embeddings for reasoning-intensive document retrieval. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1203–1221, San Diego, California, United States. Association for Computational Linguistics.
Zijian Chen, Xueguang Ma, Shengyao Zhuang, Ping Nie, Kai Zou, Sahel Sharifymoghaddam, Andrew Liu, Joshua Green, Kshama Patel, Ruoxi Meng, Mingyi Su, Yanxi Li, Haoran Hong, Xinyu Shi, Xuye Liu, Hosna Oyarhoseini, Nandan Thakur, Crystina Zhang, Luyu Gao, and 2 others. 2026b. BrowseComp-Plus: A fair and disentangled evaluation benchmark for deep search agents. In Proceedings of the 64th Annual Meeting of the Association for
Computational Linguistics (Volume 1: Long Papers), pages 22349–22370, San Diego, California, United States. Association for Computational Linguistics.
Yumin Choi, Jinheon Baek, and Sung Ju Hwang. 2025. System prompt optimization with meta-learning. In Neural Information Processing Systems (NeurIPS), volume 38.
Google DeepMind. 2026. Gemini 3.5 Flash-Lite.
Hao-Lun Hsu, Nikki Lijing Kuang, Boyi Liu, Zhewei Yao, and Yuxiong He. 2026a. Organize then retrieve: Hierarchical memory navigation for efficient agents. arXiv preprint arXiv:2606.11680.
Tz-Huan Hsu, Jheng-Hong Yang, and Jimmy Lin. 2026b. Rethinking agentic search with Pi-Serini: Is lexical retrieval sufficient? arXiv preprint arXiv:2605.10848.
Yulong Hui, Chao Chen, Zhihang Fu, Yihao Liu, Jieping Ye, and Huanchen Zhang. 2026. Interact-RAG: Reason and interact with the corpus, beyond black-box retrieval. In International Conference on Learning Representations (ICLR).
Kalervo Järvelin and Jaana Kekäläinen. 2002. Cumulated gain-based evaluation of IR techniques. ACM Transactions on Information Systems, 20(4):422–446.
Bowen Jin, Hansi Zeng, Zhenrui Yue, Jinsung Yoon, Sercan Arik, Dong Wang, Hamed Zamani, and Jiawei Han. 2025. Search-R1: Training LLMs to reason and leverage search engines with reinforcement learning. In Second Conference on Language Modeling (COLM).
Andrej Karpathy. 2026. LLM Wiki. GitHub Gist. Created April 4, 2026.
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769–6781, Online. Association for Computational Linguistics.
Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, Sri Vardhamanan A, Saiful Haq, Ashutosh Sharma, Thomas Joshi, Hanna Moazam, Heather Miller, Matei Zaharia, and Christopher Potts. 2024. DSPy: Compiling declarative language model calls into state-of-the-art pipelines. In International Conference on Learning Representations (ICLR).
Yoonho Lee, Roshen Nair, Qizheng Zhang, Kangwook Lee, Omar Khattab, and Chelsea Finn. 2026. MetaHarness: End-to-end optimization of model harnesses. In Third Conference on Language Modeling (COLM).
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020. Retrieval-augmented generation for knowledge-intensive NLP tasks. In Neural Information Processing Systems (NeurIPS), volume 33, pages 9459–9474. Curran Associates, Inc.
Zhuofeng Li, Haoxiang Zhang, Cong Wei, Pan Lu, Ping Nie, Yuyang Bai, Shangbin Feng, Hangxiao Zhu, Ming Zhong, Yuyu Zhang, Jianwen Xie, Yejin Choi, James Zou, Jiawei Han, Wenhu Chen, Jimmy Lin, Dongfu Jiang, and Yu Zhang. 2026. Beyond semantic similarity: Rethinking retrieval for agentic search via direct corpus interaction. In Neural Information Processing Systems (NeurIPS).
Jimmy Lin, Xueguang Ma, Sheng-Chieh Lin, Jheng-Hong Yang, Ronak Pradeep, and Rodrigo Nogueira. 2021. Pyserini: A Python toolkit for reproducible information retrieval research with sparse and dense representations. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2356–2362.
Yi Lu, Zhuofeng Li, Ping Nie, Haoxiang Zhang, Yuyu Zhang, Kai Zou, Wenhu Chen, Jimmy Lin, Dongfu Jiang, and Yu Zhang. 2026. DR-DCI: Scaling direct corpus interaction via dynamic workspace expansion. arXiv preprint arXiv:2606.14885.
OpenAI. 2025. Introducing GPT-4.1 in the API.
OpenAI. 2026. GPT-5.4 nano.
Stephen E. Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333–389.
Alireza Salemi, Chang Zeng, Atharva Nijasure, Jui-Hui Chung, Razieh Rahimi, Fernando Diaz, and Hamed Zamani. 2026. GrepSeek: Training search agents for direct corpus interaction. arXiv preprint arXiv:2605.29307.
Sahil Sen, Akhil Kasturi, Elias Lumer, Anmol Gulati, and Vamse Kumar Subbiah. 2026. Is Grep all you need? How agent harnesses reshape agentic search. arXiv preprint arXiv:2605.15184.
Hongjin Su, Howard Yen, Mengzhou Xia, Weijia Shi, Niklas Muennighoff, Han-yu Wang, Haisu Liu, Quan Shi, Zachary S. Siegel, Michael Tang, Ruoxi Sun, Jinsung Yoon, Sercan O. Arik, Danqi Chen, and Tao Yu. 2025. BRIGHT: A realistic and challenging benchmark for reasoning-intensive retrieval. In International Conference on Learning Representations (ICLR).
Shreyas Subramanian, Adewale Akinfaderin, Yanyan Zhang, Ishan Singh, Mani Khanuja, Sandeep Singh, and Maira Ladeira Tanke. 2025. Keyword search is all you need: Achieving RAG-level performance
without vector databases using agentic tool use. arXiv preprint arXiv:2602.23368.
Shitao Xiao, Zheng Liu, Peitian Zhang, Niklas Muennighoff, Defu Lian, and Jian-Yun Nie. 2024. C-Pack: Packed resources for general Chinese embeddings. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 641–649.
Zeyu Yang, Xu Han, Qi Ma, Jason Chen, and Anshumali Shrivastava. 2026. Superintelligent retrieval agent: The next frontier of agentic retrieval. arXiv preprint arXiv:2605.06647.
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2023. ReAct: Synergizing reasoning and acting in language models. In International Conference on Learning Representations (ICLR).
Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Pan Lu, Zhi Huang, Carlos Guestrin, and James Zou. 2025. Optimizing generative AI by backpropagating language model feedback. Nature, 639:609–616.
Mario Zechner. 2026. Pi: AI agent toolkit.
Yuqi Zeng, Qixiang Deng, Yulei Wan, Ruiquan Jiang, Xiaoqing Zheng, and Xuanjing Huang. 2026. Rethinking agentic RAG: Toward LLM-driven logical retrieval beyond embeddings. arXiv preprint arXiv:2605.27123.
Yanzhao Zhang, Mingxin Li, Dingkun Long, Xin Zhang, Huan Lin, Baosong Yang, Pengjun Xie, An Yang, Dayiheng Liu, Junyang Lin, Fei Huang, and Jingren Zhou. 2025. Qwen3 Embedding: Advancing text embedding and reranking through foundation models. arXiv preprint arXiv:2506.05176.
Shengyao Zhuang, Yuansheng Ni, Hengxin Fun, Jimmy Lin, and Xueguang Ma. 2026. Towards retrieving interaction spaces for agentic search. arXiv preprint arXiv:2606.06880.
A SearchWeaver Algorithm
Algorithm 1 SearchWeaver: Automatic Search Interface Optimization
Input: Corpus C, queries Q Fixed agent , proposer P Initial interface , iterations K
Output: Optimized interface
r: per-query rewards; T: trajectories
1:
2:
3:
4: for do
5:
6: Build 's artifacts and tools over C
7:
8:
9: if mean( ) > then
10:
11: end if
12: end for
13: return
B Additional Implementation Details
Data and Evaluation. On both BCP and BRIGHT, we use the file-system corpus released with DCI-Agent-Lite (Li et al., 2026), where each document is stored as a text file. For BCP, we use 30 queries for interface optimization and 800 for testing. For BRIGHT, we use 52, 58, 52, and 51 optimization queries and 51, 58, 51, and 50 test queries from Biology, Earth Science, Economics, and Robotics, respectively, totaling 213 optimization and 210 test queries.
Agent Runtime. On both BCP and BRIGHT, the search agent runs GPT-5.4-nano with high reasoning effort and has no web access. Each query is limited to 300 turns and 30 minutes.
Interface Optimization. The proposer runs at high reasoning effort and can inspect the corpus, execute shell commands, and call the supplied retrieval resources. Candidate files must not contain optimization questions, query identifiers, or gold labels; candidates that do are rejected before evaluation. The context-management policy that a candidate may replace decides how earlier tool outputs are truncated or cleared. The files containing test queries and labels are made unreadable during optimization.
Retrieval Resources. On BCP, SearchWeaver uses the official BM25 and Qwen3-Embedding-4B indexes (Chen et al., 2026b) and encodes dense queries at search time. On BRIGHT, BM25 uses the official configuration (Su et al., 2025) and accepts arbitrary queries, whereas the dense resource returns only the released ranking for each original question and does not support new dense queries.
Baseline Configurations. Agentic Search (Dense) uses the official BCP (Chen et al., 2026b) dense-search agent. On BCP, it also has a tool that returns a full document, and it differs from SearchWeaver in both the embedding model and the document index: Agentic Search (Dense) uses Qwen3-Embedding-8B and its corresponding document index, whereas SearchWeaver uses Qwen3-Embedding-4B and its corresponding document index. On BRIGHT, Agentic Search (Dense) has the search tool only and encodes each query at search time against Pyserini's (Lin et al., 2021) prebuilt ReasonEmbed-Qwen3-4B document embeddings. Agentic Search (BM25) uses the official BCP (Chen et al., 2026b) function-calling loop, whose only tool returns BM25 snippets; it has no shell or file reader. On BRIGHT, it uses the same BM25 retriever as SearchWeaver. RISE uses the released harness (Zhuang et al., 2026) with its released settings. It adds BM25 results for each subquery to a workspace, restricts shell-based exploration to that workspace, and uses documents augmented in advance by GPT-5.4-nano with tables of contents and section anchors. DR-DCI uses its released harness (Lu et al., 2026) with the configuration of its main BCP result. On BRIGHT, its pull tool uses the repository's BRIGHT retriever, BGE-large-en-v1.5 (Xiao et al., 2024), over Pyserini's prebuilt indexes.
C Additional Related Work
Agentic Search. Retrieval-augmented generation grounds language models in external documents through sparse or dense retrieval (Lewis et al., 2020; Robertson and Zaragoza, 2009; Karpukhin et al., 2020). Agentic approaches make retrieval part of an iterative reasoning process. Search-R1 learns to interleave reasoning with search-engine calls through reinforcement learning (Jin et al., 2025), while other work explores lexical search, query expansion, and corpus-aware query construction (Subramanian et al., 2025; Hsu et al., 2026b; Yang et al., 2026). Further approaches provide finer control through retrieval actions and logical queries (Hui et al., 2026; Zeng et al., 2026). DCI and GrepSeek extend this control to direct corpus exploration with terminal commands and raw-file reads, with GrepSeek training agents for this interaction mode (Li et al., 2026; Salemi et al., 2026). Our work optimizes the interface through which agents combine direct exploration with retrieval tools.
Search Interface Design. The tools, document organization, and presentation of search results influence how agents discover and use evidence (Sen et al., 2026; Cao et al., 2026). RISE constructs bounded interaction spaces, while DR-DCI uses retrieval to dynamically expand a local workspace (Zhuang et al., 2026; Lu et al., 2026). Beyond selecting which documents to expose, other work organizes information into navigable memory hierarchies, source-derived wikis, and environment-side records of requirements and evidence (Hsu et al., 2026a; Karpathy, 2026; Baek et al., 2026). We optimize corpus-specific combinations of artifacts, tools, and usage instructions using feedback from search trajectories and task rewards.
Automatic Optimization of Agent Systems. Automatic optimization uses task feedback to improve the components surrounding language models, including prompts and multi-stage pipelines (Khattab et al., 2024; Yuksekgonul et al., 2025). Recent methods use natural-language feedback and reflection on execution traces to guide revisions, or meta-learning to produce system prompts that generalize across tasks (Yuksekgonul et al., 2025; Agrawal et al., 2026; Choi et al., 2025). This direction also extends to executable harness code, with coding agents proposing changes based on earlier candidates, scores, and execution traces (Lee et al., 2026). We apply feedback-driven optimization to search interfaces, jointly developing reusable corpus artifacts, executable search tools, and usage instructions for downstream agentic search.
D BRIGHT Tool Time by Subset
Table 4 reports tool time, the total execution time of a query's tool calls, excluding model inference. Aggregate BRIGHT timings are computed over all 210 test queries.
| Subset | Method | Tool time (s) | ||
|---|---|---|---|---|
| Mean | Median | P95 | ||
| Biology | DCI | 62.2 | 37.5 | 250.7 |
| Agentic Search (Dense) | 40.9 | 42.3 | 75.4 | |
| Agentic Search (BM25) | 0.3 | 0.2 | 0.6 | |
| RISE | 1.7 | 1.5 | 5.2 | |
| DR-DCI | 8.0 | 5.5 | 20.8 | |
| SearchWeaver | 12.3 | 9.7 | 28.5 | |
| Earth Science | DCI | 78.8 | 70.1 | 166.7 |
| Agentic Search (Dense) | 40.1 | 35.2 | 109.7 | |
| Agentic Search (BM25) | 0.5 | 0.4 | 1.1 | |
| RISE | 2.2 | 1.3 | 8.6 | |
| DR-DCI | 9.8 | 6.0 | 27.3 | |
| SearchWeaver | 63.5 | 51.4 | 162.5 | |
| Economics | DCI | 43.3 | 28.4 | 144.0 |
| Agentic Search (Dense) | 41.7 | 39.9 | 79.9 | |
| Agentic Search (BM25) | 0.3 | 0.3 | 0.6 | |
| RISE | 1.9 | 1.4 | 6.5 | |
| DR-DCI | 10.1 | 7.5 | 25.5 | |
| SearchWeaver | 26.3 | 20.3 | 73.3 | |
| Robotics | DCI | 66.6 | 46.8 | 214.8 |
| Agentic Search (Dense) | 45.0 | 43.0 | 98.8 | |
| Agentic Search (BM25) | 0.3 | 0.3 | 0.6 | |
| RISE | 1.7 | 1.3 | 4.7 | |
| DR-DCI | 17.2 | 8.7 | 65.8 | |
| SearchWeaver | 40.7 | 38.8 | 100.7 | |
| All | DCI | 63.2 | 47.1 | 166.7 |
| Agentic Search (Dense) | 41.8 | 38.7 | 82.9 | |
| Agentic Search (BM25) | 0.4 | 0.3 | 0.8 | |
| RISE | 1.9 | 1.4 | 6.1 | |
| DR-DCI | 11.2 | 7.1 | 31.8 | |
| SearchWeaver | 36.6 | 25.8 | 103.8 | |
Table 4: BRIGHT tool time per test query by subset (GPT-5.4-nano). P95 is the nearest-rank 95th percentile. Agentic Search (Dense) excludes the time a search waits for other queries' searches on the shared CPU encoder.
| Method | Bio. | Earth | Econ. | Rob. | Avg. |
|---|---|---|---|---|---|
| DCI | 63.1 | 55.7 | 38.5 | 45.6 | 50.7 |
| Agentic Search (Dense) | 57.6 | 56.6 | 36.4 | 34.4 | 46.3 |
| Agentic Search (BM25) | 47.8 | 40.1 | 31.1 | 33.4 | 38.1 |
| RISE | 57.6 | 49.8 | 27.5 | 34.8 | 42.4 |
| DR-DCI | 60.4 | 56.0 | 34.9 | 36.5 | 47.0 |
| SearchWeaver | 75.2 | 66.0 | 45.1 | 48.6 | 58.8 |
Table 5: BRIGHT nDCG@10 by subset with Gemini 3.5 Flash-Lite, using the interfaces optimized with GPT-5.4-nano.
E BRIGHT Transfer Results by Subset
Table 5 reports BRIGHT nDCG@10 by subset for the transfer to Gemini 3.5 Flash-Lite (Table 3).
F BCP Agent Trajectory
Figure 3 presents all 13 tool calls and the final answer for the test query in Figure 1. Outputs and paths are abbreviated for readability.
G Optimized Interfaces on BRIGHT
Figures 4–7 show the interface SearchWeaver selected for each BRIGHT subset: panel (a) summarizes its tools, how its final tool builds the submitted list, and its instructions, and panel (b) traces one test question from the agent’s tool calls to the submitted list, with gold documents highlighted.
The four interfaces share one structure. The agent still searches and reads raw files with the shell, and a final tool builds the submitted list by combining the agent's judgments with the released dense ranking; Earth Science and Robotics also mix into that list BM25 scores computed from text the agent has read or written. The interfaces differ in where retrieval enters and how much weight the agent's judgments receive. Biology confines the search to the question's topic directory and fuses the documents the agent labels with the dense ranking inside that directory. Earth Science searches as plain DCI does and uses retrieval only in the final tool. Economics and Robotics start from dense candidates: Economics keeps the agent's order and fills the remaining places from the dense ranking, while Robotics ranks the documents the agent grades as answering the question first.
Removing the generated artifacts and tools hurts most on Biology and Earth Science, where Search-Weaver gains most. Biology and Earth Science improve over DCI by 13.0 and 13.1 points and lose 9.7 and 11.5 points without the artifacts and tools (Table 2). Economics improves by 7.0 points and does not drop without them (38.8 vs. 38.3), and Prompt Optimization scores highest there (41.8).
Question
As of December 2023, name the band formed between 1970 and 1990, by a musician who: - Was once in a band that had the name of human organ in the title - Was in another band that had the name of a flower in the title - Has had triple bypass surgery - Has done voice acting work
01 search
bash
Input python3 [...] /scout.py search "As of December 2023, name the band formed between 1970 and 1990, by a musician who was once in a band that had the name of human organ in the title, was in another band that had the name of a flower in the title, has had triple bypass surgery, has done voice acting work" -k 10
Output # search #1 mode=hybrid hits=192 (service requests left -98) [...]
ROSTER ranks 11-100 (titles only, free). [...]
[...] 56 en.wikipedia.org/King Diamond [...]
02 pages
bash
Input python3 [...] /scout.py pages "King Diamond" -k 5
Output "King Diamond": en.wikipedia.org/King Diamond - Wikipedia.txt (title; 137 lines) [...] "-k": en.wikipedia.org/K-pop - Wikipedia.txt (title-prefix; 356 lines) [...] "5": www.realartways.org/5.txt (title; 44 lines) [...]
03 read
Input path: [...] /en.wikipedia.org/King Diamond - Wikipedia.txt offset: 1 limit: 200
Output [...] King Diamond's first heavy rock band was called Brainstorm (1974-76) [...] [...] Diamond left Brainstorm and began singing with local Danish hard rock band Black Rose. [...] [...] the musicians would join with Diamond in 1980 to become Mercyful Fate. [...] he needed triple-bypass surgery [...] Diamond was a special celebrity guest star in four episodes of the Warner Bros. adult-oriented cartoon Metallocalypse [...] [...]
04 rg
bash
Input rg -n "Mercyful Fate" "[...] /en.wikipedia.org/King Diamond - Wikipedia.txt" | head
Output [...] 23: [...] the musicians would join with Diamond in 1980 to become Mercyful Fate. [...]
05 rg
bash
Input rg -n "1981" "[...] /en.wikipedia.org/King Diamond - Wikipedia.txt"
Output (no output)
Command exited with code 1
06 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/King Diamond - Wikipedia.txt" "Metallocalypse"
Output [...] L65 [metallocalypse]: ...cial celebrity guest star in four episodes of the Warner Bros. adult-oriented cartoon Metallocalypse as the Blues Devil, Ronald [...] [...]
07 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/King Diamond - Wikipedia.txt" "triple-bypass"
Output [...] L51 [triple-bypass]: ...oking habit. They determined that he had had several heart attacks and that he needed triple-bypass surgery, during which time [...] [...]
08 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/King Diamond - Wikipedia.txt" "Brainstorm"
Output [...] L23 [brainstorm]: King Diamond's first heavy rock band was called Brainstorm (1974-76), with Jeanette Blum (Jean Blue) on vocals and bass, Michael [...] [...]
09 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/King Diamond - Wikipedia.txt" "Black Rose"
Output [...] L23 [black,rose]: ...on drums. Diamond left Brainstorm and began singing with local Danish hard rock band Black Rose. He began experimenting with [...] [...]
10 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/King Diamond - Wikipedia.txt" "1980"
Output [...] L23+300c [1980]: ...er Zone. This band included Timi Hansen, and the musicians would join with Diamond in 1980 to become Mercyful Fate. [...]
11 verify
bash
Input python3 [...] /scout.py verify "King Diamond"
Output # verify "King Diamond" against 1 clues of the question (2 service requests, -96 left)
For each clue YOU decide from the raw lines: SUPPORTED / CONTRADICTED / UNKNOWN. Lines are pointers; open the file (read offset=LINE-5) when a line is decisive.
[...]
- en.wikipedia.org/King Diamond - Wikipedia.txt L51: ...oking habit. They determined that he had had several heart attacks and that he needed triple-bypass surgery, during which time he was medically dead for five hours. The surgery was performed successf [...] SUMMARY "King Diamond": every clue has nearby lines to judge (not yet proof)
12 read
Input path: [...] /en.wikipedia.org/Mercyful Fate - Wikipedia.txt offset: 1 limit: 220
Output [...] Mercyful Fate is a Danish heavy metal band from Copenhagen, formed in 1981 by vocalist King Diamond and guitarist Hank Shermann. [...] Mercyful Fate was originally formed in Copenhagen in the spring of 1981, following the dissolution of the band Brats. [...] [...]
13 locate
bash
Input python3 [...] /scout.py locate "en.wikipedia.org/Mercyful Fate - Wikipedia.txt" "formed in 1981"
Output [...] L18 [formed,1981]: Mercyful Fate is a Danish heavy metal band from Copenhagen, formed in 1981 by vocalist King Diamond and guitarist Hank Shermann. Influenced by progressive rock [...] L28 [formed,1981]: Mercyful Fate was originally formed in Copenhagen in the spring of 1981, following the dissolution of the band Brats. [...] [...]
Final answer
Band (formed between 1970-1990): Mercyful Fate (formed in 1981).
Clue checklist (by the musician King Diamond):
- Formed band between 1970-1990 (1981): SUPPORTED -
en.wikipedia.org/Mercyful Fate - Wikipedia.txt:18 - In a band with a human organ in the title ("Brainstorm" -
"brain"): SUPPORTED -
en.wikipedia.org/King Diamond - Wikipedia.txt:23 - In a band with a flower in the title ("Black Rose"):
SUPPORTED -
en.wikipedia.org/King Diamond - Wikipedia.txt:23 - Has had triple bypass surgery: SUPPORTED -
en.wikipedia.org/King Diamond - Wikipedia.txt:51 - Has done voice acting work (appeared in animated series
Metallocalypse): SUPPORTED -
en.wikipedia.org/King Diamond - Wikipedia.txt:65
Figure 3: Example of a full agent trajectory using the optimized search interface on BrowseComp-Plus. All 13 tool calls and the final answer are shown; outputs are abbreviated.
(a) Optimized Interface (Biology)
Tools scope.sh (search: dense + BM25)
--question Q -- Q's directory, dense-ranked
--bm25 WORDS -- BM25 within it
--final E:... W:... -- final list of 20
Final list. Fuses E documents, the directory's dense ranking, files like the first E, and P/W at half weight. Instructions. Run --question first; label documents E (encyclopedia), P (paper) or W (web); finish with --final.
(b) Example of Agent Interactions
Q. Why can't the immune system detect mutated tumors?
Gold. MHC_0, _3, _4, _8 (one MHC article)
1 --question "<question>"
immune_system_detect_tumor/: 176 ranked docs
2 Labels 10 web pages W, 3 MHC chunks E; first gold at 11.
3 --final W:... (10 pages) E:... (3 MHC)
1 MHC_0 gold
2 MHC_4 gold
3–5 (two web pages, MHC_5_0)
6–7 MHC_8, MHC_3 gold, not passed by the agent
Figure 4: SearchWeaver's optimized interface for BRIGHT Biology. The example in (b) scores 90.6 nDCG@10.
(a) Optimized Interface (Economics)
System prompt. "You are a relevance judge for a document-retrieval task."
Tools rr.py (search: dense + BM25)
start -- dense top 30, opening text
bm25 WORDS -- top 20 for the agent's words
final PATH ... -- the agent's order, unchanged
Final list. The agent's order, topped up from dense.
Instructions. Run start first; your ranking is final.
(b) Example of Agent Interactions
Q. A calculator for constrained optimization?
Gold. Maximizehtml_10 (Wolfram "Maximize" page)
1 start
Rank 5 Maximizehtml_10 (dense)
2 bm25 "Mathematica Maximize symbolic ..."
Rank 1 Maximizehtml_10 (BM25)
3 Agent reads the candidates and orders 20 of them.
4 final Maximizehtml_10 Maximizehtml_11 ...
1 Maximizehtml_10 gold
2–4 Maximizehtml_11, _15, _28
Figure 6: SearchWeaver's optimized interface for BRIGHT Economics. The example in (b) scores 100.0 nDCG@10.
(a) Optimized Interface (Earth Science)
Tools finalize.py (fusion: dense + BM25)
Input. question, explanation citing documents, ranked list. Output. final list of 15.
Final list. Sum of standardized scores: dense ranking, BM25 on question + explanation, BM25 on the 3 top-fused documents' opening text, and the agent's list. Instructions. Search as usual; run finalize.py once; copy its output.
(b) Example of Agent Interactions
Q. Below what height is half the atmosphere's mass?
Gold. 8 chunks of two pages
1 grep -RIn "scale height" . | head
Agent searches and reads as plain DCI does.
2 finalize.py QUESTION: ... EXPLANATION: ...
RANKED DOCUMENTS: ...
In the agent's own list of 5, only rank 1 is gold.
1 Vertical_pressure_variation4 gold
2 atmthick_html2 gold
3 Atmosphere_of_Earth2_49
4–5 (two more gold chunks) gold
Figure 5: SearchWeaver's optimized interface for BRIGHT Earth Science. The example in (b) scores 61.9 nDCG@10.
(a) Optimized Interface (Robotics)
Tools ranker.py (search: dense + BM25)
start -> dense top 30, previews
final S PATH ... -> final list of 20
Grades. S answers; R related; Q restates the problem.
Final list. S first (fused with dense); then R, dense, and BM25 on S texts; Q by the retrievers alone.
Instructions. Run start first; grade each kept document.
(b) Example of Agent Interactions
Q. How to use ros2_control with actual hardware communicating via etherCAT?
Gold. ethercatdriverros2_41, _42
1 start
Rank 1–2 ethercatdriverros2_42, _41 (dense)
2 Agent greps and reads; grades 6 documents S, 2 R.
3 final S ..._42 S ..._41 ... (6 S, 2 R)
1 ethercatdriverros2_42 gold
2 ethercatdriverros2_41 gold
3 20211WRMeetupGetting_2
Figure 7: SearchWeaver's optimized interface for BRIGHT Robotics. The example in (b) scores 100.0 nDCG@10.