arXiv:2606.22417cs.AI2026-06被引 2

为编码代理设计结构化代码库索引,提升定位与解决效率。

Code Isn't Memory: A Structural Codebase Index Inside a Coding Agent

  • 引入结构化代码库索引,优化代码定位与问题求解路径。
  • 相比无索引版本,定位效率显著提升,求解成功率更高,成本更低。
  • 适合需跨文件修改的复杂任务场景,部署无额外成本负担。

当前编码代理通过大模型与工作仓库检索的交互来执行任务,但不同实现差异较大。在固定编码代理框架与固定模型(Claude Opus 4.7)下,我们对比了含结构化代码库索引、不含索引及基于agentic-grep的基准方案,在SWE-PolyBench Verified与SWE-bench Pro数据集上进行三轮种子实验,所有测试均在防泄露的每任务沙盒中完成。结果显示,同一框架内加入索引带来显著定位提升与统计显著的求解成功率提升,且单步成本无增加,整体求解成本更低;跨框架对比表明,该索引在定位与求解上不劣于agentic-grep基准,同样无成本劣势。我们开源了逐单元排除清单、防泄露审计脚本、定位提取器与结果数据库。因此,结构化代码库索引的部署问题并非成本过高,而在于任务是否涉及多文件变更,此时结构化排序才具优势。

原文摘要 · Abstract (English)

Coding agents now interleave LLMs with retrieval over the working repository, and retrieval implementations vary widely across deployed harnesses. Inside a fixed coding-agent harness on a fixed model, does adding a structural codebase index actually change cost or resolve? We ran three arms (the harness with the index, the same harness without it, and an agentic-grep comparator) on SWE-PolyBench Verified and SWE-bench Pro with Claude Opus 4.7 held fixed throughout, across three seeds, inside a leak-audited per-task sandbox. The within-harness ablation produces a large localization gain and a statistically separated resolve gain, with no cost penalty per cell and lower cost per solve. The cross-harness check shows that the index does not regress against an agentic-grep baseline on resolve or localization, again at no cost penalty. We release the per-cell exclusion ledger, the leak-audit script, the localization extractor, and the results database. The deployment question for a structural codebase index is thus not whether it is too expensive to run (across seeds, the index lands at a lower $/solved than agentic grep) but whether the workload includes multi-file changes where structural ranking pays off.

编码代理代码检索结构索引效率优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。