Skip to main content

Module summarizer

Module summarizer 

Source
Expand description

Conversation summarizer trait and built-in implementations.

The AUTO_SUMMARY_TAG constant in Message defines the single source of truth for identifying auto-generated summary messages.

§Trait

Summarizer is an async trait with two methods:

  • should_summarize — synchronous check on the current history.
  • summarize — async, may perform an API call; mutates history in-place.

§Built-in implementations

TypeStrategy
LlmSummarizerCalls DeepSeek to produce a semantic summary; default for DeepseekAgent.
SlidingWindowSummarizerKeeps the last N messages and silently drops the rest; no API call.

Structs§

LlmSummarizer
Summarizes older conversation turns by asking DeepSeek to write a concise prose summary, then replaces the compressed turns with a single Role::System message containing that summary.
SlidingWindowSummarizer
Keeps only the most recent window messages and silently discards everything older. No API call is made.

Traits§

Summarizer
Decides when and how to compress conversation history.