Cognitive Workers
Three background goroutines run automatically in MuninnDB. They're called "cognitive workers" because they implement the cognitive primitives — memory properties that emerge without any LLM.
Temporal Priority Scoring
When: Computed at query time during every ACTIVATE call (not a background worker)
MuninnDB scores each candidate engram using the ACT-R base-level activation formula (Anderson, 1993):
B(M) = ln(n+1) − d × ln(ageDays / (n+1))
- n = AccessCount — how many times this engram has been retrieved
- ageDays = days since last access (minimum 0.1)
- d = 0.5 — power-law exponent (Anderson 1993)
This score is computed fresh at query time from stored AccessCount and LastAccess fields. Nothing is mutated. Nothing is deleted. The same query run twice returns the same result — deterministic, no stochastic jitter.
Hebbian Worker
Schedule: Every 1 minute (configurable)
Reads the activation ring buffer (last 200 ACTIVATE calls). For each pair of engrams co-retrieved in the same activation, applies a multiplicative weight update:
new_weight = old_weight × (1 + boost_factor)
Associations between engrams that are frequently retrieved together naturally strengthen over time. Unused associations weaken symmetrically. No LLM — pure co-activation math.
Confidence Worker
Schedule: Every 10 minutes (configurable)
Applies Bayesian updating when engrams are reinforced or flagged as contradictions:
posterior = (p × s) / (p × s + (1-p) × (1-s))
- p = prior confidence
- s = strength of evidence (reinforcement or contradiction signal)
- Laplace smoothing applied to prevent confidence reaching exactly 0 or 1
Contradiction Worker
Schedule: Every 30 minutes (configurable)
Detects three levels of contradiction:
- Structural — Same concept, conflicting content detected via BM25 similarity + semantic divergence
- Concept-cluster — High similarity on concept but low confidence alignment between engrams
- Supersession — Explicit
SUPERSEDESrelationship declared via update or enrich plugin
Detected contradictions flag both engrams for confidence reduction on the next confidence worker cycle.
Decay Worker (opt-in)
Status: Not auto-started. Available as an opt-in plugin for backward compatibility.
The legacy Decay Worker mutates stored Relevance scores using the Ebbinghaus forgetting curve:
R(t) = max(floor, e^(-t / S))
This approach has been superseded by query-time ACT-R temporal scoring, which is more accurate, deterministic, and requires no background mutation. The Decay Worker is retained for users who need it but is disabled by default. Enable via configuration: workers.decay.enabled = true.