Cognitive Workers
Four background goroutines run continuously in MuninnDB. They're called "cognitive workers" because they implement the cognitive primitives — memory properties that emerge without any LLM.
Decay Worker
Schedule: Every 5 minutes (configurable)
Scans all active engrams and applies the Ebbinghaus forgetting curve formula:
R(t) = max(floor, e^(-t / S))
- R = retention (new relevance score)
- t = days since last access
- S = stability (grows with spaced retrieval)
- floor = minimum relevance (default 0.05) — memories never fully vanish
The decay worker uses metadata-only key scans (100-byte records, not full 4KB engrams) for efficiency — a 40× bandwidth reduction at scale.
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.