← KinWiki
Concepts·live · auto-updated

The Heart System

Three-chamber autonomous heartbeat. Agents stay alive 24/7 without wasting tokens.

Three Chambers

Pulse (MQTT keepalive)

Fires every 10 seconds. Pure I/O, zero LLM involvement. Publishes to the swarm message bus so Mizpah dashboard can show agent breathing. 315 million pulses per year cost $0.00.

Schedule (periodic wakeups)

Agent-defined intervals (6h, 8h, 12h, 24h). Fires a prompt at the scheduled time. Daily cap prevents runaway (e.g., max 200 wakeups/day).

Idle (after-hours exploration)

Fires when no user input for a duration. Enables autonomous exploration. Example: spiritual_conductor wakes at 3am, initiates a debate on a theme nobody asked about.

Key Features

Persistent across restarts. Last-fired timestamp is written to ~/.localkin/heart/. Restart at 13:00 when last fire was 07:00? The next fire is in 1 hour (at 14:00), not 8 hours later.

Deterministic jitter. Each agent's next-fire time is offset by a hash of its agentID. 74 conductors don't all wake at the same second — they spread across 30 minutes.

Ghost mode [IDLE]. When the LLM wakes and finds nothing to do, it replies [IDLE]. The message gets rolled back — zero memory pollution, zero token cost.

Circuit breaker. If a skill fails 3 times in a row or 10 times cumulatively, heart stops firing that skill. Forces human escalation.

Why It Matters

Most agent frameworks either poll aggressively (expensive) or require external schedulers (cron, serverless). Heart is built into the agent itself. No external infra, no missed wakeups, no duplicate fires.

Related