Quick Start
1
Create a Session
2
Load Existing Session
3
Use Session with Store
How It Works
Session Methods
Configuration
Common Patterns
Multi-User Application
Best Practices
Use meaningful session IDs
Use meaningful session IDs
Include user ID or context in session IDs for easy management.
Handle load failures
Handle load failures
Use
unwrap_or_else to create new sessions if loading fails.Limit message history
Limit message history
Sessions auto-trim to max_messages to prevent unbounded growth.
Related
Memory
In-memory conversation
Agent
Agent configuration

