cel_memory_sqlite/lib.rs
1//! SQLite-backed [`MemoryProvider`] for Cellar.
2//!
3//! This crate is the foundation of the Memory & Context Manager subsystem
4//! per `/Users/dimitriospagkratis/.claude/plans/cellar-memory-manager.md`.
5//! Phase 0 (current) delivers:
6//!
7//! - Schema migrations for every table in ยง6.2 (`memory_chunks`,
8//! `memory_vec`, `memory_fts`, `memory_sessions`, `memory_summary_members`,
9//! `memory_access_log`, `memory_eviction_log`).
10//! - `sqlite-vec` extension loaded into the connection at open time so the
11//! `memory_vec` virtual table is available.
12//! - [`Embedder`] trait + [`MockEmbedder`] (always available) and
13//! [`FastEmbedEmbedder`] (gated behind the `fastembed` feature) for the
14//! real `bge-small-en-v1.5` model.
15//! - [`SqliteMemoryProvider`] that opens a DB, runs migrations, and
16//! implements [`MemoryProvider`] with real bodies for the methods the
17//! v1 daemon needs at boot time (`stats`, `write`, `get`, `purge_all`)
18//! plus `Err(NotImplemented)` for the rest, ready for Phase 1 to fill in.
19//!
20//! [`MemoryProvider`]: cel_memory::MemoryProvider
21
22#![deny(missing_docs)]
23#![warn(rust_2018_idioms)]
24
25pub(crate) mod cache;
26pub mod embedder;
27pub mod error;
28pub mod migrations;
29pub mod provider;
30pub mod vec_extension;
31
32#[cfg(feature = "fastembed")]
33pub mod fastembed_impl;
34
35pub use embedder::{Embedder, MockEmbedder};
36pub use error::SqliteMemoryError;
37pub use provider::SqliteMemoryProvider;
38
39#[cfg(feature = "fastembed")]
40pub use fastembed_impl::FastEmbedEmbedder;