Skip to main content

Module compaction

Module compaction 

Source
Expand description

Context compaction for long conversations

This module provides functionality to compact conversation history when it becomes too large, using the LLM itself to summarize older messages.

Structs§

CompactedContext
Result of context compaction
CompactionConfig
Compaction configuration for LLM-based compaction
CompactionManager
Context manager that handles compaction automatically
CompactionMetadata
Metadata about a compaction operation
LlmCompactor
LLM-based compactor that uses the model itself to summarize
NoopContextTransformer
A no-op transformer that returns the context unchanged.

Enums§

CompactionError
Error type for compaction operations
CompactionStrategy
Compaction strategy determining when to compact

Traits§

Compactor
Trait for context compaction implementations
ContextTransformer
Context transformer — applied before provider stream call.

Functions§

generate_branch_summary
Generate a concise summary of the last N conversation messages.

Type Aliases§

FrameBag
Rendered snapcompact PNG frames: (frame_index, png_bytes).