Expand description
SQLite-backed MemoryProvider — one concrete persistence backend for the
cel-memory crate.
This crate implements the MemoryProvider contract on top of a single
local SQLite file (plus sqlite-vec for vector search and FTS5 for lexical
search). It owns persistence behavior only — schema, migrations, embeddings,
hybrid retrieval, caching — and depends on cel-memory for the trait and
value types. It does not depend on any prompt builder, planner, or runtime.
What it delivers:
- Schema migrations for every memory table (
memory_chunks,memory_vec,memory_fts,memory_sessions,memory_summary_members,memory_access_log,memory_eviction_log). sqlite-vecextension loaded into the connection at open time so thememory_vecvirtual table is available.Embeddertrait +MockEmbedder(always available) andFastEmbedEmbedder(gated behind thefastembedfeature) for the realbge-small-en-v1.5model.SqliteMemoryProviderimplementing the fullMemoryProvidersurface: writes, hybrid (vector + FTS + recency) retrieval with a TTL+LRU cache, sessions, summarization and rollups (via an injectedcel_memory::Summarizer), aging sweeps, export, and stats. The onlyre_embed_allre-embeds stored vectors when the target model matches the configuredEmbedder.
Re-exports§
pub use embedder::Embedder;pub use embedder::MockEmbedder;pub use error::SqliteMemoryError;pub use provider::SqliteMemoryProvider;
Modules§
- embedder
- Embedder trait + reference implementations.
- error
- Storage-side error type. Converted to
MemoryErroron the way out of theSqliteMemoryProvider. - migrations
- Embedded SQL migrations.
- provider
SqliteMemoryProvider— the SQLite + vector backing storage.- vec_
extension - Registration helper for the sqlite-vec extension.