Skip to content

Configuration Reference

RivetOS uses a single YAML config file for all settings. API keys and secrets go in .env, never in the config file.

Config file locations (checked in order):

  1. --config CLI flag
  2. ./config.yaml (current directory)
  3. ~/.rivetos/config.yaml

Validate without starting: rivetos config validate


Quick Example

runtime:
workspace: ./workspace
default_agent: opus
agents:
opus:
provider: anthropic
default_thinking: medium
providers:
anthropic:
model: claude-sonnet-4-20250514
max_tokens: 8192
channels:
discord:
channel_bindings:
"123456789": opus
memory:
postgres: {}

Environment Variable Resolution

Any string value can reference environment variables with ${VAR_NAME}:

providers:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
memory:
postgres:
connection_string: ${RIVETOS_PG_URL}

Unset variables resolve to empty strings. Recommended: put all secrets in .env and reference them.


runtime

Top-level runtime configuration.

KeyTypeDefaultDescription
workspacestringrequiredPath to workspace directory containing CORE.md, USER.md, etc.
default_agentstringrequiredAgent to use when no channel binding matches. Must match a key in agents.
max_tool_iterationsnumber100Maximum tool call iterations per turn. Safety cap to prevent runaway loops.
skill_dirsstring[][]Directories to scan for skills (in addition to built-in skills/).
plugin_dirsstring[][]Additional directories to scan for plugins beyond the default plugins/.

runtime.heartbeats

Array of scheduled agent tasks. Each heartbeat triggers the agent periodically.

runtime:
heartbeats:
- agent: opus
schedule: "*/30 * * * *" # Every 30 minutes
prompt: "Check for unread emails and calendar events."
output_channel: discord:123456789
timezone: America/New_York
quiet_hours:
start: 23
end: 8
KeyTypeDefaultDescription
agentstringrequiredWhich agent runs this heartbeat. Must match a key in agents.
schedulestringrequiredCron expression (e.g., */30 * * * * = every 30 min).
promptstringrequiredThe message sent to the agent on each heartbeat tick.
output_channelstringChannel to deliver output (format: platform:channel_id).
timezonestringUTCTimezone for schedule evaluation.
quiet_hours.startnumberHour (0-23) to start quiet period (no heartbeats).
quiet_hours.endnumberHour (0-23) to end quiet period.

runtime.coding_pipeline

Configuration for the multi-agent build → review → validate coding loop.

runtime:
coding_pipeline:
builder_agent: grok
validator_agent: opus
max_build_loops: 3
max_validation_loops: 2
auto_commit: true
KeyTypeDefaultDescription
builder_agentstringAgent that writes code. Must match a key in agents.
validator_agentstringAgent that reviews code. Must match a key in agents.
max_build_loopsnumber3Max build-fix iterations before giving up.
max_validation_loopsnumber2Max validation rounds per build.
auto_commitbooleantrueAuto-commit on successful validation.

runtime.fallbacks

Provider fallback chains. When a provider fails (429, 503, timeout), try the next one.

runtime:
fallbacks:
- providerId: anthropic
fallbacks:
- "google:gemini-2.5-pro"
- "xai:grok-3"
KeyTypeDescription
providerIdstringPrimary provider ID.
fallbacksstring[]Ordered list of fallback providers. Format: provider_id or provider_id:model.

runtime.safety

Safety hooks configuration.

runtime:
safety:
shellDanger: true
audit: true
workspaceFence:
allowedDirs:
- /home/user/projects
- /tmp
alwaysAllow:
- /usr/bin
tools:
- shell
- file_write
- file_edit
KeyTypeDefaultDescription
shellDangerbooleantrueBlock dangerous shell commands (rm -rf /, etc.).
auditbooleantrueLog all tool executions to audit log.
workspaceFenceobjectRestrict file/shell operations to specific directories.
workspaceFence.allowedDirsstring[]required if fence enabledDirectories the agent can access.
workspaceFence.alwaysAllowstring[][]Paths always allowed regardless of fence.
workspaceFence.toolsstring[]all toolsWhich tools the fence applies to.

runtime.auto_actions

Automatic post-tool actions. Run after tool executions complete.

