proactive_agent
proactive_agent
¶
Proactive Agent — runs on a cron (default 5am local) to autonomously handle routine tasks based on learned user behavior.
Lifecycle per run
- Load USER.md + MEMORY.md for behavioral context.
- Collect overnight data from connected sources via
digest_collect. - Use the LLM to classify each item and propose actions with a tier + permission key.
- For each proposed action:
- TRIVIAL tier → queue + immediately approve
- Known always_approve → queue + immediately approve
- Known always_deny → skip silently
- Everything else → queue as pending, notify user
- Execute all approved actions via
execute_pending_actions. - Send the user a concise summary: what was done + numbered list of what needs approval.
Approval reply format (user replies to the notification message):
{action_id} yes approve one action
{action_id} no deny one action
always yes {action_id} approve + remember for this pattern
always no {action_id} deny + remember for this pattern
yes all / no all bulk decision
Wire up parse_approval_response from proactive_tools in your channel
message handler to process replies without running the full agent.
Scheduling
The agent self-registers a 5am daily cron task when register_cron is
called from your app startup:
from openjarvis.agents.proactive_agent import register_cron
register_cron(scheduler, notification_channel_id="your-channel-id")
Classes¶
ProactiveAgent
¶
Bases: ToolUsingAgent
Autonomous agent that handles routine tasks based on learned user behavior.
Source code in src/openjarvis/agents/proactive_agent.py
Functions¶
register_cron
¶
register_cron(scheduler: Any, *, notification_channel_id: str = '', cron_expr: str = '', hours_back: int = 0, timezone: str = '') -> Any
Register the proactive agent as a daily cron task.
All defaults are read from config.toml [proactive] when not explicitly
passed. Call this once from app startup after the scheduler is started.
| PARAMETER | DESCRIPTION |
|---|---|
scheduler
|
A
TYPE:
|
notification_channel_id
|
Override the channel ID from config. If empty, uses
TYPE:
|
cron_expr
|
Override the cron schedule. Defaults to config value (
TYPE:
|
hours_back
|
Override hours of data to scan. Defaults to config value (24).
TYPE:
|
timezone
|
Override timezone string. Defaults to config value.
TYPE:
|