Skip to main content

Module summarization

Module summarization 

Source
Expand description

Pure prompt-building, compaction helpers, and async LLM summarization for context.

Stateless functions take only Message slices and configuration values; they contain no agent state access. The SummarizationDeps struct provides explicit LLM dependencies for the async summarization functions, avoiding coupling to Agent<C>.

The orchestration layer (Agent::compact_context, Agent::maybe_compact, etc.) lives in zeph-core and calls these helpers.

Structs§

SummarizationDeps
Explicit LLM dependencies for async summarization, avoiding coupling to Agent<C>.

Functions§

build_anchored_summary_prompt
Build a structured JSON summarization prompt for AnchoredSummary output.
build_chunk_prompt
Build a prose summarization prompt from a message slice and optional guidelines.
build_metadata_summary
Build a last-resort metadata summary without calling the LLM.
build_tool_pair_summary_prompt
Build a summarization prompt for a single tool-call pair.
extract_overflow_ref
Extract the overflow UUID from a tool output body, if present.
remove_tool_responses_middle_out
Remove a fraction of tool-response messages from a conversation using a middle-out strategy.
single_pass_summary
Single-pass LLM summarization over a message slice.
summarize_structured
Attempt structured summarization via chat_typed_erased::<AnchoredSummary>().
summarize_with_llm
Chunked multi-pass LLM summarization with bounded concurrency.