Budgeting a Long Session

By Prof. Tom Yeh

Published: 2026-08-19

URL: https://www.byhand.ai/p/library-agents-context-a-long-conversation


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

One turn's input grows by a fixed step, so the tenth turn sends ten times what the first did. That much is a straight line. But the bill is not the last turn, it is every turn added together, and adding up a straight line gives a curve. That is why doubling the length of a conversation does not double what it costs to run, it roughly quadruples it. The output never joins that curve. It is the same size every turn, so adding it up stays a straight line, and the input half of the bill runs away from it however dearly the output is priced.

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