Paying for the search every turn

By Prof. Tom Yeh

Published: 2026-08-19

URL: https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget


Library › Context Problems

-

The Context Window

-

Window Occupancy

-

Growth per Turn

-

Remaining Space

-

Turn Budget

-

Retrieval Footprint

-

Retrieval per Turn

-

Search Rounds

-

Window Sizing

-

Truncation

-

Compaction

-

The Compaction Bill

-

Compacted Retrieval

-

The Compaction Threshold

-

Verbatim Tail

-

Stateless API

-

Retrieval Cost

-

Context Tax

-

Quadratic Cost

-

Cost Forecast

An agent that retrieves on every turn pays for the retrieval on every turn. The document does not replace the last one, it joins it: each turn adds its own chunks to the window alongside the question and the answer, so a turn costs far more than the words anyone typed. At two tokens a word, even a short document doubles what a turn costs, and the conversation around it is the smaller part. That is why an agent with retrieval runs out of window in a handful of turns while a plain chat runs for dozens.

Paid members: the worksheet and its printable PDF are below ↓