runtime:
auto_actions:
format: true
lint: false
test: false
gitCheck: true
KeyTypeDefaultDescription
formatbooleanfalseAuto-format files after edits.
lintbooleanfalseAuto-lint files after edits.
testbooleanfalseAuto-run tests after code changes.
gitCheckbooleanfalseCheck git status after file operations.

agents

Named agent definitions. Each agent maps to a provider and has optional configuration.

agents:
opus:
provider: anthropic
default_thinking: medium
fallbacks:
- "google:gemini-2.5-pro"
tools:
exclude:
- shell
grok:
provider: xai
local:
provider: ollama
local: true
KeyTypeDefaultDescription
providerstringrequiredProvider ID. Must match a key in providers.
default_thinkingstringoffDefault thinking level: off, low, medium, high.
fallbacksstring[][]Provider fallback chain for this agent specifically.
localbooleanfalseIf true, uses extended workspace context (includes CAPABILITIES.md, daily notes). Use for local models where tokens are free.
tools.excludestring[][]Tool names to block for this agent.
tools.includestring[]allIf set, only these tools are available to this agent.

providers

LLM provider configuration. Each key is a provider ID referenced by agents.

Anthropic

providers:
anthropic:
model: claude-sonnet-4-20250514
max_tokens: 8192
KeyTypeDefaultDescription
modelstringclaude-sonnet-4-20250514Model identifier.
max_tokensnumber8192Maximum output tokens.
api_keystring${ANTHROPIC_API_KEY}API key. Prefer env var.
temperaturenumberSampling temperature (0-1).

Auth: Set ANTHROPIC_API_KEY in .env, or use OAuth: rivetos login

xAI (Grok)

providers:
xai:
model: grok-3
KeyTypeDefaultDescription
modelstringgrok-3Model identifier.
api_keystring${XAI_API_KEY}API key.
max_tokensnumber4096Maximum output tokens.
temperaturenumberSampling temperature.
live_searchbooleanEnable Grok’s live search.

Google (Gemini)

providers:
google:
model: gemini-2.5-pro
KeyTypeDefaultDescription
modelstringgemini-2.5-proModel identifier.
api_keystring${GOOGLE_API_KEY}API key.
max_tokensnumber8192Maximum output tokens.

Ollama

providers:
ollama:
model: qwen2.5:32b
base_url: http://localhost:11434
KeyTypeDefaultDescription
modelstringrequiredModel name (must be pulled locally).
base_urlstringhttp://localhost:11434Ollama API endpoint.
temperaturenumberSampling temperature.
num_ctxnumberContext window size.

OpenAI-Compatible

Works with llama-server, vLLM, LM Studio, OpenRouter, Together AI, etc.

providers:
llama-server:
base_url: http://localhost:8000/v1
model: local-model
KeyTypeDefaultDescription
base_urlstringrequiredAPI endpoint (must end with /v1).
modelstringrequiredModel identifier sent with requests.
api_keystringAPI key (if required by the endpoint).
max_tokensnumber4096Maximum output tokens.
temperaturenumberSampling temperature.

channels

Messaging channel configuration. Each key is a channel ID.

Discord

channels:
discord:
channel_bindings:
"123456789012345678": opus
"987654321098765432": grok
owner_id: "111222333444555666"
KeyTypeDefaultDescription
channel_bindingsobjectrequiredMaps Discord channel IDs to agent names.
owner_idstringDiscord user ID for owner-only features.
bot_tokenstring${DISCORD_BOT_TOKEN}Bot token. Prefer env var.

Setup: Create a bot at discord.com/developers, copy the token, invite the bot to your server.

Telegram

channels:
telegram:
owner_id: "123456789"
KeyTypeDefaultDescription
owner_idstringrequiredTelegram user ID. Only this user can talk to the bot.
bot_tokenstring${TELEGRAM_BOT_TOKEN}Bot token from @BotFather.

Agent (HTTP)

Inter-agent communication channel. Enables delegation between agents and mesh networking.

channels:
agent:
port: 3100
secret: ${RIVETOS_AGENT_SECRET}
KeyTypeDefaultDescription
portnumber3100HTTP port for agent-to-agent messaging.
secretstringShared secret for authenticating peer agents.

memory

Memory backend configuration. Currently supports PostgreSQL.

PostgreSQL

