71 lines
6.8 KiB
Markdown
71 lines
6.8 KiB
Markdown
In OpenClaw, the heartbeat is a scheduled mechanism that allows your AI agent to proactively check for tasks, events, or updates without waiting for a manual message from you. [1, 2]
|
|
To correctly set up and optimize your heartbeat, follow these configuration steps:
|
|
1. Set the Frequency
|
|
The heartbeat interval determines how often the agent "wakes up." [3]
|
|
|
|
* Default: 30 minutes.
|
|
* Configuration: Adjust the every parameter in your openclaw.json or through the CLI.
|
|
* 30m or 1h is recommended for general use.
|
|
* Set to "0m" to disable heartbeats entirely if you only want the agent to respond to your messages. [2, 4, 5, 6]
|
|
*
|
|
|
|
2. Configure the Target Destination
|
|
Decide where the heartbeat should send its results or notifications.
|
|
|
|
* target: "none": (Default) Use this for internal background processing only (no messages sent to you).
|
|
* target: "last": Routes messages to the last contact or channel you used to communicate with the agent. [4, 7, 8]
|
|
*
|
|
|
|
3. Use HEARTBEAT.md for Instructions [3, 9]
|
|
The agent checks a specific file in its workspace for its "to-do list" during each tick. [3, 4]
|
|
|
|
* Create a small HEARTBEAT.md checklist.
|
|
* Pro Tip: Keep this file small to minimize token costs.
|
|
* Example content: "Check my calendar for meetings in the next 2 hours" or "Monitor server logs for errors". [3, 4, 7, 10, 11]
|
|
*
|
|
|
|
4. Optimize for Cost and Cache
|
|
Frequent heartbeats can become expensive if not managed correctly. [12]
|
|
|
|
* Isolated Model: Route heartbeat tasks to a cheaper model (e.g., using agents.defaults.heartbeat.model) to save credits.
|
|
* Cache Warmth: If using Anthropic, setting the heartbeat interval slightly below the provider's Cache TTL (Time To Live) can keep your context "warm," significantly reducing costs by reusing cached data. [7, 8, 13]
|
|
|
|
5. Set Active Hours [14]
|
|
To prevent the agent from waking up (and spending money) while you are asleep, restrict its activity to your local time. [4, 10]
|
|
|
|
* Quiet Hours: Configure specific windows (e.g., 9 a.m. to 8 p.m.) so the heartbeat only runs when you are active. [10, 15]
|
|
|
|
Quick Commands
|
|
|
|
* Trigger Immediately: Use openclaw system event --mode now to force a heartbeat run right away for testing.
|
|
* Check Status: Run openclaw status --all or openclaw logs --follow to see if your heartbeats are firing correctly. [16, 17]
|
|
|
|
These guides explain how to configure OpenClaw's heartbeat frequency, target destination, and active hours:
|
|
|
|
[Heartbeat - OpenClaw Docs - OpenClaw AI](https://docs.openclaw.ai/gateway/heartbeat#:~:text=%E2%80%8B-,Quick%20start%20%28beginner%29,active%20hours%20%28local%20time%29.)
|
|
[Tom Keldenich's Post - LinkedIn - LinkedIn](https://www.linkedin.com/posts/tom-keldenich_youve-heard-about-openclaw-but-do-you-know-activity-7431714517253980160-fMjk#:~:text=That%20the%20basics.,that%20during%20your%20work%20hours.)
|
|
[this is the most detailed breakdown I've seen - X](https://x.com/Sofi_Shvets/status/2017822509425692827#:~:text=The%20agent%20finishes%20the%20thought,go%20%28like%20a%20channel%29.)
|
|
[Heartbeat ignores heartbeat.model when session ... - GitHub - GitHub](https://github.com/openclaw/openclaw/issues/13009#:~:text=Bug%20Summary,here%20%E2%9C%93%20if%20%28opts?.)
|
|
[OpenClaw Won't Bite, A Zero-to-Hero Guide for People Who ... - Towards AI](https://pub.towardsai.net/openclaw-wont-bite-a-zero-to-hero-guide-for-people-who-hate-terminal-14dd1ae6d1c2#:~:text=A%20pet%20lobster%20can%20learn,Without%20being%20asked.)
|
|
[How to stop burning money on OpenClaw : r/PromptEngineering - Reddit](https://www.reddit.com/r/PromptEngineering/comments/1rktirf/how_to_stop_burning_money_on_openclaw/#:~:text=Other%20providers%20handle%20caching%20differently,month%20primarily%20through%20this%20approach.)
|
|
|
|
Would you like help writing a specific HEARTBEAT.md checklist for a task like email triaging or calendar management?
|
|
|
|
[1] [https://milvus.io](https://milvus.io/ai-quick-reference/what-is-the-openclawmoltbotclawdbot-heartbeat-feature#:~:text=The%20heartbeat%20feature%20in%20OpenClaw%28Moltbot/Clawdbot%29%20is%20a,conditions%20without%20waiting%20for%20a%20user%20message.)
|
|
[2] [https://x.com](https://x.com/Sofi_Shvets/status/2017822509425692827)
|
|
[3] [https://pub.towardsai.net](https://pub.towardsai.net/openclaw-wont-bite-a-zero-to-hero-guide-for-people-who-hate-terminal-14dd1ae6d1c2)
|
|
[4] [https://docs.openclaw.ai](https://docs.openclaw.ai/gateway/heartbeat)
|
|
[5] [https://docs.openclaw.ai](https://docs.openclaw.ai/start/openclaw)
|
|
[6] [https://milvus.io](https://milvus.io/ru/blog/openclaw-formerly-clawdbot-moltbot-explained-a-complete-guide-to-the-autonomous-ai-agent.md#:~:text=%D0%9A%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D0%B0%20%D0%B1%D0%B5%D0%B7%D0%BE%D0%BF%D0%B0%D1%81%D0%BD%D0%BE%D1%81%D1%82%D0%B8%20Cisco%20%D1%80%D0%B0%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%BB%D0%B0%20%D0%BD%D0%B0%D0%B2%D1%8B%D0%BA%20%D0%BF%D0%BE%D0%B4%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%D0%BC,%D0%B2%D0%B7%D0%BB%D0%BE%D0%BC%D0%B0%D0%BD%20%D0%B8%20%D0%B7%D0%B0%D0%BD%D1%8F%D0%BB%20%D0%BF%D0%B5%D1%80%D0%B2%D0%BE%D0%B5%20%D0%BC%D0%B5%D1%81%D1%82%D0%BE%20%D0%B2%20%D1%80%D0%B5%D0%BF%D0%BE%D0%B7%D0%B8%D1%82%D0%BE%D1%80%D0%B8%D0%B8.)
|
|
[7] [https://docs.openclaw.ai](https://docs.openclaw.ai/automation/cron-vs-heartbeat)
|
|
[8] [https://github.com](https://github.com/openclaw/openclaw/issues/13009#:~:text=Steps%20to%20Reproduce%20*%20Set%20agents.defaults.heartbeat.model%20to,%2DE%20%22%28heartbeat%7Cagent%20model%29%22%20~/.openclaw/logs/gateway.log%20%7C%20tail%20%2D10.)
|
|
[9] [https://blog.devgenius.io](https://blog.devgenius.io/just-built-a-two-layer-ai-system-that-trades-polymarket-and-kalshi-while-i-sleep-heres-the-aa59ead275f6#:~:text=Default%20cadence%20is%2030%20minutes%20%28with%20some,includes%20returning%20HEARTBEAT_OK%20if%20nothing%20requires%20attention.)
|
|
[10] [https://www.linkedin.com](https://www.linkedin.com/posts/tom-keldenich_youve-heard-about-openclaw-but-do-you-know-activity-7431714517253980160-fMjk)
|
|
[11] [https://docs.openclaw.ai](https://docs.openclaw.ai/gateway/heartbeat#:~:text=Create%20a%20tiny%20HEARTBEAT.md%20checklist%20in%20the%20agent%20workspace%20%28optional%20but%20recommended%29.)
|
|
[12] [https://arpitbhayani.me](https://arpitbhayani.me/blogs/heartbeats-in-distributed-systems/#:~:text=Deciding%20Heartbeat%20Intervals%20and%20Timeouts%20When%20a,quickly.%20However%2C%20this%20comes%20at%20a%20cost.)
|
|
[13] [https://www.reddit.com](https://www.reddit.com/r/PromptEngineering/comments/1rktirf/how_to_stop_burning_money_on_openclaw/)
|
|
[14] [https://www.instagram.com](https://www.instagram.com/reel/DVf56ZJCF8R/)
|
|
[15] [https://docs.openclaw.ai](https://docs.openclaw.ai/gateway/troubleshooting)
|
|
[16] [https://docs.openclaw.ai](https://docs.openclaw.ai/help/faq#:~:text=Other%20useful%20CLI%20checks:%20openclaw%20status%20%2D%2Dall,broken.%20Install%20docs:%20Install%2C%20Installer%20flags%2C%20Updating.)
|
|
[17] [https://docs.openclaw.ai](https://docs.openclaw.ai/cli/system)
|