Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
Agent Builder

AI agent glossary

Compaction

Summarizing the older parts of a long agent conversation so the work can continue without overflowing the context window.

Long agent sessions accumulate a lot of text: tool results, file contents, failed attempts. Eventually the conversation approaches the context window limit, and quality can drop well before that point as important details get buried.

Compaction replaces the older history with a condensed summary that keeps the essentials, such as the goal, decisions made, files changed, and open problems, and discards the rest. The agent then continues from that summary with plenty of room to work.

Compaction is lossy by nature. Details the summary leaves out are gone. Agents that run for a long time often pair it with notes written to files, so critical facts survive no matter what gets summarized.

Learn more in the course

Related terms

Go from definitions to doing

Learn to use and build AI agents in 65 practical lessons.