Skip to main content
The [[agents]] array defines individual agents. Each agent inherits settings from [defaults] but can override any value.

Agent Definition

id
string
required
Unique identifier for the agent. Used in bindings and API calls.
[[agents]]
id = "support"
default
boolean
default:"false"
Whether this agent is the default. The default agent handles messages that don’t match any binding.Only one agent can be marked as default.
[[agents]]
id = "main"
default = true
display_name
string
Human-readable name shown in the UI and topology graph.
[[agents]]
id = "support"
display_name = "Support Bot"
role
string
Description of the agent’s role (e.g., “handles tier 1 support”). Shown in the UI.
[[agents]]
id = "support"
role = "Handles customer support inquiries"
workspace
string
Custom workspace directory path. If not set, defaults to ~/.spacebot/agents/{id}/workspace.
[[agents]]
id = "dev"
workspace = "/home/user/projects/dev-workspace"

Routing Overrides

routing
object
Override model routing for this agent. See Routing Configuration for details.
[[agents]]
id = "coding"
routing = { worker = "anthropic/claude-sonnet-4" }

Concurrency Settings

max_concurrent_branches
integer
default:"5"
Maximum number of branches this agent can run simultaneously.
[[agents]]
id = "research"
max_concurrent_branches = 10
max_concurrent_workers
integer
default:"5"
Maximum number of workers this agent can run simultaneously.
[[agents]]
id = "coding"
max_concurrent_workers = 3

Turn Limits

max_turns
integer
default:"5"
Maximum LLM turns per channel interaction. The channel process typically uses 1-3 turns.
[[agents]]
id = "main"
max_turns = 10
branch_max_turns
integer
default:"50"
Maximum LLM turns per branch. Branches can iterate many times.
[[agents]]
id = "research"
branch_max_turns = 100

Context Settings

context_window
integer
default:"128000"
Context window size in tokens. Used for compaction thresholds.
[[agents]]
id = "main"
context_window = 200000
compaction
object
Compaction threshold overrides.
[[agents]]
id = "main"
compaction = { background_threshold = 0.75, aggressive_threshold = 0.85 }

Memory Settings

memory_persistence
object
Auto-branching memory persistence configuration.
[[agents]]
id = "main"
memory_persistence = { enabled = true, message_interval = 30 }

Message Handling

coalesce
object
Message coalescing configuration for rapid-fire messages.
[[agents]]
id = "chat"
coalesce = { debounce_ms = 2000, max_wait_ms = 6000 }

File Ingestion

ingestion
object
File-based memory ingestion configuration.
[[agents]]
id = "docs"
ingestion = { enabled = true, poll_interval_secs = 60, chunk_size = 8000 }

System Configuration

cortex
object
Cortex (system observer) configuration.
warmup
object
Warmup configuration for background model loading.

Tool Configuration

browser
object
Browser automation configuration for workers.
[[agents]]
id = "research"
browser = { enabled = true, headless = false }
mcp
array
MCP server configuration for this agent. See MCP Configuration for details.
[[agents]]
id = "dev"

[[agents.mcp]]
name = "filesystem"
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
brave_search_key
string
Brave Search API key for web search tool. Overrides the default setting. Supports env:VAR_NAME.
[[agents]]
id = "research"
brave_search_key = "env:BRAVE_SEARCH_API_KEY"

Timezone Settings

cron_timezone
string
Timezone for cron active-hours evaluation (e.g., America/New_York). Falls back to SPACEBOT_CRON_TIMEZONE env var or system local time.
[[agents]]
id = "support"
cron_timezone = "America/New_York"
user_timezone
string
Timezone for channel/worker temporal context (e.g., Europe/London). Falls back to SPACEBOT_USER_TIMEZONE env var, cron_timezone, or system local time.
[[agents]]
id = "assistant"
user_timezone = "Europe/London"

Cron Jobs

cron
array
Scheduled tasks for this agent.
[[agents]]
id = "monitor"

[[agents.cron]]
id = "daily_summary"
prompt = "Generate a daily activity summary"
cron_expr = "0 9 * * *"  # Every day at 9 AM
delivery_target = "discord:987654321"
active_start_hour = 8
active_end_hour = 18

Examples

Basic Agent

[[agents]]
id = "main"
default = true
display_name = "Main Assistant"
role = "General purpose assistant"

Agent with Custom Routing

[[agents]]
id = "coding"
display_name = "Code Assistant"
role = "Handles coding tasks"

[agents.routing]
worker = "anthropic/claude-sonnet-4"
branch = "anthropic/claude-sonnet-4"

[agents.routing.task_overrides]
coding = "anthropic/claude-sonnet-4"

Agent with High Concurrency

[[agents]]
id = "research"
display_name = "Research Bot"
max_concurrent_branches = 20
max_concurrent_workers = 10
branch_max_turns = 100

Agent with Custom Workspace

[[agents]]
id = "dev"
display_name = "Dev Assistant"
workspace = "/home/user/projects/dev-workspace"
brave_search_key = "env:BRAVE_SEARCH_API_KEY"

[[agents.mcp]]
name = "filesystem"
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]

Agent with Scheduled Tasks

[[agents]]
id = "monitor"
display_name = "System Monitor"
cron_timezone = "America/New_York"

[[agents.cron]]
id = "hourly_check"
prompt = "Check system status and report any issues"
interval_secs = 3600
delivery_target = "discord:123456789"
active_start_hour = 8
active_end_hour = 18

[[agents.cron]]
id = "daily_summary"
prompt = "Generate daily activity summary"
cron_expr = "0 17 * * *"  # 5 PM every day
delivery_target = "discord:123456789"

Build docs developers (and LLMs) love