Google's developer blog on agent context cost, and a measured host-side fix: 169x fewer tokens a step (Gemini 3.8 Flash) A developer named Rajnish Choubey built AXI, a host-side layer that sits between a model and the state it edits, proposing one change per step, validating it against rules, and rebuilding a short prompt from host-held state instead of resending chat history. On a 1,500-request service-graph job with Gemini 3.8 Flash, AXI averaged 2,824 prompt tokens per step versus 476,835 with the full chat kept (169 times fewer), cut median time to first token from 9.13 s to 2.27 s, and held exact state on 1,500 of 1,500 steps versus failing after turn 286. A separate 4,000-step run showed the host-held state exact on all 4,000 steps while the model's own replies were exactly right on 3,954, with a fixed repair rule completing the remaining 46. In December 2025 the Google Developers Blog described what happens in production agent systems: cost and time to first token climb as the context grows, stale context hurts the model, and a bigger window does not remove the problem Hangfei Lin, "Architecting efficient context-aware multi-agent framework for production" https://developers.googleblog.com/architecting-efficient-context-aware-multi-agent-framework-for-production/ . A developer on the Google developer forums describes a session growing from about 2K to over 80K tokens in five turns, with latency, drift and cost following ADK thread, September 2026 https://discuss.google.dev/t/best-practices-for-handling-context-compaction-and-token-blowup-in-recursive-adk-agent-tool-loops/396215 . The Gemini caching documentation explains the cost saving that implicit caching passes on; it gives no latency figure Context caching https://ai.google.dev/gemini-api/docs/caching . All of these are about a conversation that carries its own history. We measured the other way: do not carry it. AXI, by Rajnish Choubey , is a layer on the host side, between a model and the state it edits. The model is unchanged. At every step it proposes one change; the host checks the proposal against the rules, completes what the rules can complete, commits it all or not at all, and shows the model the exact state again in a short prompt rebuilt from what the host holds. Nothing is kept in the chat. One long, heavy job on Gemini 3.8 Flash: a service graph edited request by request, 1,500 requests, each with about 40 lines of routine operations log. Once with the whole chat kept and sent again at every turn until it reached the model's window: 457 turns, 949,591 tokens , once with AXI. | | Chat kept | AXI | |---|---|---| | Prompt tokens per step | 476,835 on average | 2,824, flat for all 1,500 steps 169 times fewer | | Tokens sent in all | 217.5 million in 457 turns | 4.6 million in 1,500 steps | | First token, median | 9.13 s once the prompt passes 500,000 tokens | 2.27 s, flat 2.15 to 2.35 s in every tenth | | Seconds a step | 7.13 on average | 3.07 | | State if each reply is applied as it comes | exact until turn 286, wrong on every turn after | exact on 1,500 of 1,500 steps | | Exact steps an hour | 488 | 1,157 | On a second job, a 400-turn conversation in plain, ambiguous sentences, the same model sent 39.9 million tokens with the chat kept and 0.53 million with AXI 76 times fewer . Once the prompt passed 150,000 tokens the kept chat's first token took a median 5.57 s with 97.0 percent of its prompt served from the cache; AXI's stayed at 2.41 s. And a different question, on the same model: 4,000 consecutive steps of a dense job with strict rules. The state the host held was exactly the intended state on 4,000 of 4,000 steps. The model's own replies were exactly right on 3,954; on the other 46 it had left out a service's dependants when asked to delete the service and an edge, and the fixed repair rule completed them. Applied as written, those replies would each have left edges pointing at a deleted service. On the first 400 requests the replies applied as written left the right state on 85 steps, and a step with the right state cost 4.5 times as much. No key, no model, no GPU: git clone https://github.com/gaurshalendra2412/axi-runtime cd axi-runtime/python python3 quickstart replay.py It replays the saved real replies of the 4,000-step run through the repository's own code and recomputes the held state at every step; it stops with an error if one replayed step differs from the saved one. Prefer a browser: there is a one-click Colab notebook https://colab.research.google.com/github/gaurshalendra2412/axi-runtime/blob/main/python/colab/axi try it.ipynb . With your own Gemini key a free one is enough python3 live check.py runs the same harness live for 15 steps. These are one job and one run of each arm on one model, and every claim is about the state the host holds, not about the model in general or anyone's servers. A reply that is readable, inside the request's scope and wrong is applied; the gate and the repair keep what is true and cut what is false. This is not affiliated with Google. Other groups build commit boundaries around agent state with their own settings and evaluations: Cordon https://arxiv.org/abs/2606.17573 and MemTX https://arxiv.org/abs/2607.23929 . The repository's related-work page says the idea of a commit boundary is not ours to claim. Tests built and run by Shalendra Gaur, with an AI coding assistant as a tool disclosed in the README .