A summary instead of raw chunks

By Prof. Tom Yeh

Published: 2026-08-19

URL: https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document


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

A retrieved document arrives as raw chunks, and most of what they hold is not what the question needed. Compacting them before they enter the window means the agent reads a summary of the document instead of the document. Only the retrieval is compressed. The system prompt, the question, and the answer are what they were.

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