Skip to main content

MnemoEngine

Struct MnemoEngine 

Source
pub struct MnemoEngine {
Show 14 fields pub storage: Arc<dyn StorageBackend>, pub index: Arc<dyn VectorIndex>, pub embedding: Arc<dyn EmbeddingProvider>, pub full_text: Option<Arc<dyn FullTextIndex>>, pub default_agent_id: String, pub default_org_id: Option<String>, pub encryption: Option<Arc<ContentEncryption>>, pub cold_storage: Option<Arc<dyn ColdStorage>>, pub cache: Option<Arc<MemoryCache>>, pub embed_events: bool, pub ttl_working_seconds: u64, pub procedural_importance_floor: f32, pub poisoning_policy: PoisoningPolicy, pub provenance_signer: Option<Arc<ProvenanceSigner>>,
}

Fields§

§storage: Arc<dyn StorageBackend>§index: Arc<dyn VectorIndex>§embedding: Arc<dyn EmbeddingProvider>§full_text: Option<Arc<dyn FullTextIndex>>§default_agent_id: String§default_org_id: Option<String>§encryption: Option<Arc<ContentEncryption>>§cold_storage: Option<Arc<dyn ColdStorage>>§cache: Option<Arc<MemoryCache>>§embed_events: bool§ttl_working_seconds: u64

Default TTL applied to Working-tier memories whose remember request does not supply an explicit ttl_seconds. Defaults to 1 hour.

§procedural_importance_floor: f32

Importance floor enforced on write for Procedural-tier memories. Defaults to 0.8.

§poisoning_policy: PoisoningPolicy

Poisoning policy read by check_for_anomaly. Defaults to the v0.3.2 behaviour (no z-score outlier gate). Override with MnemoEngine::with_poisoning_policy.

§provenance_signer: Option<Arc<ProvenanceSigner>>

v0.4.0-rc3 (Task B1) — when set, every recall(req) with req.with_provenance == Some(true) returns an HMAC-signed ReadProvenance receipt. None keeps the recall hot-path overhead at zero. Attach via MnemoEngine::with_provenance_signer.

Implementations§

Source§

impl MnemoEngine

Source

pub fn new( storage: Arc<dyn StorageBackend>, index: Arc<dyn VectorIndex>, embedding: Arc<dyn EmbeddingProvider>, default_agent_id: String, default_org_id: Option<String>, ) -> Self

Source

pub fn with_provenance_signer(self, signer: Arc<ProvenanceSigner>) -> Self

Attach a provenance::ProvenanceSigner (Task B1) so callers can request signed read-receipts via RecallRequest.with_provenance = Some(true).

Source

pub fn with_poisoning_policy(self, policy: PoisoningPolicy) -> Self

Attach a poisoning::PoisoningPolicy to the engine. See poisoning::PoisoningPolicy::with_outlier_threshold for the v0.3.3 z-score outlier gate.

Source

pub fn with_ttl_working_seconds(self, seconds: u64) -> Self

Override the default 1-hour TTL applied to Working-tier memories when a caller does not supply an explicit ttl_seconds.

Source

pub fn with_procedural_importance_floor(self, floor: f32) -> Self

Override the default 0.8 importance floor applied to Procedural memories on write.

Source

pub fn with_full_text(self, ft: Arc<dyn FullTextIndex>) -> Self

Source

pub fn with_encryption(self, enc: Arc<ContentEncryption>) -> Self

Source

pub fn with_cold_storage(self, cs: Arc<dyn ColdStorage>) -> Self

Source

pub fn with_cache(self, c: Arc<MemoryCache>) -> Self

Source

pub fn with_event_embeddings(self) -> Self

Source

pub async fn remember( &self, request: RememberRequest, ) -> Result<RememberResponse>

Source

pub async fn recall(&self, request: RecallRequest) -> Result<RecallResponse>

Source

pub async fn forget(&self, request: ForgetRequest) -> Result<ForgetResponse>

Source

pub async fn forget_subject( &self, request: ForgetSubjectRequest, ) -> Result<ForgetSubjectResponse>

Subject-scoped erasure for GDPR / DPDPA compliance. See forget::forget_subject for strategy semantics.

Source

pub async fn run_ttl_sweep(&self) -> Result<TtlReport>

Hard-delete every memory whose expires_at is in the past and emit one MemoryExpired audit event per deletion.

Source

pub async fn run_reflection_pass( &self, agent_id: Option<String>, ) -> Result<ReflectionReport>

Auto-Dream-compatible reflection pass: date absolutization, external rewrite acceptance, semantic dedup, low-importance conflict resolution, and stale archival. See reflection::run_reflection_pass.

Source

pub async fn run_reflection_pass_with_mode( &self, agent_id: Option<String>, mode: ReflectionMode, force: bool, ) -> Result<ReflectionReport>

Reflection pass that honours the new ReflectionMode gate (v0.3.1). Use Coordinated to avoid double-work when Auto Dream is also running.

Source

pub async fn replay_quarantine( &self, agent_id: Option<String>, since: Option<&str>, ) -> Result<Vec<QuarantineReplayEntry>>

List quarantined memories for operator review. See poisoning::replay_quarantine.

Source

pub async fn share(&self, request: ShareRequest) -> Result<ShareResponse>

Source

pub async fn checkpoint( &self, request: CheckpointRequest, ) -> Result<CheckpointResponse>

Source

pub async fn branch(&self, request: BranchRequest) -> Result<BranchResponse>

Source

pub async fn merge(&self, request: MergeRequest) -> Result<MergeResponse>

Source

pub async fn replay(&self, request: ReplayRequest) -> Result<ReplayResponse>

Source

pub async fn run_decay_pass( &self, agent_id: Option<String>, archive_threshold: f32, forget_threshold: f32, ) -> Result<DecayPassResult>

Source

pub async fn run_consolidation( &self, agent_id: Option<String>, min_cluster_size: usize, ) -> Result<ConsolidationResult>

Source

pub async fn verify_integrity( &self, agent_id: Option<String>, thread_id: Option<&str>, ) -> Result<ChainVerificationResult>

Source

pub async fn trace_causality( &self, event_id: Uuid, max_depth: usize, ) -> Result<CausalChain>

Source

pub async fn trace_causality_with_options( &self, event_id: Uuid, max_depth: usize, direction: TraceDirection, event_type_filter: Option<EventType>, ) -> Result<CausalChain>

Source

pub async fn verify_event_integrity( &self, agent_id: Option<String>, thread_id: Option<&str>, ) -> Result<ChainVerificationResult>

Source

pub async fn detect_conflicts( &self, agent_id: Option<String>, threshold: f32, ) -> Result<ConflictDetectionResult>

Source

pub async fn resolve_conflict( &self, conflict_pair: &ConflictPair, strategy: ResolutionStrategy, ) -> Result<()>

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Fruit for T
where T: Send + Downcast,