Context compaction
Automatically summarising an AI agent's earlier work so it can keep going past the limit of what it can hold in mind at once.
Every model has a context window, which is the amount of text it can keep in mind at one time. An agent working on a long job will eventually fill it up, and the naive result is that the session simply ends. Compaction is the fix: the system condenses everything so far into a shorter summary, throws away the raw detail, and carries on with the summary in place of the original.
That is why agent sessions can run for hours or days rather than minutes. It is also where a lot of the cost of agents sits, since you pay for the context you carry, and a good compaction technique cuts the bill as well as extending the session. The trade is what gets lost in the summary: compress too aggressively and the agent forgets a detail it needed, which is why this is an active research area rather than a solved problem.