Quick Start
User Interaction Flow
InMemoryVectorStore
Fast, in-memory vector storage for development and small knowledge bases.Methods
| Method | Signature | Description |
|---|---|---|
new() | fn new() -> Self | Create empty store |
add(record) | async fn add(&mut self, VectorRecord) -> Result<String> | Add a record |
search(embedding, limit) | async fn search(&self, &[f32], usize) -> Result<Vec<SearchResultItem>> | Search by embedding |
get(id) | async fn get(&self, &str) -> Result<Option<VectorRecord>> | Get by ID |
delete(id) | async fn delete(&mut self, &str) -> Result<bool> | Delete by ID |
Example
FileSessionStore
Persistent file-based storage for session data.Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
session_dir | PathBuf | ~/.praisonai/sessions/ | Storage directory |
max_messages | usize | 100 | Max messages per session |
Methods
| Method | Signature | Description |
|---|---|---|
new() | fn new() -> Self | Default directory |
with_dir(dir) | fn with_dir(impl Into<PathBuf>) -> Self | Custom directory |
max_messages(n) | fn max_messages(self, usize) -> Self | Set limit |
Storage Comparison
| Store | Persistence | Use Case | Performance |
|---|---|---|---|
InMemoryVectorStore | Memory only | Development, testing | ⚡ Fastest |
FileSessionStore | Disk | Production sessions | 💾 Durable |
Best Practices
Use InMemoryVectorStore for development
Use InMemoryVectorStore for development
Fast iteration without database setup. Switch to persistent store for production.
Set message limits for long-running agents
Set message limits for long-running agents
Use
FileSessionStore::new().max_messages(100) to prevent unbounded growth.Index by semantic meaning, not keywords
Index by semantic meaning, not keywords
Vector stores search by embedding similarity - structure your documents for semantic retrieval.