memory:
postgres:
connection_string: ${RIVETOS_PG_URL}
KeyTypeDefaultDescription
connection_stringstring${RIVETOS_PG_URL}PostgreSQL connection URL.

Required extensions: pgvector (for embedding storage and similarity search).

The memory plugin handles schema creation and migration automatically on first boot.


mcp

Model Context Protocol server connections. RivetOS can connect to MCP servers and expose their tools to agents.

mcp:
servers:
memory:
transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-memory"]
toolPrefix: mcp_memory
github:
transport: streamable-http
url: http://localhost:8080/mcp
connectTimeout: 5000
autoReconnect: true

MCP Server Config

KeyTypeDefaultDescription
transportstringrequiredstdio, streamable-http, or sse.
commandstringCommand to launch (stdio transport).
argsstring[][]Command arguments (stdio transport).
envobject{}Environment variables for the spawned process.
cwdstringWorking directory for the spawned process.
urlstringServer URL (HTTP/SSE transport).
toolPrefixstringPrefix for tool names (prevents collisions between servers).
connectTimeoutnumber10000Connection timeout in milliseconds.
autoReconnectbooleantrueAuto-reconnect on disconnect.

deployment

Optional. When present, drives containerized deployment via rivetos infra up.

deployment:
target: docker
datahub:
postgres: true
shared_storage: true
shared_mount_path: /shared
image:
build_from_source: true
docker:
network: rivetos-net
postgres_port: 5432

Top-Level

KeyTypeDefaultDescription
targetstringrequireddocker, proxmox, kubernetes, or manual.

deployment.datahub

KeyTypeDefaultDescription
postgresbooleantrueInclude PostgreSQL in the datahub container.
postgres_versionstring16PostgreSQL major version.
shared_storagebooleantrueCreate shared storage volume.
shared_mount_pathstring/sharedMount path for shared storage inside containers.

deployment.image

KeyTypeDefaultDescription
build_from_sourcebooleantrueBuild container images from local source tree.
registrystringContainer registry for pre-built images (e.g., ghcr.io/philbert440).
agent_imagestringrivetos-agentAgent image name.
datahub_imagestringrivetos-datahubDatahub image name.
tagstringlatestImage tag.

deployment.docker

KeyTypeDefaultDescription
networkstringrivetos-netDocker network name.
postgres_portnumber5432Host port for PostgreSQL.
project_namestringrivetosDocker Compose project name.

deployment.proxmox

KeyTypeDefaultDescription
api_urlstringProxmox API URL (e.g., https://10.4.20.1:8006).
nodesarrayNode definitions (see below).
network.bridgestringvmbr0Network bridge.
network.subnetstringSubnet for container IPs.
network.gatewaystringDefault gateway.

Node definition:

KeyTypeDescription
namestringNode name (e.g., pve1).
hoststringNode IP or hostname.
rolestringdatahub, agents, or both.
ctid_startnumberStarting container ID.

deployment.kubernetes

KeyTypeDefaultDescription
namespacestringrivetosKubernetes namespace.
storage_classstringStorage class for PVCs.
resources.cpustring500mCPU request per agent pod.
resources.memorystring512MiMemory request per agent pod.

Environment Variables

These are typically set in .env:

VariableUsed ByDescription
ANTHROPIC_API_KEYprovider-anthropicAnthropic API key
XAI_API_KEYprovider-xaixAI API key
GOOGLE_API_KEYprovider-googleGoogle AI API key
DISCORD_BOT_TOKENchannel-discordDiscord bot token
TELEGRAM_BOT_TOKENchannel-telegramTelegram bot token
RIVETOS_PG_URLmemory-postgresPostgreSQL connection string
RIVETOS_AGENT_SECRETchannel-agentShared secret for agent mesh
RIVETOS_LOG_LEVELcoreLog level: error, warn, info, debug
RIVETOS_LOG_FORMATcoreLog format: pretty (default) or json
GOOGLE_CSE_IDtool-web-searchGoogle Custom Search Engine ID
GOOGLE_CSE_KEYtool-web-searchGoogle CSE API key
OPENAI_API_KEYmemory-postgres (embeddings)OpenAI API key for embeddings

Full Annotated Example

See config.example.yaml in the repository root for a complete annotated config file with all options commented.