Conversation memory with demotion, compaction, and active window management.
This crate provides:
- [
ConversationMemory]: trait for loading/appending/clearing conversation messages - [
DemotionHook]: trait for demoting old messages to long-term storage - [
Compactor]: trait for summarizing old messages into a compact form - [
ActiveWindow]: manages the short-term context window with policy-based trimming - [
MemoryPolicy]: 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)