cel-memory-sqlite
SQLite + sqlite-vec implementation of cel-memory's MemoryProvider trait. Local-first, single-file, embedded vector + FTS retrieval.
Status: v0.1 — Phase 1 (persistence + writes) complete; Phase 2 (hybrid retrieval) in progress. Roadmap in the Cellar Memory & Context Manager plan.
What's in this crate
SqliteMemoryProvider—MemoryProviderimpl backed by SQLite (one file, no separate process).Embeddertrait +MockEmbedder(always available).FastEmbedEmbedderbehind thefastembedfeature — local ONNX runtime +bge-small-en-v1.5(~130 MB model download).- Schema migrations for
memory_chunks,memory_vec(sqlite-vec virtual table),memory_fts(FTS5), sessions, access log, eviction log. sqlite-vecextension loaded at connection open; thememory_vecvirtual table is available without extra setup.
Design
- Single SQLite file. One file to back up, encrypt, ship to compliance. No separate vector daemon, no second process to manage.
- Brute-force vector scan up to ~1M chunks per user.
sqlite-vecis fast on Apple Silicon (5–30 ms at typical personal-memory scale). HNSW is a drop-in upgrade whensqlite-vecships it. - Hybrid retrieval (Phase 2): vector + FTS + recency, weighted per
RetrievalProfile. - Governance-first. Every write consults the optional
MemoryWriteHookfromcel-memory— a rule engine can redact or veto.
Example
use ;
let provider = open.await?;
// Use as cel_memory::MemoryProvider — same trait as BasicMemoryProvider.
Features
fastembed— enablesFastEmbedEmbedderfor local embeddings. Off by default to avoid the 130 MB model download in dev workflows.
License
Apache-2.0