EventsCompactionConfig
Configuration for event compaction.
Constructors
Types
Fluent builder for EventsCompactionConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.
Properties
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.
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.
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.
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).
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.