Context and role
| Context | Independent research · 2025 |
|---|---|
| Role | Sole author. |
| Category | Independent research |
The problem
Repository-level code generation is limited by context. Agents that explore with shell commands spend most of their token budget on files and lines that never influence the answer.
Throwing the whole repository into the context is expensive and often worse, because the relevant signal is diluted.
The useful question is not "how do we retrieve more code" but "what is the smallest subgraph that still contains the answer".
Approach
- Represented the repository as a code knowledge graph.
- Formalised the retrieval problem as finding a minimal, maximally informative subgraph for the generation task.
- Applied a Variational Graph Information Bottleneck (VGIB) to select that subgraph.
- Validated the hypothesis that repository-level code generation improves when the model receives the selected subgraph rather than raw repository context.
What I did not claim
The boundary of a project is part of its evidence. These are the claims this work does not support.
- The repository is private. There is no public benchmark leaderboard entry.
- This is research, not a shipped developer product.
- No claim of production deployment or user numbers.
- The finding is a research result, not a guarantee that every agent will improve by the same amount.
Results
- Formalised and validated the minimal sufficient retrieval hypothesis for repository-level code generation.
- Built an implementation using a code knowledge graph and VGIB subgraph selection.
- The method targets the 60% to 80% token-budget waste caused by blind navigation in agents such as SWE-agent and Cursor.
- The private repository can be walked through on request.
Stack
What this means for you
The useful part of this project is not the artifact. It is the method: define the measurement first, keep the scope honest, and hand over something your team can run. That method is what transfers to a new problem.
If your situation looks similar, the related services below are the place to start. If it does not, send a short description and I will tell you whether I am the right person.
Page last updated: October 2026