中文
AI Engineer World's Fair

Measured, not guessed: 90% of your AI coding bill is context that was not relevant. One local search layer cuts 94% of it.

We Cut 94% of AI Coding Tokens With a Local Code Index - Rajkumar Sakthivel, Tesco · Rajkumar Sakthivel

11 min
AI CodingContext

11 min total·Actually worth watching closely: ~2 min·3 must-watch clips

Orange = the 2 minutes worth watchingFor the rest, the guide is enough
Segment guide · 8 segments
  1. 0:00 1:30Listen

    Where the bill really goes: 90% is input

    Breaks down the cost of a single AI coding query: about 45,000 tokens of context sent when only about 5,000 actually mattered — roughly 90% of the cost is files and context that were not relevant, not the code the AI writes back.

    Fix the input: cutting output by 75% saves about 8% total, cutting input by 94% saves about 61%.

    A purely spoken argument about cost structure, nothing critical on screen — just follow the numbers.▶ Jump to 0:00
    Speaker · Rajkumar Sakthivel
  2. 1:30 3:00Listen

    Why prompt tweaks and settings don't help

    Explains why rewriting the prompt or changing max tokens and temperature saves nothing: the model already got the whole context before it read the prompt, so the input cost has already happened.

    Output is only about 10% of the cost, so optimizing on the output side has a very low ceiling.

    A conceptual argument carried by the speaker's reasoning rather than the slides — fine to just listen.▶ Jump to 1:30
    Speaker · Rajkumar Sakthivel
  3. 3:00 5:00Skim

    The fix: a local search layer between your code base and the AI

    The architecture: break code into pieces that make sense — functions, classes, methods — run a meaning search and an exact-word search at the same time and combine them (each alone misses about one in four results, together about one in ten), then shrink the results and track which function calls which.

    Running two searches is the key — any single search method misses about one in four relevant results.

    Architecture walkthrough with a slide diagram; a glance at the five-step flow is enough to follow, no need to study it frame by frame.▶ Jump to 3:00
    Speaker · Rajkumar Sakthivel
  4. 5:00 7:06Listen

    The scoring formula and the simple-beats-complex philosophy

    Relevance is decided by a weighted formula alone — 50% meaning, 30% keyword, 20% recency, with the limit adjusting to the current results — running in 0.4 milliseconds with zero extra AI calls; the same instinct keeps the database small, the model small, and everything local.

    You don't need an AI to judge relevance — a simple weighted formula is enough, and it saves the two or three seconds self-judging costs every time.

    Spoken engineering trade-offs; the formula is simple enough to remember after one hearing.▶ Jump to 5:00
    Speaker · Rajkumar Sakthivel
  5. 7:06 8:20Skim

    FastAPI test: 94% less, 90% accuracy

    53 files, 20 real questions: 83K tokens per question down to about 4.9K, and 523 tokens with the extra compression on top, while still finding the right code about 90% of the time. The test is public and reproducible.

    The 94% token cut did not come at the cost of accuracy — the hardest evidence in the talk.

    Results are shown as a chart (visualMoment 426s); skimming the number table is enough to get the point.▶ Jump to 7:06
    Speaker · Rajkumar Sakthivel
  6. 8:20 9:29Listen

    Honest limits: when this stops working

    Admits the 94% is a worst-case comparison against reading full files every time — tools like Claude Code are already smarter than that, so real savings are lower — and that on a mixed 396-file product code base recall dropped almost to zero.

    It works when each file does one thing; big mixed code bases where files do many things break it.

    A spoken admission about where the approach applies — the key to judging whether it fits your project, so listen closely.▶ Jump to 8:20
    Speaker · Rajkumar Sakthivel
  7. 9:29 10:25Skim

    The real bill, and a shared index across tools

    Shows the saving report from a real project — 247 queries, 12.4 million tokens saved, nearly $186 not spent, 84% from the search layer — and proposes one shared index plus memory across tools, so the code base only has to be explained to the AI once.

    Models may be only 30% of the cost; the other 70% is what you feed them — fix the input before talking about switching models.

    The saving report on screen (visualMoment 569s) is worth a glance to check where the numbers come from; the rest is fine to just listen to.▶ Jump to 9:29
    Speaker · Rajkumar Sakthivel
  8. 10:25 10:41Skim

    How to try it: the CCE open source tool

    Closes with the action: one command, CCE, free and open source — run it on your own project for a week and see your real saving number.

    You can verify the conclusion yourself instead of taking the speaker's numbers on faith.

    The command and the tool entry point are on screen (visualMoment 625s) — a glance to note the name is enough.▶ Jump to 10:25
    Speaker · Rajkumar Sakthivel