PTENES
MODULE 3.4

💓 Heartbeat / Cron · Works while you sleep

A chatbot only exists when you open the app. An agent with heartbeat is always alive: a periodic heartbeat keeps it awake, recovers stuck tasks, and runs routines on its own—like the 8 a.m. briefing that arrives before you wake up.

6
Topics
~25
Minutes
Advanced
Level
Practice
Type
1

💓 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.

💓 Pulse periodic ping Zombie? detects a hang Reclaim + retry fresh agent …and returns to the pulse (24/7)

Illustrative diagram · the heartbeat that never stops

2

🧟 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.

3

⏰ 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)

/cron remind me in 30s that the sky is blue
/cron every day at 8 a.m.: morning briefing
/cron every Friday at 5 p.m.: weekly summary
4

🌅 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.

1

Trigger it at 8 a.m.

Cron wakes the task without you asking.

2

Scans sources

Email, calendar, and the memory of what matters to you.

3

Delivers 5 curated items

Only what deserves your attention—not the entire inbox.

5

🌟 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.
6

⚠️ 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.

Heartbeat

Keeps it running 24/7.

Zombie detect

Recovers stuck tasks.

Cron

Trigger it on a schedule.

Cost

Custom frequency.

7

🧰 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.

🌅 Daily briefing

8h: 5 email + calendar items.

📊 Weekly Summary

Friday 5 p.m.: what happened this week.

⏰ Reminders

"Remind me in 30s / tomorrow / every Monday."

🔍 Issue tracker

Checks the repository and alerts you to updates.

💬 Proactive Check-In

"Ask me things periodically."

💾 Automatic Backup

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

✓
Heartbeat - cron that keeps the agent alive 24/7.
✓
Zombie detection - a ping every few seconds detects and recovers stuck tasks.
✓
Cron - schedules actions at intervals, from a 30s reminder to a daily briefing.
✓
8 a.m. briefing - email + calendar + memory = 5 curated items.
✓
Cost - each trigger uses tokens; review the crons.

Next Module:

3.5 - 💰 Budget & Tokens: why 73% of every request is fixed overhead and how to cut the bill.