> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Heartbeat • AI Agent SDK

> Heartbeat: Standalone heartbeat coordinator.

# Heartbeat

> Defined in the [**heartbeat**](../modules/heartbeat) module.

<Badge color="blue">AI Agent</Badge>

Standalone heartbeat coordinator.

Runs an Agent on a schedule and delivers results via callback.
Does NOT add any params to the Agent class.

Usage::

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, Heartbeat

agent = Agent(instructions="Monitor server health")
hb = Heartbeat(agent, schedule="hourly")
hb.start()
```

## Constructor

<ParamField query="agent" type="Any" required={true}>
  No description available.
</ParamField>

<ParamField query="schedule" type="str" required={false} default="'hourly'">
  No description available.
</ParamField>

<ParamField query="prompt" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="on_result" type="Optional[Callable]" required={false}>
  No description available.
</ParamField>

<ParamField query="on_error" type="Union[str, Callable]" required={false} default="'retry'">
  No description available.
</ParamField>

<ParamField query="max_retries" type="int" required={false} default="3">
  No description available.
</ParamField>

## Methods

<CardGroup cols={2}>
  <Card title="start()" icon="function" href="../functions/Heartbeat-start">
    Start the heartbeat loop.
  </Card>

  <Card title="stop()" icon="function" href="../functions/Heartbeat-stop">
    Stop the heartbeat loop.
  </Card>

  <Card title="is_running()" icon="function" href="../functions/Heartbeat-is_running">
    Instance method.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/heartbeat.py#L45">
  `praisonaiagents/agent/heartbeat.py` at line 45
</Card>
