Skip to main content

CognitiveConfig

Struct CognitiveConfig 

Source
pub struct CognitiveConfig {
Show 42 fields pub write_inference: bool, pub decay_on_recall: bool, pub pain_tracking: bool, pub interference_detection: bool, pub phantom_tracking: bool, pub speculative_cache: bool, pub archival_evaluation: bool, pub decay_exempt_tags: Vec<String>, pub inference_config: WriteInferenceConfig, pub decay_config: DecayConfig, pub phantom_config: PhantomConfig, pub archival_config: ArchivalConfig, pub stream_config: StreamConfig, pub enrichment_config: EnrichmentConfig, pub interference_threshold: f32, pub trajectory_max_turns: usize, pub speculative_cache_size: usize, pub speculative_embedding_threshold: f32, pub speculative_keyword_threshold: f32, pub project_scope_penalty: f32, pub rerank_pool_factor: usize, pub mmr_lambda: f32, pub slow_recall_log_ms: u64, pub pain_max_warnings: usize, pub injection_config: InjectionConfig, pub flush_snapshot_interval: u32, pub entity_boost_enabled: bool, pub entity_boost_weight: f32, pub always_dedup: bool, pub always_dedup_threshold: f32, pub always_max: usize, pub memory_dedup: bool, pub memory_dedup_threshold: f32, pub memory_dedup_token_overlap: f32, pub sweep_dedup_token_overlap: f32, pub calibration_enabled: bool, pub action_min_similarity: f32, pub action_overfetch: usize, pub action_type_weights: [f32; 6], pub action_keyword_weight: f32, pub action_keyword_min_len: usize, pub hidden_count_tags: Vec<String>,
}
Expand description

Configuration for the cognitive engine subsystems.

Fields§

§write_inference: bool

Whether write inference (auto-edges, contradiction detection) is enabled on store.

§decay_on_recall: bool

Whether salience decay is applied during retrieval.

§pain_tracking: bool

Whether pain tracking is enabled.

§interference_detection: bool

Whether interference detection is available.

§phantom_tracking: bool

Whether phantom tracking is enabled.

§speculative_cache: bool

Whether speculative caching is enabled.

§archival_evaluation: bool

Whether archival evaluation is available.

§decay_exempt_tags: Vec<String>

Memories carrying any of these tags never fade and are never archived (pinned memories). Default: scope:always.

§inference_config: WriteInferenceConfig

Configuration for the write inference engine.

§decay_config: DecayConfig

Configuration for the decay engine.

§phantom_config: PhantomConfig

Configuration for phantom tracking.

§archival_config: ArchivalConfig

Configuration for the archival pipeline.

§stream_config: StreamConfig

Configuration for the cognition stream.

§enrichment_config: EnrichmentConfig

Configuration for sleeptime enrichment.

§interference_threshold: f32

Similarity threshold for interference detection.

§trajectory_max_turns: usize

Maximum trajectory turns to track.

§speculative_cache_size: usize

Maximum speculative cache entries.

§speculative_embedding_threshold: f32

Cosine similarity threshold for a query to hit a speculative cache entry.

§speculative_keyword_threshold: f32

Keyword-overlap threshold for a query to hit a speculative cache entry.

§project_scope_penalty: f32

Recall relevance penalty for a memory from a DIFFERENT project than the query’s current project (0.0 = off, 1.0 = hard isolation). A weighted signal, not a filter: a strongly-relevant cross-project memory still surfaces, ranked below the current project’s; global (un-projected) and same-project memories are never penalized. Applied only when the caller passes a current project (None = search across all projects).

§rerank_pool_factor: usize

Candidate-pool multiplier for the optional hybrid-recall reranker: when a reranker is installed, recall fetches rerank_pool_factor * k candidates before reranking and truncating to k, so the reranker can promote a relevant hit that the first pass ranked outside the top k. Ignored when no reranker is installed. Minimum effective value is 1.

§mmr_lambda: f32

Diversity weight for the optional MMR pass on hybrid recall, in [0, 1]. 1.0 (the default) disables it, ranking on relevance alone. Below 1.0, recall greedily balances relevance against novelty so near-duplicate memories do not all fill the context budget: 0.7 trims obvious duplicates, 0.5 diversifies harder. Runs after any reranker, over the same over-fetched pool, so it can pull a distinct memory into the top k.

§slow_recall_log_ms: u64

An injection recall at or above this many milliseconds logs its phase timings and how many memories each phase loaded.

§pain_max_warnings: usize

Maximum pain signals to retain.

§injection_config: InjectionConfig

Configuration for injection attention selection.

