エージェント検索ベンチ:コーディングエージェントのためのリポジトリコンテキスト検索の評価
Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agents
July 27, 2026
著者: Bowen Qin, Yi Xie
cs.AI
要旨
現代のコーディングエージェントは、最終的に正しいパッチを生成するかどうかで評価されることが一般的である。しかし、パッチ生成は、それ以前のコンテキスト獲得段階、すなわちタスクに必要なリポジトリファイルを見つけることに依存している。本稿では、この上流の検索問題に対するファイルレベルのベンチマークとして、Agent Retrieval Benchを提案する。サンプルは実際のコーディングワークフローからのシグナルに基づいて構築され、凍結されたベースコミットのリポジトリに対して評価される。その関連性は、直接的なクエリとファイルの意味的類似性ではなく、エージェントが次に必要とするものによって定義される。本ベンチマークは、コード2テスト、コメント2コンテキスト、トレース2コード、編集2波及の4つの正の検索タスクをカバーし、第5のサブセットでは、自然な証拠に基づく非ゴールケースと反実仮想の誤リポジトリ対照を用いた選択的検索を評価する。Agent Retrieval Benchは、25のリポジトリにわたる427サンプル(正例345、自然な非ゴール例50、反実仮想対照32)を含む。コーパスは、308のベースコミットスナップショット、392,000ファイル、790万チャンクから構成される。我々は、字句検索、RepoMap、オープンソースの埋め込み、選択的棄却、および記録されたエージェントのコンテキスト選択を評価する。単一の検索ファミリーが支配的であることはない。Qwen3-Embedding-4Bは正サンプルにおけるサンプル重み付けMRRで最良、Qwen3-Embedding-8BはRecall@20で最良、RepoMapは8Kトークンにおける予算制約下のコンテキスト収率で最良であり、タスクごとの勝者は大きく異なる。反実仮想対照を用いて調整された選択的閾値は、自然な非ゴールケースに対する選択的成功を改善せず、キャリブレーションギャップを明らかにした。記録された軌跡も、サンプルの27~35%で全てのゴールファイルを見逃している。制御されたシード介入パイロット実験では、検索によって得られた初期コンテキストは、ランダムな非ゴールコンテキストよりも、シード後の探索が少なく、ファイルF1が高いことが示された。一方、オラクルのゴールコンテキストには、依然として大きな改善余地がある。
English
Modern coding agents are usually evaluated by whether they eventually produce a correct patch, but patch generation depends on an earlier context-acquisition stage: finding the repository files needed for the task. We introduce Agent Retrieval Bench, a file-level benchmark for this upstream retrieval problem. Samples are built from real coding-workflow signals and evaluated against frozen base-commit repositories, with relevance defined by what an agent needs next rather than direct query-file semantic similarity. The benchmark covers four positive-retrieval tasks: code2test, comment2context, trace2code, and edit2ripple; a fifth subset evaluates selective retrieval using natural evidence-backed no-gold cases and counterfactual wrong-repository controls. Agent Retrieval Bench contains 427 samples across 25 repositories: 345 positive examples, 50 natural no-gold examples, and 32 counterfactual controls. The corpus includes 308 base-commit snapshots, 392,000 files, and 7.9 million chunks. We evaluate lexical retrieval, RepoMap, open-source embeddings, selective abstention, and logged agent context selection. No single retrieval family dominates: Qwen3-Embedding-4B has the best sample-weighted MRR on positive samples, Qwen3-Embedding-8B the best Recall@20, and RepoMap the best budgeted context yield at 8K tokens, with task-level winners differing substantially. Selective thresholds calibrated with counterfactual controls do not improve selective success on natural no-gold cases, revealing a calibration gap. Logged trajectories also miss every gold file on 27-35 percent of samples. A controlled seed-intervention pilot finds that retrieval-derived initial context yields higher file F1 with less post-seed exploration than random non-gold context, while oracle gold context shows substantial remaining headroom.