Skip to main content

MemoryConfig

Struct MemoryConfig 

Source
pub struct MemoryConfig {
Show 43 fields pub mu1: f64, pub mu2: f64, pub alpha: f64, pub interleave_ratio: f64, pub replay_boost: f64, pub promote_threshold: f64, pub demote_threshold: f64, pub archive_threshold: f64, pub actr_decay: f64, pub context_weight: f64, pub importance_weight: f64, pub contradiction_penalty: f64, pub spacing_factor: f64, pub importance_floor: f64, pub consolidation_bonus: f64, pub forget_threshold: f64, pub reward_magnitude: f64, pub downscale_factor: f64, pub hebbian_enabled: bool, pub hebbian_threshold: i32, pub hebbian_decay: f64, pub stdp_enabled: bool, pub stdp_causal_threshold: f64, pub stdp_min_observations: i32, pub embedding: EmbeddingConfig, pub fts_weight: f64, pub embedding_weight: f64, pub actr_weight: f64, pub actr_sigmoid_center: f64, pub actr_sigmoid_scale: f64, pub entity_config: EntityConfig, pub entity_weight: f64, pub dedup_enabled: bool, pub dedup_threshold: f64, pub auto_extract_importance_cap: f64, pub recall_dedup_enabled: bool, pub recall_dedup_threshold: f64, pub temporal_weight: f64, pub hebbian_recall_weight: f64, pub adaptive_weights: bool, pub association: AssociationConfig, pub triple: TripleConfig, pub promotion: PromotionConfig,
}
Expand description

All tunable parameters for the Engram memory system.

Default values come from neuroscience literature (ACT-R, Memory Chain Model, Ebbinghaus forgetting curve).

Fields§

§mu1: f64

Working memory decay rate (per day). Higher = faster decay.

§mu2: f64

Core memory decay rate (per day). Higher = faster decay.

§alpha: f64

Consolidation transfer rate (working → core per day)

§interleave_ratio: f64

Fraction of archived memories replayed per cycle

§replay_boost: f64

Core strength boost per replayed archived memory (base)

§promote_threshold: f64§demote_threshold: f64§archive_threshold: f64§actr_decay: f64

Base-level activation decay parameter (d in t^-d)

§context_weight: f64

Context spreading activation weight

§importance_weight: f64

Importance weight in retrieval activation

§contradiction_penalty: f64

Contradiction penalty in activation

§spacing_factor: f64

Spacing effect multiplier

§importance_floor: f64

Importance floor in stability

§consolidation_bonus: f64

Consolidation bonus per consolidation count

§forget_threshold: f64

Effective strength threshold for pruning

§reward_magnitude: f64

Default reward magnitude

§downscale_factor: f64

Global downscaling factor per consolidation cycle

§hebbian_enabled: bool

Enable Hebbian link formation

§hebbian_threshold: i32

Number of co-activations before link forms

§hebbian_decay: f64

Link strength decay per consolidation cycle

§stdp_enabled: bool

Enable temporal direction tracking

§stdp_causal_threshold: f64

Forward/backward ratio threshold for causal inference

§stdp_min_observations: i32

Minimum observations before STDP inference

§embedding: EmbeddingConfig

Embedding provider configuration

§fts_weight: f64

Weight for FTS exact matching in hybrid recall (0.0-1.0) Recommended: 0.15 for 15% FTS contribution

§embedding_weight: f64

Weight for embedding similarity in recall scoring (0.0-1.0) Recommended: 0.60 for 60% semantic similarity contribution

§actr_weight: f64

Weight for ACT-R activation in recall scoring (0.0-1.0) Recommended: 0.25 for 25% recency/frequency contribution Note: fts_weight + embedding_weight + actr_weight should sum to ~1.0

§actr_sigmoid_center: f64

Sigmoid center for ACT-R activation normalization. Controls the “midpoint age” — memories with activation near this value get normalized to ~0.5. Default -5.5 ≈ 1-day-old single-access memory. Lower values shift the curve to favor older memories.

§actr_sigmoid_scale: f64

Sigmoid scale for ACT-R activation normalization. Controls steepness: smaller = sharper transition, larger = gentler. Default 1.5 gives good discrimination across the 1min–30day range.

§entity_config: EntityConfig

Entity extraction configuration

§entity_weight: f64

Weight for entity matches in hybrid recall scoring (0.0-1.0)

§dedup_enabled: bool

Enable dedup checking on write (default: true)

§dedup_threshold: f64

Cosine similarity threshold for considering memories as duplicates (default: 0.95)

§auto_extract_importance_cap: f64

Maximum importance for auto-extracted memories (default: 0.7). Prevents LLM extractor from assigning high importance to noise. Only affects memories stored via extraction pipeline, not manual add().

§recall_dedup_enabled: bool

Enable dedup of recall results (default: true)

§recall_dedup_threshold: f64

Cosine similarity threshold for recall result dedup (default: 0.85)

§temporal_weight: f64

Weight for temporal channel in hybrid recall (0.0-1.0) Only meaningful when query has temporal indicators

§hebbian_recall_weight: f64

Weight for Hebbian graph channel in hybrid recall (0.0-1.0)

§adaptive_weights: bool

Enable query-type adaptive weight adjustment (default: true)

§association: AssociationConfig

Write-time association discovery configuration

§triple: TripleConfig

LLM triple extraction configuration

§promotion: PromotionConfig

Knowledge promotion configuration

Implementations§

Source§

impl MemoryConfig

Source

pub fn chatbot() -> Self

Preset for conversational chatbots.

High replay, slow decay — optimized for long conversations.

Source

pub fn task_agent() -> Self

Preset for short-lived task agents.

Fast decay, low replay — focus on recent task context.

Source

pub fn personal_assistant() -> Self

Preset for long-term personal assistants.

Very slow core decay — remember preferences for months.

Source

pub fn researcher() -> Self

Preset for research agents.

Minimal forgetting — everything might be relevant later.

Trait Implementations§

Source§

impl Clone for MemoryConfig

Source§

fn clone(&self) -> MemoryConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryConfig

Source§

fn default() -> Self

Literature-based defaults.

Source§

impl<'de> Deserialize<'de> for MemoryConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MemoryConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,