Heartbeat & Automation
Agents That Work While You Sleep
Not all agent work happens in a chat window. CollectHive’s target architecture has four layers of autonomous execution, each with appropriate scope and constraints. The Amber Monitor already runs basic collection and analysis via launchd, but the full per-user and per-project heartbeat system described here is planned, not yet built.
Four Execution Layers (Target Design)
Chat — Human in the Loop
The standard interactive mode. You talk, the agent responds. Full access to your memory pool and inherited hive knowledge. No constraints because you’re watching.
User Heartbeat — Daily Check-in (Planned)
A timer-driven agent that would review your scope once a day. It could read your memories and projects but not hive-scope sensitive data. It might surface stale memories for revalidation, flag things that need attention, or prepare a daily briefing.
Project Heartbeat — Per-Project Pulse (Planned)
A configurable timer scoped to a single project. It would read the project’s memories plus inherited user/hive memories. Useful for monitoring a deployed app, checking CI status, or reviewing recent changes.
Cron Job — Scheduled Task (Planned)
A one-shot or recurring task on a schedule expression. Would run in an isolated session with project-scope access. Fully audited. Good for generating reports, running health checks, or syncing data.
The Key Constraint
In the target design, heartbeats and cron jobs would read from their scope and all parent scopes. They’d write only to their own scope level. Promotion across scope boundaries would always be an explicit human action. No autonomous agent could push knowledge into hive scope.
This prevents feedback loops (bad memory, more bad memories) and ensures the promotion bridge stays human-controlled.
Technical Detail — Execution Layer Comparison
| Layer | Trigger | Memory Access | Can Write To | Constraints |
|---|---|---|---|---|
| Chat | Human message | Full user pool + inherited hive | User + project scope | None (human in loop) |
| User heartbeat | Daily timer | User scope only (no hive sensitive) | User scope | Action budget, circuit breaker |
| Project heartbeat | Configurable timer | Project scope + user inheritance | Project scope | Action budget, no promotion |
| Cron job | Schedule expression | Isolated session, project scope | Project scope | One-shot or recurring, audited |
Action budgets would limit how many write operations a heartbeat can perform per cycle. Circuit breakers would halt execution if the agent encounters errors or unexpected state — it stops and reports rather than retrying blindly.
These patterns are adapted from OpenClaw’s proven heartbeat model, with scope isolation added for multi-tenant operation.