Supyagent
Multi-Agent Workflows

Daemon Mode

Event-driven agents with scheduled polling, inbox processing, and the supyagent daemon command.

Daemon Mode

Daemon agents run in a continuous loop, waking up at configured intervals to process events from an AI inbox. They are designed for automated, unattended processing -- monitoring, notifications, scheduled tasks, and event-driven workflows.

Agent Type

Set type: daemon in the agent config:

agents/monitor.yaml
name: monitor
description: Monitors inbox events and responds automatically
type: daemon

model:
  provider: anthropic/claude-sonnet-4-5-20250929
  temperature: 0.3

system_prompt: |
  You are a monitoring agent. Each cycle, you receive inbox events to process.

  For each event:
  1. Determine the appropriate action
  2. Execute it using available tools
  3. Archive the event after processing

  Be concise — your responses are logged, not shown to a user.

schedule:
  interval: 5m
  max_events_per_cycle: 10

service:
  enabled: true

Schedule Configuration

The schedule block controls the daemon's polling behavior:

schedule:
  interval: 5m               # How often to wake up
  max_events_per_cycle: 10    # Max inbox events per cycle
  prompt: null                # Optional task to run each cycle
FieldTypeDefaultDescription
intervalstring"5m"Poll interval. Supports s (seconds), m (minutes), h (hours).
max_events_per_cycleint10Maximum number of inbox events to process per cycle (minimum: 1).
promptstring | nullnullOptional task to run each cycle even when there are no events.

Interval Examples

ValueMeaning
30sEvery 30 seconds
5mEvery 5 minutes
1hEvery hour
15mEvery 15 minutes

Running a Daemon

# Start the daemon
supyagent daemon monitor

# Override the interval
supyagent daemon monitor --interval 1m

# Run a single cycle and exit (for testing)
supyagent daemon monitor --dry-run

# Pass secrets inline
supyagent daemon monitor --secrets API_KEY=xxx

# Verbose output
supyagent daemon monitor --verbose

Command Options

OptionDescription
--intervalOverride the schedule interval from config
--dry-runRun one cycle and exit
--secretsPass secrets as KEY=VALUE pairs
--verbose, -vShow detailed cycle output

Processing Loop

Each cycle of the daemon follows this sequence:

1. Wake up
2. Fetch inbox events (up to max_events_per_cycle)
3. If events exist:
   a. Pass events to the agent as a user message
   b. Agent processes events using available tools
   c. Agent archives processed events
4. If scheduled prompt is configured (and no events):
   a. Run the scheduled prompt as a task
5. Sleep for interval duration
6. Repeat

AI Inbox Integration

Daemon agents work with the supyagent cloud inbox system. Events from connected integrations (emails, Slack messages, GitHub notifications, etc.) arrive in the inbox and are picked up by the daemon on each cycle.

The daemon uses the service integration to access inbox tools:

service:
  enabled: true

This provides inbox management tools:

  • Reading pending events
  • Archiving processed events
  • Filtering events by type or source

Scheduled Prompts

The prompt field lets you run a recurring task even when there are no inbox events:

schedule:
  interval: 1h
  prompt: "Check the monitoring dashboard and report any anomalies"

This is useful for periodic health checks, report generation, or proactive monitoring.

Automatic Prompt Augmentation

When an agent has type: daemon, supyagent automatically appends daemon-specific instructions to the system prompt:

## Daemon Mode

You are running as a daemon agent. Each time you wake up, you receive a batch of
inbox events to process.

Key behaviors:
- Process each event using your available tools
- Archive events after processing with the inbox archive tool
- Use memory to track patterns and important context across cycles
- Be concise in your responses — they are logged, not shown to a user
- If an event cannot be processed, note the issue and archive it anyway

You do not need to include these instructions in your system prompt -- they are injected automatically.

Memory Across Cycles

Daemon agents benefit significantly from the memory system. Enable it to track patterns and context across cycles:

memory:
  enabled: true
  extraction_threshold: 5
  retrieval_limit: 10
  auto_extract: true

Each cycle, the daemon can:

  • Remember recurring patterns (e.g., "this error keeps appearing every morning")
  • Track entities mentioned across events (e.g., "user X has submitted 3 tickets this week")
  • Build up contextual knowledge that informs future processing

Example: Email Processing Daemon

agents/email-processor.yaml
name: email-processor
description: Processes incoming emails and routes them to appropriate actions
type: daemon

model:
  provider: anthropic/claude-sonnet-4-5-20250929
  temperature: 0.3
  max_tokens: 4096

system_prompt: |
  You are an email processing agent. Each cycle, you receive new emails
  from the inbox.

  ## Processing Rules

  ### High Priority
  - Emails with "urgent" or "critical" in subject → process immediately
  - Emails from known VIP contacts → flag and summarize

  ### Standard Processing
  - Support requests → create a summary and archive
  - Newsletter/marketing → archive without action
  - Meeting invites → check calendar conflicts

  ## Output Format
  For each email processed, log:
  - From: [sender]
  - Subject: [subject]
  - Action: [what you did]
  - Priority: [high/normal/low]

schedule:
  interval: 5m
  max_events_per_cycle: 20

memory:
  enabled: true
  extraction_threshold: 3
  retrieval_limit: 15

service:
  enabled: true

delegation:
  share_credentials: true

limits:
  max_tool_calls_per_turn: 30

Example: Scheduled Report Daemon

A daemon that generates periodic reports even without inbox events:

agents/reporter.yaml
name: reporter
description: Generates scheduled reports from project data
type: daemon

model:
  provider: anthropic/claude-sonnet-4-5-20250929
  temperature: 0.3

system_prompt: |
  You are a reporting agent. Each cycle, analyze the project state
  and generate a concise status report.

  Focus on:
  - Recent changes (git log)
  - Test results
  - Open issues or TODOs

schedule:
  interval: 1h
  prompt: "Generate a project status report covering the last hour of activity"

tools:
  allow:
    - "shell:*"
    - "files:*"
    - "git:*"
    - "search:*"

Graceful Shutdown

The daemon handles SIGINT (Ctrl+C) and SIGTERM gracefully:

  1. Completes the current cycle (if mid-processing)
  2. Saves any pending memory extractions
  3. Exits cleanly
# Start in foreground
supyagent daemon monitor

# Press Ctrl+C to stop
# ^C
# Daemon stopped gracefully.

For production deployments, the daemon can be managed with systemd, supervisord, or Docker.