Search papers, labs, and topics across Lattice.
This paper introduces VITAL-RAG, a novel approach for context allocation in coding agents that addresses the redundancy problem in conventional retrieval-augmented generation (RAG) methods. By organizing evidence based on canonical code objects and selectively retaining only relevant fragments, VITAL-RAG significantly improves retrieval efficiency and task performance. The method achieves a Recall@4K increase from 39.59% to 63.67% on RepoBench while simultaneously reducing evidence tokens by 35.63%, outperforming recent baselines across multiple model backends.
VITAL-RAG boosts code retrieval efficiency by over 60% while slashing token usage, reshaping how coding agents manage context.
Coding agents often retrieve code from an entire repository, but only limited evidence can fit into the final model input. Conventional retrieval-augmented generation (RAG) for coding agents treats fragments from the same code object as separate results, so redundant views can occupy multiple context positions and crowd out useful code. Grouping fragments by code object reduces this redundancy, but can discard local information needed for the task. We describe this tension as an invariance race: allocation should stay stable under redundant renderings but change when a fragment adds task-relevant semantics. To address this race, we introduce VITAL-RAG, which organizes evidence by canonical code object, keeps one query-relevant companion only when it adds semantics not already represented, and renders selected evidence under per-object and global token budgets. On RepoBench, VITALRAG improves Recall@4K from 39.59% to 63.67% while reducing evidence tokens by 35.63%. Across three model backends, it matches or outperforms recent baselines on RepoClassBench and achieves the highest raw Pass@1 on RepoExec.