Large language models (LLMs) are constrained by a limited context window, which dictates the amount of input they can process at one time. This limitation is inherent to the transformer architecture used by LLMs. For coding agents like Pi, the input includes all previous messages and tool calls, which continuously expands as a user interacts with the agent.
In an interactive coding agent session, each request to the LLM includes a system prompt, loaded files, tool definitions, and the entire conversation history. As the conversation progresses, this history grows. Eventually, the accumulated context can exceed the LLM's context window, leading to an error indicating that the request size is too large.
When context overflow occurs, there are two primary options: starting a new, empty conversation, which discards all previous history, or creating a smaller representation of the existing conversation context. The latter approach is known as compaction. Compaction allows the conversation to continue by condensing the context, preserving prior decisions and unresolved work, which is crucial for maintaining continuity in a coding session.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
This article explains how compaction works in large language model (LLM) coding agents such as Pi to manage the limited context window of LLMs. Compaction allows the conversation history to be condensed, preventing context overflow and enabling continuous interaction without losing prior context.