Skip to main content

brainwires_memory/
lib.rs

1//! # brainwires-memory
2//!
3//! Tiered hot/warm/cold agent memory **orchestration**.
4//!
5//! The schema layer (the five tier stores — `MessageStore`, `SummaryStore`,
6//! `FactStore`, `MentalModelStore`, `TierMetadataStore`, plus the shared
7//! `tier_types`) lives in [`brainwires_stores`]. This crate adds:
8//!
9//! - [`TieredMemory`] — multi-factor adaptive search across all four tiers
10//!   (similarity × recency × importance), plus promotion / demotion of
11//!   entries when access patterns change.
12//! - [`dream`] — offline consolidation engine that summarises hot-tier
13//!   messages into warm-tier summaries, extracts cold-tier facts, and
14//!   demotes by retention score. Feature-gated behind `dream`.
15//!
16//! [`TieredMemory`]: tiered_memory::TieredMemory
17//! [`brainwires_stores`]: https://docs.rs/brainwires-stores
18
19#[cfg(feature = "dream")]
20pub mod dream;
21
22pub mod tiered_memory;
23
24pub use tiered_memory::{
25    CanonicalWriteToken, MultiFactorScore, TieredMemory, TieredMemoryConfig, TieredMemoryStats,
26    TieredSearchResult,
27};
28
29// Re-export the schema types from brainwires-stores so a consumer that only
30// pulls brainwires-memory still gets the tier_types it'll need to interact
31// with the orchestrator's API.
32pub use brainwires_stores::{
33    FactStore, FactType, KeyFact, MemoryAuthority, MemoryTier, MentalModel, MentalModelStore,
34    MessageMetadata, MessageStore, MessageSummary, ModelType, SummaryStore, TierMetadata,
35    TierMetadataStore,
36};