A Rust-based multi-agent system featuring a mail system, CRON schedules, and Zettelkasten-style knowledge base with Markdown support.
Features
- Runs on PostgreSQL: the best db ;)
- Multi-Agent System: Create and manage agents with status tracking
- Mail System: Agents can send and receive messages via mailboxes
- CRON Schedules: Schedule recurring tasks with automatic triggering — agents can manage their own schedules via CLI or web interface
- Knowledge Base: Zettelkasten-style notes with Markdown support and Luhmann addressing (1, 1a, 1a1)
- Web Interface: HTMX-based UI for browsing agents, mail, schedules, and knowledge base
- Onboarding: Built-in guide for new AI agents with
how-we-workcommand
Quick Start
# Set up database (human-only)
# Register agents
# Send mail
# Start web server (human-only)
# For new agents: learn how to work
🤖 Running AI Agents with opencode
The agent run command continuously monitors for new mail and scheduled tasks, automatically triggering your AI agent when either occurs:
# Run agent and have opencode process events (mail or schedules) when they occur
# Note: Use single quotes to prevent shell from expanding $AGENT_OFFICE_SESSION
# Check every 30 seconds (default is 60)
# Test the session variable
Environment Variables: When the bash command is executed, two environment variables are set:
AGENT_OFFICE_SESSION: Set to{agent_id}-session(e.g.,my-agent-session) for consistent session trackingAGENT_OFFICE_EVENT: A description of what triggered the execution:- For mail:
agent id "my-agent" has unread mail - For schedules:
agent id "my-agent" received a scheduled action request "action description"
- For mail:
Important: Always use single quotes around the bash command to prevent your shell from expanding environment variables before they reach the agent.
⏰ Managing Schedules
CRON schedules allow agents to be automatically triggered at specific times (e.g., daily reports, periodic health checks):
# Create a daily schedule for an agent
# Create a schedule that fires every 5 minutes
# List all schedules for an agent
# Get details of a specific schedule
# Update a schedule (change CRON or action)
# Toggle schedule on/off
# Delete a schedule
CRON Format: minute hour day month weekday (e.g., 0 9 * * * = daily at 9am, */5 * * * * = every 5 minutes)
Web UI: Visit /agents/{agent_id}/schedule to manage schedules visually with last run tracking.
Agent Configuration: Create your agent at ~/.config/opencode/agents/my-agent.md with full permissions using YAML front matter:
description: Autonomous agent for Agent Office system
mode: primary
permission:
bash:
edit: allow
write: allow
read: allow
external_directory:
webfetch: allow
websearch: allow
task: allow
Your agent ID is: my-agent
The first thing you should do is execute `agent-office how-we-work` to understand how we work.
This enables fully autonomous agent workflows where your AI agent:
- Waits for incoming messages
- Automatically processes them when they arrive
- Can respond, take actions, or escalate as needed
Configuration
Set AGENT_OFFICE_URL environment variable or use .env file in the folder your agentic coding CLI runs:
AGENT_OFFICE_URL=postgresql://agent:agent123@localhost:5432/agent_office
Options
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
Web Interface
Visit http://127.0.0.1:8080 to:
- View all agents and their status
- Browse agent inboxes and outboxes with message subjects
- Manage CRON schedules for each agent with last run tracking
- Browse the knowledge base with Markdown rendering
- Set agents offline with one click
- Mobile-friendly responsive design
License
MIT