Repository Intelligence Graph: Deterministic Architectural Map for LLM Code Assistants
Tsvi Cherny-Shahar, Amiram Yehudai
TL;DR
The paper introduces the Repository Intelligence Graph (RIG) and SPADE, a deterministic extractor that constructs a build/test-centered architectural map of a software repository. RIG represents components, aggregators, runners, tests, external packages, and package managers, with explicit dependency and coverage edges backed by concrete evidence, and is exposed to LLM agents as a precomputed JSON view. Across eight repositories, including the multilingual MetaFFI, providing RIG in the agent context improves mean accuracy by $12.2\%$ and reduces completion time by $53.9\%$, with larger gains in multilingual and higher-complexity projects. The work demonstrates that a deterministic, architecture-level view of build/test structure can substantially accelerate repository understanding tasks for diverse agents, while acknowledging limitations and outlining directions for broader extraction, incremental updates, and integration with richer code-level analyses.
Abstract
Repository aware coding agents often struggle to recover build and test structure, especially in multilingual projects where cross language dependencies are encoded across heterogeneous build systems and tooling. We introduce the Repository Intelligence Graph (RIG), a deterministic, evidence backed architectural map that represents buildable components, aggregators, runners, tests, external packages, and package managers, connected by explicit dependency and coverage edges that trace back to concrete build and test definitions. We also present SPADE, a deterministic extractor that constructs RIG from build and test artifacts (currently with an automatic CMake plugin based on the CMake File API and CTest metadata), and exposes RIG as an LLM friendly JSON view that agents can treat as the authoritative description of repository structure. We evaluate three commercial agents (Claude Code, Cursor, Codex) on eight repositories spanning low to high build oriented complexity, including the real world MetaFFI project. Each agent answers thirty structured questions per repository with and without RIG in context, and we measure accuracy, wall clock completion time, and efficiency (seconds per correct answer). Across repositories and agents, providing RIG improves mean accuracy by 12.2\% and reduces completion time by 53.9\%, yielding a mean 57.8\% reduction in seconds per correct answer. Gains are larger in multilingual repositories, which improve by 17.7\% in accuracy and 69.5\% in efficiency on average, compared to 6.6\% and 46.1\% in single language repositories. Qualitative analysis suggests that RIG shifts failures from structural misunderstandings toward reasoning mistakes over a correct structure, while rare regressions highlight that graph based reasoning quality remains a key factor.
