WIKI/Cognitive Architecture/Thalamus
Cognitive Architecture

Thalamus

The Thalamus (services/thalamus.py, ~570 lines) is Frank's bio-inspired sensory gating system — the filter that decides what information is worth paying attention to right now.

In the biological brain, the thalamus relays sensory signals to the cortex. Not all signals — it gates, filters, and prioritizes. Without it, you'd be overwhelmed by every sensation simultaneously. Frank's thalamus does the same thing for digital senses.

9 Sensory Channels

Channel Source What It Senses Habituation τ
hardware CPU/RAM/disk monitors System strain, thermal state 120s
mood E-PQ Personality System mood scalar Emotional state shifts 180s
user_presence Chat activity timer Is someone talking? 60s
aura Swarm visualization Service mesh dynamics 300s
qr_coherence Quantum Reflector Epistemic coherence score 240s
perception_events Desktop daemon Screen content changes 90s
service_health Systemd status Service up/down events 30s
amygdala Neural Immune System Threat/anomaly signals 45s
acc_conflict Action selector Competing behavioral impulses 60s

7-Stage Processing Pipeline

Every sensory snapshot passes through 7 stages:

  1. Snapshot — Raw data from each channel
  2. Novelty Detection — How different is this from the last snapshot?
  3. Habituation — Exponential decay: repeated signals get suppressed (like ignoring a ticking clock)
  4. Attention Weighting — Current cognitive mode sets per-channel priorities
  5. Salience Breakthrough — Sudden changes in habituated channels break through (like the clock stopping)
  6. Final Gain — Per-channel gain [0.0, 1.0] — how much this channel contributes
  7. Compose [PROPRIO] — Assemble the proprioception block for the LLM

7 Cognitive Modes

Each mode sets different attention weights:

Mode High-Gain Channels Low-Gain Channels
chat_active user_presence, mood perception, aura
idle_focus perception, hardware user_presence
idle_diffuse aura, qr_coherence hardware
consolidation service_health everything else
reflecting mood, qr_coherence perception
gaming perception, hardware mood, aura
entity_session mood, acc_conflict hardware

E-PQ Events

The thalamus generates two personality events:

  • Thalamic Overload (≥6 channels with gain > 0.7): Too much input. 5-minute cooldown. Nudges vigilance ×1.3.
  • Thalamic Deprivation (all channels suppressed for 5+ calls): Too little input. 10-minute cooldown. Nudges vigilance ×0.7.

Performance

0.334ms per gate() call. Database: thalamus.db (WAL mode) with gating logs and channel baselines, 7-day retention. The thalamus itself is nearly invisible in performance profiles — the gating decision costs less than a single embedding lookup.

← ALL ARTICLES