How Compaction Works in Pi
Summary
An in-depth look at how compaction manages long conversations in Pi and other coding agents. It explains context windows in LLMs, how compaction replaces older history with a summarized representation, and Pi's triggers and prompts. The article also covers token budgets, prompt caching implications, and how to test custom compaction extensions.