What is context compaction?

Definition

Artificial intelligence context compaction replaces or reorganizes part of a growing context with a smaller representation. The process may summarize older messages, retain selected constraints and move detailed outputs into referenced artifacts.

Compaction can reduce token cost and latency, but it may also remove important evidence or instructions. Systems should preserve original history, validate the compacted context and apply the intervention only within approved policy boundaries.

Acronyms and aliases

context compression synonymagent context compaction variantAI context compaction variantartificial intelligence context compaction variant

Frequently asked questions

How does context compaction reduce AI agent cost?

It decreases the amount of prior text sent with later model calls, reducing repeated input-token processing.

What is the risk of context compaction?

A poor compaction can omit constraints, evidence or decisions and cause the agent to continue with distorted context.

Videos explaining context compaction

  1. Why Agent Runtimes Need Events and Logs
    AI Engineer20:291 VIEW