Repository navigation
Compaction or a held-state loop for jobs that edit a state step by step? #8367
Replies: 1 comment
|
Adding what other groups have measured since I posted, in case it helps frame the two questions. Question 2 (do compaction summaries keep exact values over hundreds of steps?): the nearest outside measurement I found is Mittal, How Fast Do Agents Rot? (arXiv 2609.01660): nine models and four synthetic task families, one of them tracking account balances through a series of operations. On the tool-use task most models are near-perfect at 2 hops and score 0.00 to 0.33 at 16. Bounding the context window made the decay steeper, not shallower (logit slope -0.69 against -0.44), and the author warns that naive truncation of context is likely to backfire. That paper does not test ADK's compaction; it is the closest number I have. Anthropic's post on context engineering (29 Sep 2025) describes the same split from the other side: compaction for the conversation, and notes kept in memory outside the context window for what has to survive. In ADK terms that is question 1: can session state, not event history, be what a model call is built from? On the host-held side, the same kind of job ran 80,000 steps on a 7B model with the held state exactly right on 80,000 of 80,000 (Test 43), and on Gemini 3.8 Flash a 1,500-step job ran at 2,824 prompt tokens a step against 476,835 a turn for the kept chat (test page). The papers and these tests sit side by side, with what each shows, here: THIRD_PARTY_EVIDENCE.md. Write-up: The best agent finishes 20.6% of long workflows. I'm on Rajnish Choubey's team; the architecture is his, and I run the tests with an AI assistant as a tool. I'm not affiliated with Google. |
Uh oh!
There was an error while loading. Please reload this page.
The ADK docs describe context compaction as summarizing older session history, by token threshold or by sliding window, to cut latency and cost. A question about one kind of job: an agent that edits a structured state (a schedule, an inventory, a config) one change per step, where later steps need exact values from earlier ones.
For that shape we tried not keeping the history at all. The host holds the state as data, the model proposes one change per step in a small strict format, a deterministic check admits or refuses it, and each prompt is rebuilt from the held state. It is a layer on the host side, for whoever runs the model; the model is unchanged, and it applies from the first step, short jobs and long. Gemini 3.8 Flash, direct API, not through ADK: 400 turns, 99,809 prompt tokens a turn with the chat kept against 1,177 with the held state; 1,500 steps, 1,500 of 1,500 states exact at about 2,824 prompt tokens a step.
At Gemini 3.8 Flash's own rates, one verified step of the 400-turn job cost $0.0014 with the held state, $0.0148 with the chat kept and the cache warm (worked out at the cached-token price) and $0.0870 with the chat kept and the cache cold. The total for the held-state and cold-chat runs together came within 1.3 percent of Google's billing report for that day: https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/BILLING_CHECK.md
Two questions for people who run ADK agents:
Tests and saved results: https://github.com/gaurshalendra2412/axi-runtime
I'm on Rajnish Choubey's team; the architecture is his, and I run the tests with an AI assistant as a tool. I'm not affiliated with Google.
All reactions