Skip to main content

Module summarizer

Module summarizer 

Source
Expand description

Summarizer trait and supporting types.

The summarizer is the seam between the memory subsystem and whichever LLM client a deployment uses to synthesize end-of-session summaries, daily rollups, and rule-week rollups. The trait is intentionally tiny — given a list of chunks plus an optional pre-prompt the caller wants to inject (e.g. “session summary”, “daily rollup for 2026-05-23”), produce a short string synthesis. The provider is responsible for writing the resulting MemoryChunk and linking its constituents in memory_summary_members; the summarizer itself only generates text.

Production implementations live in the cel-summarizer crate: AnthropicSummarizer (cloud) and OllamaSummarizer (local).

Object-safe: stored as Arc<dyn Summarizer> everywhere.

§Test support

MockSummarizer returns a fixed canned string for every call and records the chunks it received for assertion. It’s a pub helper (no feature gate) so downstream tests can wire it directly, in the same shape as crate::ClosureHook for crate::MemoryWriteHook.

Structs§

MockSummarizer
Test double for Summarizer. Returns a fixed canned response and records the chunks it received for assertion. Exposed unconditionally so downstream integration tests can use it without a circular dev-dep, matching crate::ClosureHook’s shape for write hooks.
MockSummaryCall
One recorded invocation of MockSummarizer::summarize.
SummaryContext
Context the caller can pass alongside the chunks to bias the prompt the summarizer assembles.

Enums§

SummarizerError
Errors produced by a Summarizer.

Traits§

Summarizer
The summarizer trait. Object-safe.

Type Aliases§

SummarizerResult
Result alias for summarizer operations.