§flush_snapshot_interval: u32

How many hot flushes may pass before index and graph snapshots are rewritten. Durability comes from the WAL checkpoint on every flush; snapshots only accelerate reopen, and open reconciles stale ones, so rewriting them per flush just multiplies fsync cost.

§entity_boost_enabled: bool

Whether recall boosts memories linked (in the graph) to an entity named in the query. Off by default: it only helps corpora that have run enrichment (so entity nodes and their Derived edges exist), and its ranking effect should be A/B measured before it is turned on broadly.

§entity_boost_weight: f32

Score added to a candidate that a query-named entity links to. Applied on top of the fused recall score, so it is calibrated against that scale.

§always_dedup: bool

Whether storing a scope:always (standing rule) memory that is near identical to an existing standing rule is skipped instead of inserted, so re-pinning the same rule can never grow the always-list.

§always_dedup_threshold: f32

Cosine similarity at or above which a new standing rule counts as a duplicate of an existing one.

§always_max: usize

Maximum standing rules (scope:always) to keep pinned. prune_standing_rules demotes the excess (lowest salience first) to ordinary memories, and injection never force-injects more than this, so the always-list, and the prompt budget it consumes, stay bounded. The user_profile rule is always kept and does not count against this.

§memory_dedup: bool

Whether storing a regular memory that is a near-identical paraphrase of an existing same-owner memory is skipped instead of inserted. Repeated extraction of the same conversation produces reworded copies of one fact (“User is building TaskPilot with Next.js” / “The user builds TaskPilot using Next.js”); without this they pile up, dilute recall, and waste context tokens. Two gates must BOTH pass, so a genuine value update (high cosine but a changed value token) is never swallowed and still reaches the write-inference supersession rule.

§memory_dedup_threshold: f32

Cosine similarity at or above which a regular memory can count as a paraphrase duplicate (first gate).

§memory_dedup_token_overlap: f32

Minimum token-set jaccard overlap between the two contents (second gate). Value updates share a frame but swap a value token, which drops them below this and keeps them storable.

§sweep_dedup_token_overlap: f32

Token-set jaccard overlap gate for the OFFLINE dedup sweep, looser than the write-time gate so it catches reworded paraphrases that already accumulated. Safe to loosen here only because the sweep also applies a value-update structural guard, so a correction is never merged even when its overlap clears this bar. The write hot path keeps the strict memory_dedup_token_overlap.

§calibration_enabled: bool

Whether to derive the cosine-based thresholds (paraphrase dedup, standing-rule dedup, value-update floor) from the installed embedder’s measured score distributions at open. Absolute cosine constants are embedder-coupled and have twice silently disabled cognition in production; calibration replaces them with distribution-derived values and keeps the configured defaults when the embedder cannot separate paraphrase from noise.

§action_min_similarity: f32

Action recall: minimum semantic similarity between the meaning of an action about to happen and a memory, below which the memory does not bear on the action. recall_for_action is ordinary semantic recall re-ranked by how strongly a memory governs behavior, never a tag lookup.

§action_overfetch: usize

Action recall: candidate over-fetch multiple. Recall pulls action_overfetch * k by raw similarity, then re-ranks by governing weight and truncates to k, so a strongly-governing memory ranked just outside the top-k by cosine alone can still surface.

§action_type_weights: [f32; 6]

Action recall: per memory-type weight for how strongly that kind of memory governs an action about to happen. Procedures, corrections, and anti-patterns govern; facts inform; past events least. This encodes “what I know that bears on doing this” as cognition over the type system, not a hardcoded action vocabulary. Order matches MemoryType: [episodic, semantic, procedural, anti_pattern, reasoning, correction].

§action_keyword_weight: f32

Action recall: relevance added to a candidate that shares a keyword with the action text (a BM25/lexical signal). This is what keeps action recall working when the embedder is weak or a non-semantic fallback: a rule about “git commit” is still found by the words when the vector is noise. A candidate is admitted on EITHER a semantic signal (cosine over action_min_similarity) OR a lexical one (a shared keyword).

§action_keyword_min_len: usize

Action recall: minimum token length for a word to count as a shared keyword, so short glue tokens (“to”, “-c”) do not create matches.

§hidden_count_tags: Vec<String>

Tags that mark a memory as internal working material to leave out of the dashboard scope counts (raw turns, action captures, entity index nodes). The host supplies its own spellings; the engine does not hardcode them.

Trait Implementations§

Source§

impl Clone for CognitiveConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CognitiveConfig

Source§

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

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

impl Default for CognitiveConfig

Source§

fn default() -> Self

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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