Available on crate feature
sqlite only.Expand description
SQLite persistent Store (FTS5 full-text search + optional vector search)
Production-grade persistent storage, based on SQLite + FTS5 full-text search engine, with optional vector similarity retrieval integration.
§Storage structure
| Table | Purpose |
|---|---|
store_items | KV main table (namespace, key, value, timestamps) |
store_fts | FTS5 full-text index (auto-synced) |
store_vectors | Vector table (optional, stores embedding vectors) |
§Quick start
use echo_core::error::Result;
use echo_state::memory::store::Store;
use echo_state::memory::SqliteStore;
use std::sync::Arc;
// Basic usage: FTS5 full-text search
let store = Arc::new(SqliteStore::new("~/.echo-agent/memory.db")?);
store.put(&["alice", "memories"], "pref-001", serde_json::json!({
"content": "User prefers dark theme",
"importance": 8
})).await?;
// FTS5 full-text search
let items = store.search(&["alice", "memories"], "dark theme", 5).await?;
// With hybrid search (requires Embedder)
use echo_state::memory::{Embedder, HttpEmbedder};
let embedder: Arc<dyn Embedder> = Arc::new(HttpEmbedder::from_env());
let store = Arc::new(SqliteStore::with_embedder("~/.echo-agent/memory.db", embedder)?);
let items = store
.search_with(&["alice", "memories"], echo_state::memory::SearchQuery::hybrid("theme preference", 5))
.await?;Structs§
- Search
Query - Unified search request
- Sqlite
Store - SQLite persistent Store with FTS5 full-text search and optional vector search
- Store
Item - A single record in the Store
Enums§
- Search
Mode - Search mode