pub struct MnemoEngine {Show 18 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>>,
pub orientation_cache_store: Option<Arc<OrientationCacheStore>>,
pub consolidation_policy: ConsolidationPolicy,
pub evidence_scorer: Option<Arc<dyn EvidenceScorer>>,
pub experience_memory_enabled: bool,
}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: u64Default TTL applied to Working-tier memories whose remember
request does not supply an explicit ttl_seconds. Defaults to 1 hour.
procedural_importance_floor: f32Importance floor enforced on write for Procedural-tier memories.
Defaults to 0.8.
poisoning_policy: PoisoningPolicyPoisoning 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.
orientation_cache_store: Option<Arc<OrientationCacheStore>>v0.4.8 — when set, every recall(req) with
req.orientation_cache == Some(_) updates this in-process,
namespace-scoped, constant-token “context map” and returns a
bounded rendering alongside the top-k. PEEK-anchored
(arXiv:2605.19932). None keeps the recall hot-path
overhead at zero. Attach via
MnemoEngine::with_orientation_cache_store.
consolidation_policy: ConsolidationPolicyv0.4.10 — feedback-driven consolidation trigger metric. Default
maturity::ConsolidationPolicy::FixedSize preserves the
v0.4.x behaviour. Attach a
maturity::ConsolidationPolicy::MaturityDriven policy via
MnemoEngine::with_consolidation_policy to opt in to the
scalar maturity gate (recency / hit-success / edge-degree /
redundancy). Internal anchor: FluxMem (arXiv:2605.28773), prior
art only — mnemo’s policy is a structural cousin, not a
reproduction.
evidence_scorer: Option<Arc<dyn EvidenceScorer>>v0.4.12 — optional answer-impact scorer for the cost-aware
evidence budget. When a recall sets
RecallRequest::evidence_budget
with ScorerKind::Delta AND this
is Some, the budget uses this scorer to decide sufficiency;
otherwise it falls back to evidence::CosineScorer. None
keeps the recall hot-path at zero overhead. Attach via
MnemoEngine::with_evidence_scorer.
experience_memory_enabled: boolDocTrace (arXiv:2606.10921) — experience-memory tier gate. When
false (the default), remember_plan is a validation error and
recall_plan always misses, so default behaviour is unchanged.
Flip on via MnemoEngine::with_experience_memory. Plans are
stored as ordinary records (reserved tag + metadata), so the
tier is backend-agnostic and RBAC/consent-gated like everything
else. See experience.
Implementations§
Source§impl MnemoEngine
impl MnemoEngine
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
Sourcepub fn with_provenance_signer(self, signer: Arc<ProvenanceSigner>) -> Self
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).
Sourcepub fn with_poisoning_policy(self, policy: PoisoningPolicy) -> Self
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.
Sourcepub fn with_ttl_working_seconds(self, seconds: u64) -> Self
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.
Sourcepub fn with_procedural_importance_floor(self, floor: f32) -> Self
pub fn with_procedural_importance_floor(self, floor: f32) -> Self
Override the default 0.8 importance floor applied to Procedural memories on write.
pub fn with_full_text(self, ft: Arc<dyn FullTextIndex>) -> Self
pub fn with_encryption(self, enc: Arc<ContentEncryption>) -> Self
pub fn with_cold_storage(self, cs: Arc<dyn ColdStorage>) -> Self
pub fn with_cache(self, c: Arc<MemoryCache>) -> Self
pub fn with_event_embeddings(self) -> Self
Sourcepub fn with_orientation_cache_store(
self,
store: Arc<OrientationCacheStore>,
) -> Self
pub fn with_orientation_cache_store( self, store: Arc<OrientationCacheStore>, ) -> Self
v0.4.8 — attach a per-engine orientation-cache store. Recall
calls that set
RecallRequest::orientation_cache
will update + render the namespace-scoped, constant-token
context map. See
crate::query::orientation_cache for the contract +
the PEEK arXiv:2605.19932 anchor.
Sourcepub fn with_consolidation_policy(self, policy: ConsolidationPolicy) -> Self
pub fn with_consolidation_policy(self, policy: ConsolidationPolicy) -> Self
v0.4.10 — attach a maturity::ConsolidationPolicy. The default
FixedSize policy preserves the legacy behaviour; pass
MaturityDriven(MaturityPolicy::balanced()) to opt in to the
feedback-driven trigger metric. See
crate::query::maturity for the score contract.
Sourcepub fn with_evidence_scorer(self, scorer: Arc<dyn EvidenceScorer>) -> Self
pub fn with_evidence_scorer(self, scorer: Arc<dyn EvidenceScorer>) -> Self
v0.4.12 — attach an answer-impact evidence::EvidenceScorer
(typically a evidence::DeltaScorer wrapping an LLM callback)
used by the cost-aware evidence budget when a recall requests
ScorerKind::Delta. Without an
attached scorer, delta-mode budgets fall back to
evidence::CosineScorer. See crate::query::evidence.
Sourcepub fn with_experience_memory(self) -> Self
pub fn with_experience_memory(self) -> Self
DocTrace (arXiv:2606.10921) — enable the experience-memory tier so
remember_plan caches successful plans and
recall_plan replays them on
structurally-similar queries. Off by default (the two ops are
inert when disabled), so existing behaviour is unchanged. See
experience.
pub async fn remember( &self, request: RememberRequest, ) -> Result<RememberResponse>
pub async fn recall(&self, request: RecallRequest) -> Result<RecallResponse>
pub async fn forget(&self, request: ForgetRequest) -> Result<ForgetResponse>
Sourcepub async fn forget_subject(
&self,
request: ForgetSubjectRequest,
) -> Result<ForgetSubjectResponse>
pub async fn forget_subject( &self, request: ForgetSubjectRequest, ) -> Result<ForgetSubjectResponse>
Subject-scoped erasure for GDPR / DPDPA compliance.
See forget::forget_subject for strategy semantics.
Sourcepub async fn run_ttl_sweep(&self) -> Result<TtlReport>
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.
Sourcepub async fn run_reflection_pass(
&self,
agent_id: Option<String>,
) -> Result<ReflectionReport>
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.
Sourcepub async fn run_reflection_pass_with_mode(
&self,
agent_id: Option<String>,
mode: ReflectionMode,
force: bool,
) -> Result<ReflectionReport>
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.
Sourcepub async fn replay_quarantine(
&self,
agent_id: Option<String>,
since: Option<&str>,
) -> Result<Vec<QuarantineReplayEntry>>
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.
pub async fn checkpoint( &self, request: CheckpointRequest, ) -> Result<CheckpointResponse>
pub async fn branch(&self, request: BranchRequest) -> Result<BranchResponse>
pub async fn merge(&self, request: MergeRequest) -> Result<MergeResponse>
pub async fn replay(&self, request: ReplayRequest) -> Result<ReplayResponse>
Sourcepub async fn consolidate(
&self,
request: ConsolidateRequest,
) -> Result<ConsolidateResponse>
pub async fn consolidate( &self, request: ConsolidateRequest, ) -> Result<ConsolidateResponse>
CONSOLIDATE (Infini-Memory, arXiv:2606.10677) — group a caller-chosen
set of member memories into one revisable topic document, preserving
provenance and the hash-chained audit history. See consolidate.
Sourcepub async fn remember_plan(
&self,
request: RememberPlanRequest,
) -> Result<RememberPlanResponse>
pub async fn remember_plan( &self, request: RememberPlanRequest, ) -> Result<RememberPlanResponse>
REMEMBER_PLAN (DocTrace, arXiv:2606.10921) — cache a successful
retrieval/reasoning plan into the experience-memory tier. Inert
unless the engine was built with
with_experience_memory. See
experience.
Sourcepub async fn recall_plan(
&self,
request: RecallPlanRequest,
) -> Result<RecallPlanResponse>
pub async fn recall_plan( &self, request: RecallPlanRequest, ) -> Result<RecallPlanResponse>
RECALL_PLAN (DocTrace, arXiv:2606.10921) — replay the best stored
plan whose query signature matches above the similarity threshold,
or return a miss. Always misses when the experience-memory mode is
disabled. See experience.
pub async fn run_decay_pass( &self, agent_id: Option<String>, archive_threshold: f32, forget_threshold: f32, ) -> Result<DecayPassResult>
pub async fn run_consolidation( &self, agent_id: Option<String>, min_cluster_size: usize, ) -> Result<ConsolidationResult>
pub async fn verify_integrity( &self, agent_id: Option<String>, thread_id: Option<&str>, ) -> Result<ChainVerificationResult>
pub async fn trace_causality( &self, event_id: Uuid, max_depth: usize, ) -> Result<CausalChain>
pub async fn trace_causality_with_options( &self, event_id: Uuid, max_depth: usize, direction: TraceDirection, event_type_filter: Option<EventType>, ) -> Result<CausalChain>
pub async fn verify_event_integrity( &self, agent_id: Option<String>, thread_id: Option<&str>, ) -> Result<ChainVerificationResult>
pub async fn detect_conflicts( &self, agent_id: Option<String>, threshold: f32, ) -> Result<ConflictDetectionResult>
pub async fn resolve_conflict( &self, conflict_pair: &ConflictPair, strategy: ResolutionStrategy, ) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for MnemoEngine
impl !UnwindSafe for MnemoEngine
impl Freeze for MnemoEngine
impl Send for MnemoEngine
impl Sync for MnemoEngine
impl Unpin for MnemoEngine
impl UnsafeUnpin for MnemoEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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