EventsCompactionConfig

data class EventsCompactionConfig(val compactionInterval: Int? = null, val overlapSize: Int? = null, val summarizer: EventSummarizer? = null, val tokenThreshold: Int? = null, val eventRetentionSize: Int? = null)

Configuration for event compaction.

Constructors

Link copied to clipboard
constructor(compactionInterval: Int? = null, overlapSize: Int? = null, summarizer: EventSummarizer? = null, tokenThreshold: Int? = null, eventRetentionSize: Int? = null)

Types

Link copied to clipboard
class Builder

Fluent builder for EventsCompactionConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The number of new user-initiated invocations that, once fully represented in the session's events, will trigger a sliding-window compaction. Must be strictly positive when set.

Link copied to clipboard

The number of most recent events kept raw (un-compacted) when token-threshold compaction fires; the older events are summarized into a single event. Must be non-negative when set, and must be set together with tokenThreshold.

Link copied to clipboard

The number of preceding invocations to include from the end of the last compacted range when forming the next sliding-window compaction window. Creates an overlap between consecutive summaries for context continuity. Must be non-negative when set.

Link copied to clipboard

The EventSummarizer used to produce the compaction summary. When null, the runner defaults it to an LlmEventSummarizer backed by the root agent's model, requiring the root to be an LlmAgent (otherwise it throws at construction).

Link copied to clipboard

The most recent prompt token count that triggers intra-invocation token-threshold (tail-retention) compaction before an LLM call. Must be strictly positive when set, and must be set together with eventRetentionSize.

Functions

Link copied to clipboard

Returns true when sliding-window compaction is fully configured.

Link copied to clipboard

Returns true when token-threshold compaction is fully configured.