Expand description
Session persistence layer
Provides pluggable session storage via the SessionStore trait.
§Default Implementation
FileSessionStore stores each session as a JSON file:
- Session metadata (id, name, timestamps)
- Configuration (system prompt, policies)
- Conversation history (messages)
- Context usage statistics
§Custom Backends
Implement SessionStore trait for custom backends (Redis, PostgreSQL, etc.):
ⓘ
use a3s_code::store::{SessionStore, SessionData};
struct RedisStore { /* ... */ }
#[async_trait::async_trait]
impl SessionStore for RedisStore {
async fn save(&self, session: &SessionData) -> Result<()> { /* ... */ }
async fn load(&self, id: &str) -> Result<Option<SessionData>> { /* ... */ }
async fn delete(&self, id: &str) -> Result<()> { /* ... */ }
async fn list(&self) -> Result<Vec<String>> { /* ... */ }
async fn exists(&self, id: &str) -> Result<bool> { /* ... */ }
}Structs§
- File
Session Store - File-based session store
- LlmConfig
Data - Serializable LLM configuration
- Memory
Session Store - In-memory session store for testing
- Session
Data - Serializable session data for persistence
Traits§
- Session
Store - Session storage trait