rig_memory_policy/lib.rs
1//! Backend-agnostic memory-policy primitives shared across Rig memory-store
2//! adapters (`rig-memvid` and future backends like SQLite, LanceDB, Qdrant,
3//! plain filesystem, etc.).
4//!
5//! Phase 1 surface (pure helpers, no trait design yet):
6//!
7//! - [`dedup`] — in-process content-hash dedup for hooks/compactors that must
8//! satisfy `rig::memory::{DemotionHook, Compactor}`'s idempotency contract.
9//! - [`metadata`] — typed envelope written into a backend's per-entry
10//! metadata so downstream tools (evals, inspectors, RAG pipelines) can
11//! reason about the lifecycle that produced each entry.
12//! - [`error`] — neutral `PolicyError` for failures in the above helpers.
13//!
14//! This crate has **no** dependency on `memvid-core` or any specific storage
15//! engine. Backends are expected to wrap these primitives in their own
16//! adapter (e.g. `rig-memvid` adds `.mv2` framing on top).
17//!
18//! Trait surface (`MemoryStore`, capability sub-traits, generic hooks) lands
19//! in subsequent phases — see the tracking issue for details.
20
21#![deny(missing_docs)]
22#![deny(rustdoc::broken_intra_doc_links)]
23
24pub mod dedup;
25pub mod error;
26pub mod metadata;
27
28pub use error::PolicyError;