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: f64Working memory decay rate (per day). Higher = faster decay.
mu2: f64Core memory decay rate (per day). Higher = faster decay.
alpha: f64Consolidation transfer rate (working → core per day)
interleave_ratio: f64Fraction of archived memories replayed per cycle
replay_boost: f64Core strength boost per replayed archived memory (base)
promote_threshold: f64§demote_threshold: f64§archive_threshold: f64§actr_decay: f64Base-level activation decay parameter (d in t^-d)
context_weight: f64Context spreading activation weight
importance_weight: f64Importance weight in retrieval activation
contradiction_penalty: f64Contradiction penalty in activation
spacing_factor: f64Spacing effect multiplier
importance_floor: f64Importance floor in stability
consolidation_bonus: f64Consolidation bonus per consolidation count
forget_threshold: f64Effective strength threshold for pruning
reward_magnitude: f64Default reward magnitude
downscale_factor: f64Global downscaling factor per consolidation cycle
hebbian_enabled: boolEnable Hebbian link formation
hebbian_threshold: i32Number of co-activations before link forms
hebbian_decay: f64Link strength decay per consolidation cycle
stdp_enabled: boolEnable temporal direction tracking
stdp_causal_threshold: f64Forward/backward ratio threshold for causal inference
stdp_min_observations: i32Minimum observations before STDP inference
embedding: EmbeddingConfigEmbedding provider configuration
fts_weight: f64Weight for FTS exact matching in hybrid recall (0.0-1.0) Recommended: 0.15 for 15% FTS contribution
embedding_weight: f64Weight for embedding similarity in recall scoring (0.0-1.0) Recommended: 0.60 for 60% semantic similarity contribution
actr_weight: f64Weight 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: f64Sigmoid 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: f64Sigmoid 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: EntityConfigEntity extraction configuration
entity_weight: f64Weight for entity matches in hybrid recall scoring (0.0-1.0)
dedup_enabled: boolEnable dedup checking on write (default: true)
dedup_threshold: f64Cosine similarity threshold for considering memories as duplicates (default: 0.95)
auto_extract_importance_cap: f64Maximum 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: boolEnable dedup of recall results (default: true)
recall_dedup_threshold: f64Cosine similarity threshold for recall result dedup (default: 0.85)
temporal_weight: f64Weight for temporal channel in hybrid recall (0.0-1.0) Only meaningful when query has temporal indicators
hebbian_recall_weight: f64Weight for Hebbian graph channel in hybrid recall (0.0-1.0)
adaptive_weights: boolEnable query-type adaptive weight adjustment (default: true)
association: AssociationConfigWrite-time association discovery configuration
triple: TripleConfigLLM triple extraction configuration
promotion: PromotionConfigKnowledge promotion configuration
Implementations§
Source§impl MemoryConfig
impl MemoryConfig
Sourcepub fn chatbot() -> Self
pub fn chatbot() -> Self
Preset for conversational chatbots.
High replay, slow decay — optimized for long conversations.
Sourcepub fn task_agent() -> Self
pub fn task_agent() -> Self
Preset for short-lived task agents.
Fast decay, low replay — focus on recent task context.
Sourcepub fn personal_assistant() -> Self
pub fn personal_assistant() -> Self
Preset for long-term personal assistants.
Very slow core decay — remember preferences for months.
Sourcepub fn researcher() -> Self
pub fn researcher() -> Self
Preset for research agents.
Minimal forgetting — everything might be relevant later.
Trait Implementations§
Source§impl Clone for MemoryConfig
impl Clone for MemoryConfig
Source§fn clone(&self) -> MemoryConfig
fn clone(&self) -> MemoryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more