Skip to main content

cel_memory/
lib.rs

1//! Cellar memory subsystem โ€” trait surface and supporting types.
2//!
3//! This crate is the locked contract between the rest of the Cellar daemon
4//! (embedded agent runtime, NL rule compiler, `cel_act` gateway, rule matcher
5//! post-fire hook, Activity tab queries) and the memory implementation
6//! underneath. The trait surface here is the source of truth referenced by
7//! [`cellar-memory-manager.md`] ยง12; every v1 caller compiles against it.
8//!
9//! v1 ships [`BasicMemoryProvider`] as the backing implementation โ€” real bodies
10//! for [`MemoryProvider::retrieve`], [`MemoryProvider::write`], session
11//! lifecycle, simple deletes, export, and stats; `Err(NotImplemented)` for
12//! summarization, rollups, and re-embed; no-ops for `update_importance` and
13//! `supersede`. The full Memory & Context Manager subsystem (separate crate,
14//! separate plan) drops in behind the same trait without caller churn.
15//!
16//! [`cellar-memory-manager.md`]: file:///Users/dimitriospagkratis/.claude/plans/cellar-memory-manager.md
17
18#![deny(missing_docs)]
19#![warn(rust_2018_idioms)]
20
21pub mod basic;
22pub mod chunk;
23pub mod error;
24pub mod importance;
25pub mod offdevice_hook;
26pub mod ops;
27pub mod provider;
28pub mod query;
29pub mod session;
30pub mod summarizer;
31pub mod write_hook;
32
33// Convenient re-exports โ€” the symbols every caller will name.
34pub use basic::BasicMemoryProvider;
35pub use chunk::{ChunkKind, ChunkSource, MemoryChunk, MemoryTier, NewMemoryChunk};
36pub use error::{MemoryError, Result};
37pub use importance::score as score_importance;
38pub use offdevice_hook::{
39    ClosureOffdeviceHook, OffdeviceCallDescriptor, OffdeviceCallHook, OffdeviceDecision,
40};
41pub use ops::{
42    AccessEntry, AgingReport, EvictionEntry, EvictionReason, ExportBundle, ExportFilter,
43    MemoryStats, PurgeReport, ReEmbedReport,
44};
45pub use provider::MemoryProvider;
46pub use query::{CallerScope, MemoryPredicate, MemoryQuery, RetrievalProfile};
47pub use session::{MemorySession, NewMemorySession, SessionFilter, SessionOutcome};
48pub use summarizer::{
49    MockSummarizer, MockSummaryCall, Summarizer, SummarizerError, SummarizerResult, SummaryContext,
50};
51pub use write_hook::{ClosureHook, MemoryWriteHook, WriteDecision};