Expand description
SQLite integration for the Synaptic framework.
This crate provides:
SqliteCache: A SQLite-backed implementation of theLlmCachetrait for caching LLM responses with optional TTL expiration.SqliteCheckpointer: A SQLite-backed implementation of theCheckpointertrait for persisting graph state between executions.SqliteStore: A SQLite-backed implementation of theStoretrait with FTS5 full-text search.SqliteVectorStore: A SQLite-backed implementation of theVectorStoretrait with FTS5 hybrid search.
§Quick start
use synaptic_sqlite::{SqliteCache, SqliteCacheConfig};
// In-memory cache (great for testing)
let cache = SqliteCache::new(SqliteCacheConfig::in_memory())?;
// File-based cache with 1-hour TTL
let config = SqliteCacheConfig::new("/tmp/llm_cache.db").with_ttl(3600);
let cache = SqliteCache::new(config)?;Re-exports§
pub use checkpointer::SqliteCheckpointer;
Modules§
Structs§
- Chat
Response - A response from a chat model containing the AI message and optional token usage statistics.
- Document
- A document with content and metadata, used throughout the retrieval pipeline.
- Item
- A stored item in the key-value store.
- Sqlite
Cache - SQLite-backed implementation of the
LlmCachetrait. - Sqlite
Cache Config - Configuration for
SqliteCache. - Sqlite
Store - SQLite-backed implementation of the
Storetrait. - Sqlite
Store Config - Configuration for
SqliteStore. - Sqlite
Vector Store - SQLite-backed implementation of the
VectorStoretrait. - Sqlite
Vector Store Config - Configuration for
SqliteVectorStore.
Traits§
- Checkpointer
- Trait for persisting graph state checkpoints.
- Embeddings
- Trait for embedding text into vectors.
- LlmCache
- Trait for caching LLM responses.
- Store
- Persistent key-value store trait for cross-invocation state.
- Vector
Store - Trait for vector storage backends.