1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! SQLite-backed implementations of the three memory traits in
//! [`klieo_core::memory`].
//!
//! `MemorySqlite::new` opens a SQLite file (or `:memory:` string),
//! runs migrations for all three trait tables, and returns three
//! `Arc<dyn …>` handles ready to drop into
//! [`klieo_core::AgentContext`].
//!
//! # Example
//!
//! ```no_run
//! use klieo_memory_sqlite::{MemorySqlite, DummyEmbedder};
//! use std::sync::Arc;
//!
//! async fn example() {
//! let mem = MemorySqlite::new(":memory:", Arc::new(DummyEmbedder)).await.unwrap();
//! // mem.short_term, mem.long_term, mem.episodic are
//! // Arc<dyn …> handles ready for AgentContext.
//! let _ = mem;
//! }
//! ```
//!
//! # Features
//!
//! - **Default** — three SQLite-backed memory traits + `Embedder`
//! trait with `DummyEmbedder` (zero-vector). Linear-scan recall.
//! - **`fastembed`** — adds `FastEmbedEmbedder` (real CPU embeddings
//! via ONNX runtime). Heavy first compile; model auto-downloads
//! to OS cache dir on first call.
//! - **`sqlite-vec`** — adds a vec0 virtual-table index on
//! `long_term_facts_vec`; `LongTermMemory::recall` uses k-NN MATCH
//! instead of linear scan.
//! - **`test-utils`** — exposes `FakeEmbedder` for downstream test
//! deps.
//!
//! # Limitations
//!
//! - **Sync SQLite under blocking pool.** All trait methods spawn
//! `tokio::task::spawn_blocking` so they don't stall the async
//! runtime; throughput is bounded by the blocking-pool size.
pub
pub use ;
pub use FakeEmbedder;
pub use SqliteShortTerm;
pub use SqliteEpisodic;
pub use SqliteLongTerm;
pub use MemorySqlite;
pub use ;