Skip to main content

Module compaction

Module compaction 

Source
Expand description

Conversation compaction — keep the working context small enough to fit.

Two levels of compaction are provided:

The runtime applies both during turns started by AgentRuntime.

Re-exports§

pub use history_summary::HistoryCompactionStrategy;
pub use history_summary::SummaryHistoryCompaction;
pub use message_truncation::ContentCompressor;
pub use message_truncation::MessageTruncationConfig;
pub use message_truncation::MessageTruncationResult;
pub use message_truncation::TruncationCompressor;
pub use message_truncation::truncate_message;

Modules§

history_summary
History-level compaction: summarises old messages to keep token usage under budget.
message_truncation
Message-level truncation: cap oversized text, thinking, and tool-result fields.