AI & Software Engineering
CodeNib brings multi-view indexing to AI coding agents for faster, cheaper repository searches
A new system unifies lexical, dense, and structural code views to let AI agents find context more efficiently without sacrificing accuracy.
Coding agents are growing smarter at tackling software engineering tasks, yet they still struggle when searching and navigating large codebases. The systems that feed them repository information—whether incremental indexes, live language servers, or code databases—were never built with agent workloads in mind, often returning stale or inaccurate results at high computational cost.
The Problem with Fragmented Views#
Today's approach fragments code understanding across multiple systems. Localization agents rebuild indexes for each task, tool servers query live language servers on demand, and code-intelligence platforms serve human developers rather than algorithmic workloads. None of these systems measure how well precomputed answers actually perform compared to authoritative sources, leaving agents blind to whether they're using correct information.
An arXiv paper from researchers working on agent infrastructure introduces CodeNib, a system that unifies three different views of a codebase—lexical (string-based), dense (vector-based), and structural (graph-based)—behind a single interface and measurement framework.
How CodeNib Works#
The key innovation is serving all three views from one commit snapshot, each backed by a source-address contract that makes it possible to verify answers against each other and against authoritative rebuilds or live servers. This transparency reveals where precomputed shortcuts work and where they fail.
Early results challenge conventional wisdom:
- Execution status ≠ correctness: Symbol-level repairs complete on every held-out change but reproduce correct behavior in only 13 of 24 cases, suggesting completion alone is misleading.
- Vector reuse holds up: Dense embeddings match ground truth on 27 of 30 held-out changes, enabling a 40× speedup while staying accurate.
- Static definitions stay current: Structural definitions align with live language servers on 86% of requests at a 1.2-second ready time.
Real-World Impact#
When integrated with LocAgent, a sample coding agent, CodeNib's unified views improved task completion from 65 to 78 runs out of 90—while cutting token costs by 50–87% across five different language models compared to simpler grep-and-read baselines.
On a harder benchmark, CodeNib's candidate ranking proved most effective: when agents receive CodeNib's ranked candidates and stop exploring after their first read, they resolve 79 of 200 SWE-bench Verified tasks, outpacing on-demand exploration (66 tasks) and Aider's standard repository map approach (56 tasks).