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
| Type | Strategy |
|---|---|
LlmSummarizer | Calls DeepSeek to produce a semantic summary; default for DeepseekAgent. |
SlidingWindowSummarizer | Keeps 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::Systemmessage containing that summary. - Sliding
Window Summarizer - Keeps only the most recent
windowmessages and silently discards everything older. No API call is made.
Traits§
- Summarizer
- Decides when and how to compress conversation history.