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: boolWhether write inference (auto-edges, contradiction detection) is enabled on store.
decay_on_recall: boolWhether salience decay is applied during retrieval.
pain_tracking: boolWhether pain tracking is enabled.
interference_detection: boolWhether interference detection is available.
phantom_tracking: boolWhether phantom tracking is enabled.
speculative_cache: boolWhether speculative caching is enabled.
archival_evaluation: boolWhether archival evaluation is available.
Memories carrying any of these tags never fade and are never archived
(pinned memories). Default: scope:always.
inference_config: WriteInferenceConfigConfiguration for the write inference engine.
decay_config: DecayConfigConfiguration for the decay engine.
phantom_config: PhantomConfigConfiguration for phantom tracking.
archival_config: ArchivalConfigConfiguration for the archival pipeline.
stream_config: StreamConfigConfiguration for the cognition stream.
enrichment_config: EnrichmentConfigConfiguration for sleeptime enrichment.
interference_threshold: f32Similarity threshold for interference detection.
trajectory_max_turns: usizeMaximum trajectory turns to track.
speculative_cache_size: usizeMaximum speculative cache entries.
speculative_embedding_threshold: f32Cosine similarity threshold for a query to hit a speculative cache entry.
speculative_keyword_threshold: f32Keyword-overlap threshold for a query to hit a speculative cache entry.
project_scope_penalty: f32Recall 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: usizeCandidate-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: f32Diversity 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: u64An injection recall at or above this many milliseconds logs its phase timings and how many memories each phase loaded.
pain_max_warnings: usizeMaximum pain signals to retain.
injection_config: InjectionConfigConfiguration for injection attention selection.
flush_snapshot_interval: u32How 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: boolWhether 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: f32Score 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: boolWhether 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: f32Cosine similarity at or above which a new standing rule counts as a duplicate of an existing one.
always_max: usizeMaximum 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: boolWhether 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: f32Cosine similarity at or above which a regular memory can count as a paraphrase duplicate (first gate).
memory_dedup_token_overlap: f32Minimum 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: f32Token-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: boolWhether 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: f32Action 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: usizeAction 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: f32Action 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: usizeAction recall: minimum token length for a word to count as a shared keyword, so short glue tokens (“to”, “-c”) do not create matches.
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.