Skip to content

Scheduled Actions

Schedule one-shot future actions that execute automatically with notifications.

Usage

In interactive mode, ask the agent to remind you:

ai-assist /interactive
You: Remind me in 2 hours to check the DCI job status for job-456

The agent schedules the action (a one-time action in ~/.ai-assist/event-schedules.json) → /monitor process executes it → You get notified.

Time Formats

  • in 2 hours, in 30 minutes, in 1 day
  • in 3h, in 15m, in 2d (short forms)
  • tomorrow at 9am
  • next monday 10:00

Notification Channels

Configured automatically by the agent based on your request:

  • desktop - System notifications (notify-send on Linux) - truncated to 500 chars
  • file - Append to ~/.ai-assist/notifications.log - full result
  • console - Display in /monitor output - full result
  • TUI - Auto-displayed in interactive mode - full result with Rich formatting

The agent decides the best execution strategy: - Simple reminders → Just sends notification (no agent query) - Data queries → Executes via agent, then notifies with results - Reports → Executes via agent, saves to file (optional notification)

How Actions Execute

Reminder-only actions (execute_query=False, stored with "reminder": true): - Send notification directly with your reminder message - No agent query executed (efficient for simple reminders) - Example: "Remind me in 1 hour to watch TV" → Shows "Time to watch TV"

Query/Report actions (execute_query=True, optionally create_report=True): - Execute the prompt via the agent - Results sent to notification channels and/or saved as report - Example: "Check failed jobs in 30 minutes and notify me" → Agent queries, notifies with results

Managing Actions

View scheduled actions:

jq '.actions[] | select(.trigger.type == "once")' ~/.ai-assist/event-schedules.json

Each one-time action is named after its description plus its scheduled time, so the same reminder can be scheduled again for another day.

Finished actions leave the schedule file: once a one-time action has run, it is moved to ~/.ai-assist/event-schedules-archive.jsonl (one JSON object per line, with status, archived_at and archive_reason: completed, failed or expired). An action whose time passed more than 24 hours ago without running (the /monitor process was down) can no longer run and is archived as expired.

jq -c '{name, status, archive_reason, archived_at}' ~/.ai-assist/event-schedules-archive.jsonl

View notification history:

tail -f ~/.ai-assist/notifications.log

Requirements

The /monitor process must be running:

ai-assist /monitor &

Or in tmux:

tmux new -d -s ai-assist-monitor 'ai-assist /monitor'

For desktop notifications (Linux):

sudo dnf install libnotify  # Fedora/RHEL
sudo apt install libnotify-bin  # Ubuntu/Debian

Periodic Task Notifications

Add notifications to actions in ~/.ai-assist/event-schedules.json:

{
  "monitors": [
    {
      "name": "critical-failures",
      "prompt": "Check for critical DCI failures",
      "interval": "1h",
      "notify": true,
      "notification_channels": ["desktop", "file"]
    }
  ]
}

Fields: - notify (boolean) - Enable notifications (default: false) - notification_channels (array) - List of channels (default: ["console"])

Troubleshooting

Actions not executing: Check /monitor is running:

ps aux | grep "ai-assist /monitor"

Desktop notifications not appearing:

which notify-send
notify-send "Test" "Test notification"

Action failed: Failures are sent as an error notification; see ~/.ai-assist/notifications.log.