💓 What Is a Heartbeat
Heartbeat is a cron job (a recurring task) that keeps the agent awake all the time, instead of just reacting when you speak. It’s literally a heartbeat: at each interval, something "pulses" and checks whether there’s work to do. It’s what turns a reactive chatbot into an agent that operates on its own.
Illustrative diagram · the heartbeat that never stops
🧟 Zombie detection
A “zombie process” stays silent until something dies — a task that got stuck but doesn’t alert you. The heartbeat solves this with a sub-agent that ping every few secondsIf a process stops responding, it’s detected, restarted, and the task is retried, including recovering from hallucinations.
🔧 What ping does
- Zombie detection — finds stuck processes that would otherwise stay stuck forever.
- Fresh agent reclaim — replaces the dead agent with a new one, with a clean context.
- Retries with recovery — tries again and corrects course when the agent hallucinated.
💡 Practical tip
This detection network is what makes it safe to leave the agent running without watching it. Without it, a single stuck task would paralyze the entire operation.
⏰ Cron / scheduled task
Besides keeping it alive, the heartbeat allows schedule actions at an interval. The material’s minimal example: “remind me in 30 seconds that the sky is blue.” Hermes saves the task and triggers it automatically when the time comes — you don’t even need to have the app open.
Scheduling examples (illustrative)
🌅 The 8 a.m. morning briefing
The use case that makes the feature shine: every day at 8 a.m., Hermes scans email + calendar + everything it knows about you (memory) and delivers 5 relevant itemsIt’s not a raw list — it’s curated. Cron + memory + integrations turn it into a proactive assistant.
Trigger it at 8 a.m.
Cron wakes the task without you asking.
Scans sources
Email, calendar, and the memory of what matters to you.
Delivers 5 curated items
Only what deserves your attention—not the entire inbox.
🌟 Makes it feel alive
With a heartbeat, the relationship flips: the agent comes to youYou can ask, "check in with me periodically, ask me questions," and it shows up from time to time with questions and suggestions. It stops being a tool that waits and becomes a proactive partner.
✗ Reactive chatbot
- ✗Only exists when you open it.
- ✗Never takes initiative.
- ✗Forgets about you between sessions.
✓ Agent with a heartbeat
- ✓Awake 24/7.
- ✓Checks in proactively.
- ✓Comes with suggestions at the right time.
⚠️ Scheduling precautions
Heartbeat and crons are powerful, but every trigger uses tokens. Too many scheduled tasks create hidden costs and a flood of notifications. This connects directly to the next module (3.5, Budget): a forgotten cron job can burn money while you sleep.
🚨 Caution
Periodically review active cron jobs. A schedule that runs every minute, multiplied by the ~73% fixed overhead of each request, turns into an unpleasant bill.
Keeps it running 24/7.
Recovers stuck tasks.
Trigger it on a schedule.
Custom frequency.
🧰 Heartbeat use cases
To make it stick, here are a few real patterns where the heartbeat shines — all combining cron, memory, and integrations you've seen in previous tracks.
8h: 5 email + calendar items.
Friday 5 p.m.: what happened this week.
"Remind me in 30s / tomorrow / every Monday."
Checks the repository and alerts you to updates.
"Ask me things periodically."
Daily OS snapshot on GitHub.
💡 Practical tip
Start with one a simple cron job (the 8 a.m. briefing) and observe for a week before adding more. That way, you can get a feel for the cost and value before filling the agent’s schedule.
📌 Module Summary
Next Module:
3.5 - 💰 Budget & Tokens: why 73% of every request is fixed overhead and how to cut the bill.