Skip to main content

HebbianConfig

Struct HebbianConfig 

Source
pub struct HebbianConfig {
Show 13 fields pub enabled: bool, pub hebbian_lr: f32, pub consolidation_interval_secs: u64, pub consolidation_threshold: f64, pub consolidate_provider: Option<ProviderName>, pub max_candidates_per_sweep: usize, pub consolidation_cooldown_secs: u64, pub consolidation_prompt_timeout_secs: u64, pub consolidation_max_neighbors: usize, pub spreading_activation: bool, pub spread_depth: u32, pub spread_edge_types: Vec<String>, pub step_budget_ms: u64,
}
Expand description

Hebbian edge-weight reinforcement and consolidation configuration (HL-F1/F2/F3/F4, #3344/#3345).

Controls opt-in Hebbian learning on knowledge-graph edges. When enabled, every recall traversal increments the weight column of the traversed edges, building a usage-frequency signal into the graph. The consolidation sub-feature (HL-F3/F4) runs a background sweep that identifies high-traffic entity clusters and distills them into graph_rules entries via an LLM.

Fields§

§enabled: bool

Master switch. When false, no weight updates are written to the database and the consolidation loop does not start. Default: false.

§hebbian_lr: f32

Weight increment per co-activation (HL-F2, #3344).

Typical range: 0.010.5. A value of 0.0 is accepted but logs a WARN at startup when enabled = true. Default: 0.1.

§consolidation_interval_secs: u64

How often the consolidation sweep runs, in seconds (HL-F3, #3345).

Set to 0 to disable the consolidation loop while keeping Hebbian updates active. Default: 3600 (one hour).

§consolidation_threshold: f64

Minimum degree × avg_weight score for an entity to qualify as a consolidation candidate (HL-F3, #3345). Default: 5.0.

§consolidate_provider: Option<ProviderName>

Provider name (from [[llm.providers]]) used for cluster distillation (HL-F4, #3345).

Falls back to the main provider when None or unresolvable.

§max_candidates_per_sweep: usize

Maximum number of candidates processed per sweep (HL-F3, #3345). Default: 10.

§consolidation_cooldown_secs: u64

Minimum seconds between consecutive consolidations of the same entity (HL-F3, #3345).

An entity is skipped if its consolidated_at timestamp is within this window. Default: 86400 (24 hours).

§consolidation_prompt_timeout_secs: u64

LLM prompt timeout for a single distillation call, in seconds (HL-F4, #3345). Default: 30.

§consolidation_max_neighbors: usize

Maximum number of neighbouring entity summaries passed to the LLM per candidate (HL-F4, #3345). Default: 20.

§spreading_activation: bool

Enable HL-F5 spreading activation from the top-1 ANN anchor (HL-F5, #3346).

When true and enabled = true, recall_graph_hela performs BFS from the nearest entity anchor, scoring nodes by path_weight × cosine. Default: false.

§spread_depth: u32

BFS depth for HL-F5 spreading activation. Clamped to [1, 6]. Default: 2.

§spread_edge_types: Vec<String>

MAGMA edge-type filter for HL-F5 spreading activation.

Accepted values: "semantic", "temporal", "causal", "entity". Empty = traverse all edge types. Default: [].

§step_budget_ms: u64

Per-step circuit-breaker timeout for HL-F5 in milliseconds.

Any internal step (anchor ANN, edges batch, vectors batch) that exceeds this duration triggers an Ok(Vec::new()) fallback with a WARN. Default: 8.

Trait Implementations§

Source§

impl Clone for HebbianConfig

Source§

fn clone(&self) -> HebbianConfig

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 HebbianConfig

Source§

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

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

impl Default for HebbianConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for HebbianConfig

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 HebbianConfig

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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<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>,