Table of Contents
Fetching ...

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.

Repository Intelligence Graph: Deterministic Architectural Map for LLM Code Assistants

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 and reduces completion time by , 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.
Paper Structure (70 sections, 2 equations, 5 figures, 6 tables)

This paper contains 70 sections, 2 equations, 5 figures, 6 tables.

Figures (5)

  • Figure 1: Agent-level mean time versus mean score (averaged across repositories). Circles are NORIG and triangles are RIG, arrows show the NORIG$\rightarrow$RIG shift for each agent. Diagonal lines indicate constant seconds-per-point (efficiency).
  • Figure 2: Accuracy improvement with RIG as a function of repository complexity. Each point corresponds to one agent on one repository, and the dashed line is a linear trend fitted across all points.
  • Figure 3: Time reduction with RIG as a function of repository complexity. Each point is one agent-repository pair, the dashed line is a linear trend fitted across all points.
  • Figure 4: Accuracy improvements with RIG by question difficulty (easy, medium, hard), aggregated across all repositories and agents.
  • Figure 5: Agent level relative score improvements with RIG across repositories. Cells show relative score improvements (%) for each agent and repository pair.