Software engineering

27% lower AI cost on a large codebase

Engineers and their coding assistants answer code questions from a shared map of services, at a lower AI cost per question, with spend visible per person.

Measured over
The first 2 months
Book a 30-minute call
27%lower model cost per question on the main product repository
8assistant turns per question, down from 13
<10 minto set up the graph and the gateway on a new repository
100%of AI spend traced to a person or a service, each with a budget

What changed for the business

Engineers and their assistants start every cross-service change from the same map of services, interfaces and callers, and the team sees what it spends on AI per person.

What it means for the team

  • Model cost per question is 27% lower on the main product repository.
  • Engineers get the services and callers behind a change in one question, instead of searching 3 repositories.
  • Spend per person is visible for the first time, and it changed which models the team chose within the first month.
Before and after, measured
MeasureBeforeAfterHow we measured
Model cost per questionBaseline27% lowerBilled cost from real sessions on the same questions, with and without the graph.
Assistant turns per question13.27.8Counted from the session records of the same runs.
Setup on a new repositoryGathered by an engineer for each taskUnder 10 minutesTimed from install to a passing health check.
AI spend traced to a person or serviceKeys on laptops, spend unknown100%, each with a budgetGateway records: every request carries its own key.

Cost and turns measured on a fixed set of questions in real assistant sessions during the first 2 months.

One structural question, with and without the code graph2 rows of circles. Without the graph: 13 turns, 12 file reads and then the answer. With the graph: 8 turns, 2 graph queries, 5 reads and the answer. Below, 2 bars show cost per question indexed to 100 without the graph and 73 with it. A note says the figures come from the same questions run in real sessions, with and without the graph.One structural question, 2 waysWithout the graph13 turnsWith the graph8 turnsFile search or readGraph queryAnswerCost per questionindexed, without = 10010073Same questions, real sessions, with and without the graph.
Where the 27% saving comes from

2 graph queries replace most of the file reads, so the question is answered in 8 turns instead of 13 and the billed cost is 27% lower on the main repository.

How it worked before

Cross-service changes needed context from several repositories. Engineers were copying that context together from each repository and reconstructing dependencies during review.

How it worked before

  • A change across 3 services meant opening 3 repositories, finding the interfaces and callers, and pasting it all into the assistant.
  • The assistant then searched the same files again, so a structural question took about 13 turns on the main repository.
  • Nobody could say what the team spent on models per person, because provider keys sat on laptops.

What we built

A code graph gives engineers and their assistants the services, interfaces and callers behind a change in one query, and a gateway puts every model request on a key with a budget.

  1. 01

    Retrieve relevant services and interfaces for a task.

  2. 02

    Inspect dependencies before planning a cross-service change.

  3. 03

    Use the dependency map to identify areas that need testing.

  4. 04

    Prepare release notes from the changes for engineer review.

How we built it

  1. 01

    Indexed each repository into a local code graph of definitions, calls and dependencies, refreshed by a hook after every change.

  2. 02

    Exposed the graph to the assistants as a tool, so a question about callers or dependencies is answered from the index instead of a search across files.

  3. 03

    Put every model request behind one gateway. Each engineer and each service has its own key with a budget, and provider keys stay off laptops.

  4. 04

    Added a console that shows spend per person, team and model, and which sessions used the graph.

  5. 05

    Wrote a benchmark: a fixed set of questions run through real assistant sessions with and without the graph, recording billed cost and turns.

Questions about this project

What context do engineers and assistants retrieve?

Services, interfaces, callers and dependencies from the code graph. An assistant pulls the ones a task needs in one query, so nobody pastes files from several repositories into a prompt.

How long does setup take on our repository?

Under 10 minutes for the graph and the gateway on a new repository. We then run your team's own questions with and without the graph, so the saving is measured on your code before anyone relies on it.

How should a team evaluate the cost of code-context retrieval?

Run the same questions with and without the graph in real sessions and compare billed cost, turns and rework. Keep model choice and pricing fixed across the comparison. We run the same benchmark on your repository first.

See what a code graph would save on your repositories

Bring your repositories and the AI tools your engineers use to a 30-minute call. We'll show how we would run the same benchmark on your code before anyone relies on it.

Ask your AI assistant about us

Open our summary in the assistant you use, or copy the prompt.

Read the prompt