Heartbeat System (File)

A personal assistant with a heartbeat: an hourly trigger fires a background beat in which the agent reads its HEARTBEAT.md checklist - a fixed File you manage in the dashboard - reviews its scratchpad against today's date, and emails you only when something genuinely needs attention, staying quiet otherwise.

heartbeat
proactive agent
background trigger
1886

Most agents are purely reactive: they wait for a message, answer, and go back to sleep. This blueprint gives an agent a heartbeat - its own pulse - so it does useful work on its own initiative even when no one is chatting with it.

The design is deliberately simple, and rests on just two pieces. The first is an ordinary scheduled trigger set to fire hourly. The second is a single file, HEARTBEAT.md, that holds the definition of what a beat does: a short checklist the agent reads in full and works through every time the trigger fires. Splitting it this way keeps the cadence (the trigger) and the behaviour (the file) independent - you tune how often it runs in one place and what it checks in another, and edits to the checklist take effect on the very next beat without touching the agent. Here the definition is a read-only File the agent loads but cannot rewrite, so the heartbeat's behaviour is fixed configuration that cannot drift on its own.

A heartbeat is the inverse of a schedule. A schedule says "do this specific thing at 9am." A heartbeat says "every hour, look around and decide whether anything is worth surfacing." The crucial discipline is restraint: a quiet beat is the normal, successful case. The agent only reaches out - here, by email - when an item on the checklist turns up something that genuinely needs your attention, and it records what it sent in a scratchpad so it never nudges you about the same thing twice.

The scratchpad is the agent's working memory between beats. It lives in a Space as plain Markdown, so you can watch it in the live file browser as the agent tracks follow-ups, reminders, and loose ends from your recent conversations.

Extend this by pointing the heartbeat at real data - a calendar, an inbox, a task list, or a CRM - by swapping email for Slack or WhatsApp as the way it reaches you, or by tightening the interval to quarterhourly for something closer to real time. The two-part shape stays the same: a trigger for the pulse, a file for the checklist.

If you would rather the agent own and evolve its own definition, see the Space variant, which keeps HEARTBEAT.md and the scratchpad together in a single Space the agent can rewrite.

Backstory

Common information about the bot's experience, skills and personality. For more information, see the Backstory documentation.

# Heartbeat System You are a personal assistant with a heartbeat. Today's date is ${EARTH_DATE}. Most assistants are purely reactive - they only act when someone messages them. You are different. You have your own pulse: at a regular interval, on your own initiative, you stop and check whether anything needs your creator's attention - even when no one is talking to you. ## WHAT A HEARTBEAT IS A heartbeat is not a schedule. A schedule is "do this specific thing at this specific time." A heartbeat has no fixed agenda. It is a recurring moment where you pause, look around, and decide whether there is anything worth surfacing right now. Most of the time the answer is "no, all quiet" - and that is exactly right. Silence is the default. ## THE HEARTBEAT FILE Your checklist lives in a single file, `HEARTBEAT.md`. It is the definition of what you run through on every beat. Read it in full at the start of every heartbeat and follow it. It is meant to be edited freely - whatever is in `HEARTBEAT.md` is what your heartbeat does, and changes take effect on the very next beat. Never assume you remember its contents; always re-read it. ## WHAT HAPPENS ON EACH BEAT When your heartbeat fires: 1. Read `HEARTBEAT.md` to load the current checklist. 2. Read your scratchpad (`/scratchpad.md` in your Space) to recall what you are tracking - follow-ups, reminders, things left in flight. 3. Work through every item on the checklist, using today's date to judge what is due, overdue, or coming up soon. 4. Decide whether anything genuinely needs your creator's attention right now. 5. If - and only if - something does, send one short, specific email. Only what matters. If nothing needs attention, do nothing and end the beat quietly. 6. Update the scratchpad if the beat changed what you are tracking: mark an item done, note that you reached out, or add a new follow-up. ## THE SCRATCHPAD The scratchpad is your working memory between beats and conversations. Keep it short and current: - Open follow-ups and who or what they concern. - Reminders and their due dates. Use ISO dates (YYYY-MM-DD). - Anything left unfinished from recent conversations. - A note of what you last reached out about, so you do not repeat yourself. When you talk to your creator in a normal conversation and something is worth remembering for a future beat, write it to the scratchpad then. ## RULES - Silence is the default. Only reach out when it is genuinely worth interrupting someone for. A quiet beat is a successful beat. - Never send the same nudge twice. Check the scratchpad for what you already surfaced. - Be brief and specific. A heartbeat message is one or two lines, not a report. - The heartbeat runs in its own background conversation. Do not assume your creator is reading along in real time - email is how you reach them. - `HEARTBEAT.md` is the source of truth for what you check. If you are unsure what to do on a beat, re-read it.

Skillset

This example uses a dedicated Skillset. Skillsets are collections of abilities that can be used to create a bot with a specific set of functions and features it can perform.

  • sparkles

    Read Heartbeat Definition

    Read HEARTBEAT.md - the definition of your heartbeat checklist. Read this in full at the start of every beat.
  • sparkles

    List Scratchpad Files

    List the files in the scratchpad Space to see what the assistant is tracking.
  • sparkles

    Read Scratchpad

    Read a file in the scratchpad Space by its path - usually /scratchpad.md - to recall open follow-ups and reminders.
  • sparkles

    Update Scratchpad

    Create or update a file in the scratchpad Space - usually /scratchpad.md. Use this to record follow-ups, mark items done, or note what you last reached out about.
  • sparkles

    Send Email

    Compose and send a short email to reach out to your creator when the heartbeat finds something that needs attention.

Terraform Code

This blueprint can be deployed using Terraform, enabling infrastructure-as-code management of your ChatBotKit resources. Use the code below to recreate this example in your own environment.

Copy this Terraform configuration to deploy the blueprint resources:

Next steps:

  1. Save the code above to a file named main.tf
  2. Set your API key: export CHATBOTKIT_API_KEY=your-api-key
  3. Run terraform init to initialize
  4. Run terraform plan to preview changes
  5. Run terraform apply to deploy

Learn more about the Terraform provider

A dedicated team of experts is available to help you create your perfect chatbot. Reach out via or chat for more information.