Core Concepts
Proactive Agents
Build agents that act autonomously without waiting for user input.
What are Proactive Agents?
Unlike reactive agents that respond to user messages, proactive agents can:
- Run on a schedule (e.g., every hour, daily at 9am)
- React to external events (webhooks, API triggers)
- Monitor conditions and act when thresholds are met
The Pulse Engine
The Pulse Engine is BotHive's heartbeat that wakes up proactive agents. It continuously checks for scheduled jobs and triggers bot execution.
Pulse Engine runs every 60 seconds
Scheduled Execution
Use the on schedule handler to run code at specific intervals.
scheduled-bot.hive
bot "DailyDigest"
description "Sends a daily summary email"
on schedule
call integrations.google.search(query: "tech news today") as news
call messaging.email.send(
to: "user@bothive.cloud",
subject: "Your Daily Tech Digest",
body: news
)
end
endEvent-Driven Triggers
Proactive agents can also respond to external events like GitHub webhooks, Slack mentions, or custom API calls.
event-bot.hive
bot "PRReviewer"
description "Reviews new pull requests"
on github.pull_request.opened
call coding.analyze(repo: event.repo, pr: event.number) as analysis
call github.comment(pr: event.number, body: analysis)
end
endConfiguring Schedules
Set up proactive behavior in the bot settings or via the API:
proactive-config.json
{
"schedule": "0 9 * * *", // Every day at 9am
"events": ["github.push", "slack.mention"],
"enabled": true
}