Skip to main content

agentic_memory/v3/
mod.rs

1//! V3 Immortal Architecture — Memory That Never Dies.
2//!
3//! The V3 engine implements an append-only, content-addressed memory system
4//! built on immutable blocks with BLAKE3 integrity chains.
5//!
6//! # Architecture
7//! - **Block**: Content-addressed, immutable unit of storage
8//! - **ImmortalLog**: Append-only log (source of truth)
9//! - **Five Indexes**: Temporal, Semantic, Causal, Entity, Procedural
10//! - **TieredStorage**: Hot → Warm → Cold → Frozen
11//! - **SmartRetrieval**: Multi-index fusion with token budgeting
12//! - **GhostWriter**: Background sync to ALL AI coding assistants (Claude, Cursor, Windsurf, Cody)
13
14pub mod block;
15pub mod claude_hooks;
16pub mod compression;
17pub mod config;
18pub mod edge_cases;
19pub mod embeddings;
20pub mod engine;
21pub mod ghost_writer;
22pub mod immortal_log;
23pub mod indexes;
24pub mod migration;
25pub mod recovery;
26pub mod retrieval;
27pub mod tiered;
28
29#[cfg(feature = "encryption")]
30pub mod encryption;
31
32#[cfg(test)]
33pub mod tests;
34
35// ═══════════════════════════════════════════════════════════════════
36// RE-EXPORTS
37// ═══════════════════════════════════════════════════════════════════
38
39pub use block::{Block, BlockContent, BlockHash, BlockType, BoundaryType, FileOperation};
40pub use claude_hooks::ClaudeHooks;
41pub use compression::{compress, decompress, CompressionLevel};
42pub use config::MemoryV3Config;
43pub use edge_cases::{
44    atomic_write, check_disk_space, detect_content_type, find_writable_location,
45    merge_preserving_user_sections, normalize_content, normalize_path, paths_equal, safe_path,
46    safe_write_to_claude, validate_content_size, validated_timestamp, ContentType, FileLock,
47    IndexConsistencyReport, LockError, NormalizedContent, ProjectIsolation, RecoveryMarker,
48    StorageError, ValidationError,
49};
50pub use embeddings::EmbeddingManager;
51pub use engine::{
52    EngineConfig, EngineStats, MemoryEngineV3, ResurrectionResult, SessionResumeResult,
53};
54pub use ghost_writer::{ClientType, DetectedClient, GhostWriter};
55pub use immortal_log::{ImmortalLog, IntegrityReport};
56pub use indexes::{Index, IndexResult};
57pub use migration::V2ToV3Migration;
58pub use recovery::{RecoveryManager, WriteAheadLog};
59pub use retrieval::{
60    RetrievalCoverage, RetrievalRequest, RetrievalResult, RetrievalStrategy, SmartRetrievalEngine,
61};
62pub use tiered::{TierConfig, TierStats, TieredStorage};
63
64#[cfg(feature = "encryption")]
65pub use encryption::{decrypt, derive_key, encrypt, generate_key, EncryptionKey};
66
67/// V3 format version string
68pub const V3_VERSION: &str = "3.0.0";
69
70/// Magic bytes for V3 .imem files
71pub const V3_MAGIC: &[u8; 4] = b"IMRT";