Glossary · Term

compaction

← all terms

Definition

Plain language

Summarizing an AI agent's history and starting fresh to free up context space.

As stated in the literature

A technique for managing finite context windows in long-running agents by summarizing prior interactions and replacing the raw history with a condensed version.

Why it matters: Without compaction, long-running agents eventually drown in their own history; with it, what they choose to forget shapes everything that follows.

For example, after fifty turns of a coding session, the agent replaces its log with a one-paragraph summary of decisions made and continues from there.

Heard on the show

“And summarizing-and-starting-fresh — what people call compaction — loses crucial detail and the agent drifts.”
Episode 027 — When AI Agents Build the Serving Stack: A Bet on Bespoke Infrastructure

Related terms