pub struct MemoryEngineV3 { /* private fields */ }Expand description
The V3 Memory Engine
Implementations§
Source§impl MemoryEngineV3
impl MemoryEngineV3
Sourcepub fn open(config: EngineConfig) -> Result<Self, Error>
pub fn open(config: EngineConfig) -> Result<Self, Error>
Create or open memory engine
Sourcepub fn open_with_recovery(config: EngineConfig) -> Result<Self, Error>
pub fn open_with_recovery(config: EngineConfig) -> Result<Self, Error>
Open with crash recovery: check WAL, verify integrity, rebuild indexes if needed
Sourcepub fn rebuild_all_indexes(&self)
pub fn rebuild_all_indexes(&self)
Rebuild all indexes from the immortal log (source of truth)
Sourcepub fn verify_index_consistency(&self) -> IndexConsistencyReport
pub fn verify_index_consistency(&self) -> IndexConsistencyReport
Verify index consistency against the log
Sourcepub fn rebuild_indexes_if_needed(&self) -> bool
pub fn rebuild_indexes_if_needed(&self) -> bool
Rebuild indexes if inconsistencies are detected
Sourcepub fn capture_user_message(
&self,
text: &str,
tokens: Option<u32>,
) -> Result<BlockHash, Error>
pub fn capture_user_message( &self, text: &str, tokens: Option<u32>, ) -> Result<BlockHash, Error>
Capture a user message (with content validation)
Sourcepub fn capture_assistant_message(
&self,
text: &str,
tokens: Option<u32>,
) -> Result<BlockHash, Error>
pub fn capture_assistant_message( &self, text: &str, tokens: Option<u32>, ) -> Result<BlockHash, Error>
Capture an assistant message (with content validation)
Sourcepub fn capture_tool_call(
&self,
tool_name: &str,
input: Value,
output: Option<Value>,
duration_ms: Option<u64>,
success: bool,
) -> Result<BlockHash, Error>
pub fn capture_tool_call( &self, tool_name: &str, input: Value, output: Option<Value>, duration_ms: Option<u64>, success: bool, ) -> Result<BlockHash, Error>
Capture a tool call
Sourcepub fn capture_file_operation(
&self,
path: &str,
operation: FileOperation,
content_hash: Option<BlockHash>,
lines: Option<u32>,
diff: Option<String>,
) -> Result<BlockHash, Error>
pub fn capture_file_operation( &self, path: &str, operation: FileOperation, content_hash: Option<BlockHash>, lines: Option<u32>, diff: Option<String>, ) -> Result<BlockHash, Error>
Capture a file operation
Sourcepub fn capture_decision(
&self,
decision: &str,
reasoning: Option<&str>,
evidence_blocks: Vec<BlockHash>,
confidence: Option<f32>,
) -> Result<BlockHash, Error>
pub fn capture_decision( &self, decision: &str, reasoning: Option<&str>, evidence_blocks: Vec<BlockHash>, confidence: Option<f32>, ) -> Result<BlockHash, Error>
Capture a decision
Sourcepub fn capture_error(
&self,
error_type: &str,
message: &str,
resolution: Option<&str>,
resolved: bool,
) -> Result<BlockHash, Error>
pub fn capture_error( &self, error_type: &str, message: &str, resolution: Option<&str>, resolved: bool, ) -> Result<BlockHash, Error>
Capture an error
Sourcepub fn capture_boundary(
&self,
boundary_type: BoundaryType,
context_tokens_before: u32,
context_tokens_after: u32,
summary: &str,
continuation_hint: Option<&str>,
) -> Result<BlockHash, Error>
pub fn capture_boundary( &self, boundary_type: BoundaryType, context_tokens_before: u32, context_tokens_after: u32, summary: &str, continuation_hint: Option<&str>, ) -> Result<BlockHash, Error>
Capture a session boundary
Sourcepub fn capture_checkpoint(
&self,
active_files: Vec<String>,
working_context: &str,
pending_tasks: Vec<String>,
) -> Result<BlockHash, Error>
pub fn capture_checkpoint( &self, active_files: Vec<String>, working_context: &str, pending_tasks: Vec<String>, ) -> Result<BlockHash, Error>
Capture a checkpoint
Sourcepub fn retrieve(&self, request: RetrievalRequest) -> RetrievalResult
pub fn retrieve(&self, request: RetrievalRequest) -> RetrievalResult
Smart retrieval: assemble perfect context for a query
Sourcepub fn resurrect(&self, timestamp: DateTime<Utc>) -> ResurrectionResult
pub fn resurrect(&self, timestamp: DateTime<Utc>) -> ResurrectionResult
Resurrect: fully restore state at any timestamp
Sourcepub fn search_temporal(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<Block>
pub fn search_temporal( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<Block>
Search by time range
Sourcepub fn search_entity(&self, entity: &str) -> Vec<Block>
pub fn search_entity(&self, entity: &str) -> Vec<Block>
Search by entity (file, person, etc.)
Sourcepub fn get_decision_chain(&self, block_sequence: u64) -> Vec<Block>
pub fn get_decision_chain(&self, block_sequence: u64) -> Vec<Block>
Get decision chain
Sourcepub fn get_current_session(&self) -> Vec<Block>
pub fn get_current_session(&self) -> Vec<Block>
Get current session blocks
Sourcepub fn verify_integrity(&self) -> IntegrityReport
pub fn verify_integrity(&self) -> IntegrityReport
Verify integrity
Sourcepub fn stats(&self) -> EngineStats
pub fn stats(&self) -> EngineStats
Get statistics
Sourcepub fn session_resume(&self) -> SessionResumeResult
pub fn session_resume(&self) -> SessionResumeResult
Session resume: get everything needed to continue