How a knowledge graph cuts the tokens a code review costs
Ask an AI to review a change and the naive approach is to feed it files. More context, more files, more tokens. On a large change that bill grows fast, and most of what you paid for is noise the model did not need.
There is a cheaper path, and it comes from treating the codebase as a graph instead of a pile of text.
Structure beats scanning
A codebase has structure: functions call functions, modules import modules, a route maps to a handler. Capture that as a typed graph, where nodes are symbols and edges are relationships like calls and imports, and a question that used to mean “read everything and hope” becomes a traversal.
To review a diff, you do not need the whole repository. You need the symbols the diff changes and their immediate neighborhood: who calls the changed function, what it depends on, which decisions constrain it. That is a small connected subgraph, not a directory.
Why this is both cheaper and better
- Fewer tokens. You send the relevant subgraph and a few snippets, not whole files. The prompt shrinks by an order of magnitude on the changes that used to cost the most.
- Better catches. Because the graph knows who calls a changed signature, the review can flag callers the diff did not touch, the cross-file impact a file-by-file read misses.
- Grounded, not guessed. Retrieval follows real edges, so the model reasons over facts about the code rather than fuzzy text matches.
Where SourceAnt is taking this
The same graph that makes review cheaper also grounds context memory: decisions attach to the symbols they govern, and an assistant retrieves the decision by traversing to it, not by searching prose. One structure, two payoffs: sharper reviews and a memory that does not blow your token budget.
This is the direction SourceAnt Cloud is built around. The graph is the quiet engine under the context, the review quality, and the token savings.
Give your AI a memory it can trust
Self-host free, or start SourceAnt Cloud at $25 a month per team.