Skip to main content

Configuration

Chronos agents are configured via YAML. This page describes the config file layout, search order, and all supported options.

Config file search order

The CLI and agent.LoadFile("") look for config in this order:

  1. CHRONOS_CONFIG — If set, use this path. Overrides all other locations.
  2. .chronos/agents.yaml — Project-level config (current directory).
  3. agents.yaml — Config in the current directory.
  4. ~/.chronos/agents.yaml — User-level global config.

Both .yaml and .yml extensions are supported. Configuration parsing is strict: unknown fields, duplicate agent IDs, invalid permission modes, and invalid reasoning settings return a path-aware error instead of being ignored. Validate without running an agent:

chronos -c ./agents.yaml config validate
# Configuration is valid: 2 agent(s), 1 team(s).

To force a specific file:

export CHRONOS_CONFIG=/path/to/agents.yaml
chronos repl

Full YAML structure

defaults:
model:
provider: openai
model: gpt-5.5
api_key: ${OPENAI_API_KEY}
base_url: ""
org_id: ""
timeout_sec: 60
# Azure-specific:
endpoint: ""
deployment: ""
api_version: "2024-06-01"
storage:
backend: sqlite
dsn: chronos.db
system_prompt: ""
num_history_runs: 0
stream: true
debug: false
tracing: false
permission_mode: prompt # prompt, auto_approve, deny
reasoning:
strategy: none # none, cot, reflection
native: false
effort: "" # low, medium, high when native: true
budget_tokens: 0
summary: false
context:
max_tokens: 0
summarize_threshold: 0.8
preserve_recent_turns: 5

agents:
- id: my-agent
name: My Agent
description: Optional description
model:
provider: openai
model: gpt-5.5
api_key: ${OPENAI_API_KEY}
base_url: ""
org_id: ""
timeout_sec: 60
endpoint: ""
deployment: ""
api_version: ""
storage:
backend: sqlite
dsn: chronos.db
system_prompt: |
Your system prompt here.
instructions:
- Additional instruction 1
- Additional instruction 2
tools:
- name: file_read
permission: allow # allow, require_approval, deny
- name: file_write
permission: require_approval
requires_confirmation: false
capabilities: []
mcp_servers: [] # Model Context Protocol servers (see guide)
sub_agents: []
output_schema: {}
num_history_runs: 0
stream: true # CLI/REPL default; flags can override
debug: false
tracing: false
permission_mode: prompt # prompt, auto_approve, deny
reasoning:
strategy: none
native: false
effort: ""
budget_tokens: 0
summary: false
context:
max_tokens: 0
summarize_threshold: 0.8
preserve_recent_turns: 5

teams:
- id: my-team
name: My Team
strategy: sequential # sequential, parallel, router, coordinator
agents: # agent IDs (order matters for sequential)
- agent-1
- agent-2
coordinator: "" # agent ID (coordinator strategy only)
max_concurrency: 0 # parallel strategy; 0 = unbounded
max_iterations: 1 # coordinator strategy; planning loops
error_strategy: "" # fail_fast, collect, best_effort

ModelConfig

FieldDescription
providerOne of: openai, anthropic, gemini, mistral, ollama, azure, groq, together, deepseek, openrouter, fireworks, perplexity, anyscale, compatible
modelModel ID (e.g., gpt-5.5, claude-opus-4-8, llama3.3)
api_keyAPI key; supports ${VAR} expansion
base_urlCustom base URL for compatible providers
org_idOpenAI organization ID
timeout_secRequest timeout in seconds
endpointAzure resource endpoint
deploymentAzure deployment name
api_versionAzure API version (e.g., 2024-06-01)

Agent runtime fields

FieldDescription
streamPreferred CLI response mode. true streams tokens; false waits for the complete response. --stream / --no-stream override it.
debugEmit detailed agent execution logs to stderr.
tracingPersist model, tool, and graph spans through the agent's configured storage.
permission_modeprompt, auto_approve, or deny for approval-gated tools. Explicit tool deny is never bypassed.
reasoning.strategyPrompt strategy: none, cot, or reflection.
reasoning.nativeEnable provider-native reasoning/thinking where supported.
reasoning.effortNative reasoning effort (low, medium, high) for providers that expose it.
reasoning.budget_tokensThinking-token budget for Anthropic/Gemini-style APIs.
reasoning.summaryMake provider-approved reasoning output available separately from answer content and display streaming reasoning on CLI stderr.

Tool configuration

Each tools entry supports name, description, parameters, and these policy fields:

FieldDescription
permissionallow, require_approval, or deny. When omitted, the built-in tool's safe default is preserved.
requires_confirmationExplicitly require or remove a confirmation gate.
requires_user_inputAsk the registered user-input handler before execution.

See Tools & Function Calling and CLI Runtime Controls.

StorageConfig

