Skip to main content

MemoryEngineV3

Struct MemoryEngineV3 

Source
pub struct MemoryEngineV3 { /* private fields */ }
Expand description

The V3 Memory Engine

Implementations§

Source§

impl MemoryEngineV3

Source

pub fn open(config: EngineConfig) -> Result<Self, Error>

Create or open memory engine

Source

pub fn open_with_recovery(config: EngineConfig) -> Result<Self, Error>

Open with crash recovery: check WAL, verify integrity, rebuild indexes if needed

Source

pub fn rebuild_all_indexes(&self)

Rebuild all indexes from the immortal log (source of truth)

Source

pub fn verify_index_consistency(&self) -> IndexConsistencyReport

Verify index consistency against the log

Source

pub fn rebuild_indexes_if_needed(&self) -> bool

Rebuild indexes if inconsistencies are detected

Source

pub fn capture_user_message( &self, text: &str, tokens: Option<u32>, ) -> Result<BlockHash, Error>

Capture a user message (with content validation)

Source

pub fn capture_assistant_message( &self, text: &str, tokens: Option<u32>, ) -> Result<BlockHash, Error>

Capture an assistant message (with content validation)

Source

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

Source

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

Source

pub fn capture_decision( &self, decision: &str, reasoning: Option<&str>, evidence_blocks: Vec<BlockHash>, confidence: Option<f32>, ) -> Result<BlockHash, Error>

Capture a decision

Source

pub fn capture_error( &self, error_type: &str, message: &str, resolution: Option<&str>, resolved: bool, ) -> Result<BlockHash, Error>

Capture an error

Source

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

Source

pub fn capture_checkpoint( &self, active_files: Vec<String>, working_context: &str, pending_tasks: Vec<String>, ) -> Result<BlockHash, Error>

Capture a checkpoint

Source

pub fn retrieve(&self, request: RetrievalRequest) -> RetrievalResult

Smart retrieval: assemble perfect context for a query

Source

pub fn resurrect(&self, timestamp: DateTime<Utc>) -> ResurrectionResult

Resurrect: fully restore state at any timestamp

Source

pub fn search_temporal( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<Block>

Search by time range

Source

pub fn search_semantic(&self, query: &str, limit: usize) -> Vec<Block>

Search by text/meaning

Source

pub fn search_entity(&self, entity: &str) -> Vec<Block>

Search by entity (file, person, etc.)

Source

pub fn get_decision_chain(&self, block_sequence: u64) -> Vec<Block>

Get decision chain

Source

pub fn get_current_session(&self) -> Vec<Block>

Get current session blocks

Source

pub fn verify_integrity(&self) -> IntegrityReport

Verify integrity

Source

pub fn stats(&self) -> EngineStats

Get statistics

Source

pub fn session_resume(&self) -> SessionResumeResult

Session resume: get everything needed to continue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.