Skip to main content

Module compact

Module compact 

Source
Expand description

LLM-driven context compaction.

When the transcript grows large, Compactor::compact asks the model to summarize the older portion into a single system message, preserving key decisions, paths, and outcomes. The agent then continues with the summary plus recent messages, staying within the context window.

Compaction is disabled by default (threshold = usize::MAX). Enable it via AgentBuilder::compactor(...).

Structsยง

Compactor
Configuration for LLM-driven transcript compaction.