FieldDescription
backendsqlite or postgres
dsnConnection string or file path (e.g., chronos.db for SQLite)

Server storage environment variables

chronos serve (ChronosOS) selects its storage backend from environment variables. The server uses exactly one backend at a time.

VariableValues / examplePurpose
CHRONOS_STORAGE_BACKENDsqlite (default), postgres, redisWhich storage backend the server uses
CHRONOS_DB_PATHchronos.dbSQLite file path (when backend = sqlite)
CHRONOS_STORAGE_DSNpostgres://user:pass@host:5432/chronos?sslmode=disablePostgres connection string (when backend = postgres)
CHRONOS_REDIS_URLredis://host:6379/0Redis connection URL (when backend = redis)

:::note Redis is a storage backend only When CHRONOS_STORAGE_BACKEND=redis, Redis is used only as a durable-storage backend. It is not used for scheduling or rate limiting. :::

Shared state (scheduler + rate limiter)

CHRONOS_SHARED_STATE controls whether the server uses store-backed shared coordination: a scheduler where each cron job fires exactly once across all replicas, and a cluster-wide SQL rate limiter.

BackendDefaultBehaviour
postgresonStore-backed exactly-once scheduler + shared SQL rate limiter, automatically. Set CHRONOS_SHARED_STATE=false to opt out.
sqliteoffSingle-node. Set CHRONOS_SHARED_STATE=true to enable it.
redisn/aNever gets the shared scheduler or rate limiter, regardless of this value.

For a ready-to-run local Postgres stack, see Local Development.

MCP servers (mcp_servers)

Each entry connects the agent to a Model Context Protocol server whose tools are imported into the registry when ConnectMCP is called.

FieldDescription
nameLogical server name (used in error messages)
transportstdio (default) or sse (planned)
commandExecutable to launch for stdio (e.g., npx, uvx); supports ${VAR}
argsArguments passed to the command; each supports ${VAR}
urlEndpoint for SSE transport; supports ${VAR}
mcp_servers:
- name: filesystem
transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "."]

See the MCP guide for the full workflow.

TeamConfig

FieldDescription
idUnique team identifier (used in team run)
nameDisplay name
strategysequential, parallel, router, or coordinator
agentsList of agent IDs (order matters for sequential)
coordinatorAgent ID for the coordinator strategy
max_concurrencyMax parallel goroutines (parallel strategy); 0 = unbounded
max_iterationsMax coordinator planning loops; default 1
error_strategyfail_fast, collect, or best_effort (parallel strategy)

Context management

Control context window behavior and summarization:

FieldDescriptionDefault
context.max_tokensOverride model default; 0 = use model default0
context.summarize_thresholdFraction of context window that triggers summarization0.8
context.preserve_recent_turnsNumber of recent user/assistant pairs to keep5

Environment variable expansion

All string values support ${VAR} syntax. Unset variables expand to empty strings.

agents:
- id: dev
model:
api_key: ${OPENAI_API_KEY}
storage:
dsn: ${CHRONOS_DB_PATH}

Defaults inheritance

Values in defaults cascade to every agent. Agents override only the fields they specify.

defaults:
model:
provider: openai
api_key: ${OPENAI_API_KEY}
storage:
backend: sqlite
dsn: chronos.db
system_prompt: You are a helpful assistant.
context:
summarize_threshold: 0.8
preserve_recent_turns: 5

agents:
- id: dev
name: Dev Agent
model:
model: gpt-5.5
system_prompt: You are a senior engineer.

- id: researcher
name: Research Agent
model:
provider: anthropic
model: claude-opus-4-8
api_key: ${ANTHROPIC_API_KEY}
  • dev inherits provider, api_key, storage, and context; overrides model and system_prompt.
  • researcher overrides provider, model, and api_key; inherits storage and context.

Supported providers

ProviderDescription
openaiOpenAI GPT-5.5, GPT-5, GPT-4o, o-series (o3, o4-mini)
anthropicClaude Opus 4.8, Sonnet 5, Haiku 4.5, Fable 5
geminiGoogle Gemini
mistralMistral AI
ollamaLocal Ollama (no API key)
azureAzure OpenAI
groqGroq
togetherTogether AI
deepseekDeepSeek
openrouterOpenRouter
fireworksFireworks AI
perplexityPerplexity
anyscaleAnyscale Endpoints
compatibleAny OpenAI-compatible endpoint (vLLM, TGI, LiteLLM, etc.)

Real-World Examples

For focused, runnable configurations organized by complexity, see the YAML Agent Examples learning path:

  • Simple — Single assistant, streaming, defaults, and local Ollama
  • Intermediate — Customer-support routing and sequential content pipelines
  • Advanced — Coordinator, parallel, swarm, and hierarchy teams
  • Production — Tool permissions, approvals, native reasoning, tracing, PostgreSQL, and sandbox deployment
  • Reference — Provider recipes plus CLI and team strategy commands