Quick Start
Memory Components
ConversationHistory
Stores messages with automatic trimming:Memory Manager
TheMemory struct manages conversation storage:
MemoryAdapter Trait
Implement custom storage backends:Configuration
| Option | Type | Default | Description |
|---|---|---|---|
use_short_term | bool | true | Enable short-term memory |
max_messages | usize | 100 | Maximum messages to retain |
Built-in Adapters
| Adapter | Description |
|---|---|
InMemoryAdapter | Default, stores in RAM |
Best Practices
Set appropriate limits
Set appropriate limits
Use
max_messages to prevent unbounded memory growth.Clear when needed
Clear when needed
Call
clear() to start fresh conversations.System messages preserved
System messages preserved
Trimming keeps system messages, removes oldest user/assistant messages first.

