Skip to main content

agentic_memory/v3/indexes/
mod.rs

1//! Five indexes for the V3 immortal architecture.
2
3pub mod causal;
4pub mod entity;
5pub mod procedural;
6pub mod semantic;
7pub mod temporal;
8
9use super::block::{Block, BlockHash};
10
11/// Result from any index query
12#[derive(Debug, Clone)]
13pub struct IndexResult {
14    pub block_sequence: u64,
15    pub block_hash: BlockHash,
16    pub score: f32, // Relevance score (0.0 - 1.0)
17}
18
19/// Common trait for all indexes
20pub trait Index {
21    /// Add a block to the index
22    fn index(&mut self, block: &Block);
23
24    /// Remove a block from the index (for reindexing only)
25    fn remove(&mut self, sequence: u64);
26
27    /// Rebuild entire index from blocks
28    fn rebuild(&mut self, blocks: impl Iterator<Item = Block>);
29}