← Table of Contents · Page 225 of 868
COMPACTION AND SUMMARIZATION
Part 9 of 10
CHAPTER SUMMARY
Compaction summarizes older history to reclaim space, accepting some information loss in exchange for room to keep working.
A token-threshold trigger starts compaction automatically at a chosen fraction of the window, early enough that the worst plausible next step still fits.
The usual strategy keeps recent messages in full and replaces older ones with a structured summary.
A good summary preserves the goal, decisions, findings, dead ends, open problems, exact identifiers, and current state, and an audit list of what was dropped helps catch mistakes.
Active and autonomous compression lets agents write their own running notes or prune stale results, and works best with safeguards such as stored originals.
KEY TERMS REVIEW
Compaction: summarizing older history to reclaim space in the window.
Lossy: losing some information in the process of shrinking.
Token-threshold trigger: a rule that starts compaction when the context reaches a set fraction of the window.
Dead end: an approach that was tried and failed.
Scratchpad: a file where an agent writes its own running notes.
Handoff note: a note written at the end of one session to start the next.
Advertisement
Read Aloud:
0:00 / 0:00