Expand description
Conversation memory with demotion, compaction, and active window management.
This crate provides:
ConversationMemory: trait for loading/appending/clearing conversation messagesDemotionHook: trait for demoting old messages to long-term storageCompactor: trait for summarizing old messages into a compact formActiveWindow: manages the short-term context window with policy-based trimmingMemoryPolicy: configures window size, token budget, and retention rules
§Lifecycle
New message → ActiveWindow::push()
→ if over token limit → trim()
→ DemotionHook::demote() (save to long-term storage)
→ Compactor::compact() (summarize and inject back)Structs§
- Active
Window - Manages the short-term active window of conversation messages.
- InMemory
Conversation Memory - Simple in-memory implementation of
ConversationMemory. - Memory
Policy - Policy controlling active window management.
Enums§
- Memory
Event - Events produced by memory operations for audit and observability.
Traits§
- Compactor
- Compacts old messages into a summary.
- Conversation
Memory - Manages conversation messages for a session.
- Demotion
Hook - Hook for demoting old messages to long-term storage.