An independent statistical observatory. Not affiliated with any government agency.Series AIB-1 · The remedy
AI Burn ClockIndex of the cost of retrieval by reading in AI systems
THE REMEDY
Sources refreshed 2026-09-09
Technical note · Press

The remedy: a local index that answers "where" before the agent reads

The cost this index tracks has one cause and one cure. The cause: an AI agent that needs one function or one paragraph finds it by reading, opening whole files into a paid context window until it stumbles on the passage. The cure: an index on the agent's own machine that answers "where is it" first, so the agent reads only the passage. The word for the second habit is retrieval-first.

1How it works

StepReading whole filesRetrieval-first
Findgrep the tree, open candidates, read themask the index; get file, line and symbol back in milliseconds
Readthe whole files, 103–244 KB behind one answer in our measurementthe passage, 5–6 KB
Payfor every byte loaded, every timefor the passage; the index is built once and updated incrementally
Privacyfiles travel to wherever the model runsthe index lives on the machine; with a local model, nothing leaves it

2What was measured

Three ordinary questions on one production Next.js codebase, September 2026: 103,023, 243,640 and 241,859 bytes of whole files behind the answers against 6,405, 6,389 and 5,101 bytes read through the index, a 16×, 38× and 47× difference (Table 2 of the national release). On published coding tasks, retrieval-first reduced output tokens 2.7× end to end at the same solve rate (reference-coding case study). The index uses the conservative 63 % as its avoidable share.

3The implementation measured: XERJ

XERJ is an open-source local search engine for AI agents: one static Rust binary, Elasticsearch-compatible on port 9200, that indexes any folder with one command, returns passages and pointers, keeps agent memory across sessions, and speaks the Model Context Protocol so any agent can call it. Apache-2.0. Source and releases: github.com/xerj-org/xerj. Instructions for an agent: xerj.org/llms.txt.

curl -fsSL https://xerj.org/get | sh
xerj --insecure --data-dir ./.xerj-data &
xerj autoindex .
xerj search "the question you were about to grep"

Four commands, one folder, no cloud key. The installer verifies a SHA-256 checksum before it installs anything.

4Measure your own figure

The xerj-memory plugin for Claude Code adds XERJ as local memory, teaches the agent to retrieve before it reads, and prints a score card at the end of every session: bytes read through the index against the whole files behind them, and an image you can post. Counts only; nothing leaves the machine.

/plugin marketplace add nikolaichuk7/xerj-plugins
/plugin install xerj-memory@xerj-plugins

The offline agent goes one step further: XERJ as memory, an open model served locally as the brain, and a 120-line loop between them. It answers questions about your code with file and line, with the network cable unplugged. That is the configuration a ship, an embassy, a hospital and a classified network need.

5For an office

A pilot fits on one laptop and needs no procurement: install, index a folder of non-sensitive material, ask questions for a week, read the score card. Nothing is sent anywhere. State and agency offices can request a one-page memo with their figures at [email protected].

XERJ on GitHubxerj.orgClaude Code pluginNational release