Configuration Guide
Learn how to configure your Capsule Agent using YAML configuration files and environment variables.
Configuration File
Section titled “Configuration File”The primary configuration is done through agent.config.yaml, which should be mounted at /app/agent.config.yaml in the container.
You can also override the path with AGENT_CONFIG_FILE.
Workspace Seed Files
Section titled “Workspace Seed Files”You can copy files or directories into the agent workspace at startup:
workspaceFiles: - README.md - prompts/ - scripts/setup.shEntries are resolved relative to the config directory (or AGENT_CONFIG_FILE path).
They are copied into the workspace directory (default: /app/agent-workspace).
Basic Configuration
Section titled “Basic Configuration”Agent Settings
Section titled “Agent Settings”agent: name: My Agent description: A helpful assistant for specific tasks
# Model configuration model: name: openai/gpt-5-mini parameters: temperature: 0.7 max_tokens: 4000
# Built-in tools tools: exec: enabled: true memory: enabled: false read_file: enabled: true grep_files: enabled: true edit_file: enabled: true
# Built-in prompts builtInPrompts: enabled: trueModel Options
Section titled “Model Options”Supported AI providers and models:
OpenAI:
model: name: openai/gpt-5-mini # or: openai/gpt-5Anthropic:
model: name: anthropic/claude-sonnet-4-5 # or: anthropic/claude-sonnet-4-20250514Google:
model: name: google/gemini-2.5-flash # or: google/gemini-2.0-flashModel Parameters
Section titled “Model Parameters”Customize model behavior:
model: name: openai/gpt-5-mini parameters: temperature: 0.7 # Creativity (0-2) max_tokens: 4000 # Max response length top_p: 1.0 # Nucleus sampling (0-1) frequency_penalty: 0 # Reduce repetition (-2 to 2) presence_penalty: 0 # Encourage new topics (-2 to 2)Built-in Tools
Section titled “Built-in Tools”Control which capabilities your agent has access to:
Execution Tool
Section titled “Execution Tool”Execute shell commands in the agent’s container:
tools: exec: enabled: trueUse case: Running CLI tools, scripts, system commands
File Reading
Section titled “File Reading”Read files from the agent’s workspace:
tools: read_file: enabled: trueUse case: Viewing file contents, inspecting configurations
File Searching
Section titled “File Searching”Search file contents using regex patterns:
tools: grep_files: enabled: trueUse case: Finding specific code, searching logs
File Editing
Section titled “File Editing”Modify files in the agent’s workspace:
tools: edit_file: enabled: trueUse case: Making code changes, updating configurations
Memory
Section titled “Memory”Persistent memory across conversations:
tools: memory: enabled: trueUse case: Remembering user preferences, maintaining context
Note: Memory is disabled by default to reduce token usage.
Remote MCP Servers
Section titled “Remote MCP Servers”Connect to Model Context Protocol servers for additional capabilities. Server types can be http or sse:
Basic MCP Configuration
Section titled “Basic MCP Configuration”mcpServers: context7: type: http url: "https://mcp.context7.com/mcp" headers: Authorization: "Bearer ${CONTEXT_7_API_KEY}"
github: type: http url: "https://api.githubcopilot.com/mcp" headers: Authorization: "Bearer ${GITHUB_PAT}"Environment Variables in Config
Section titled “Environment Variables in Config”Use ${VAR} syntax to reference environment variables:
mcpServers: custom_mcp: type: http url: "${MCP_SERVER_URL}" headers: Authorization: "Bearer ${MCP_API_KEY}" Custom-Header: "${CUSTOM_VALUE:-default}"Syntax:
${VAR}- Expands to value (errors if not set)${VAR:-default}- Uses default if VAR not set
Multi-Agent Configuration (A2A)
Section titled “Multi-Agent Configuration (A2A)”Connect your agent to other A2A-compatible agents:
agent: name: Coordinator Agent description: Orchestrates specialized agents model: name: openai/gpt-5-mini
tools: memory: enabled: true
# Connect to other agents a2a: - name: research_agent agent_url: "http://agent-research:80" - name: writer_agent agent_url: "http://agent-writer:80"Multi-Agent Example
Section titled “Multi-Agent Example”docker-compose.yml:
services: research-agent: image: brycewcole/capsule-agents:latest ports: - "8001:9000" volumes: - ./research.config.yaml:/app/agent.config.yaml environment: - AGENT_URL=http://localhost:8001 env_file: - .env
writer-agent: image: brycewcole/capsule-agents:latest ports: - "8002:9000" volumes: - ./writer.config.yaml:/app/agent.config.yaml - ./shared-workspace:/app/agent-workspace environment: - AGENT_URL=http://localhost:8002 env_file: - .env
coordinator-agent: image: brycewcole/capsule-agents:latest ports: - "8003:9000" volumes: - ./coordinator.config.yaml:/app/agent.config.yaml environment: - AGENT_URL=http://localhost:8003 env_file: - .env depends_on: - research-agent - writer-agentScheduled Tasks
Section titled “Scheduled Tasks”Run tasks on a schedule using cron expressions:
schedules: - name: daily_report prompt: "Generate a daily summary report and save it to reports/" cron_expression: "0 9 * * *" # 9 AM daily enabled: true
- name: hourly_check prompt: "Check for new data and process it" cron_expression: "0 * * * *" # Every hour enabled: true backoff: enabled: true schedule: [300, 600, 1800] # Retry after 5min, 10min, 30min on failureOptional Schedule Fields
Section titled “Optional Schedule Fields” - name: daily_report context_id: "existing-context-id" # Reuse a context instead of creating a new one hooks: - type: discord webhookUrl: "https://discord.com/api/webhooks/your-webhook-url"Note: Changing cron_expression or backoff settings requires a server restart to
re-register the Deno cron job.
Cron Expression Format
Section titled “Cron Expression Format”┌───────────── minute (0 - 59)│ ┌───────────── hour (0 - 23)│ │ ┌───────────── day of month (1 - 31)│ │ │ ┌───────────── month (1 - 12)│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)│ │ │ │ │* * * * *Examples:
0 9 * * *- Daily at 9 AM0 */6 * * *- Every 6 hours0 0 * * 0- Weekly on Sunday at midnight30 14 1 * *- Monthly on the 1st at 2:30 PM
Integrate with external services for notifications. The only built-in hook today is Discord:
Discord Webhook
Section titled “Discord Webhook”agent: hooks: - type: discord enabled: true webhookUrl: "https://discord.com/api/webhooks/your-webhook-url"What gets sent:
- Task completion payloads (including artifacts and schedule metadata if applicable)
Environment Variables
Section titled “Environment Variables”Required Variables
Section titled “Required Variables”At least one AI provider API key and credentials for the editor/API:
OPENAI_API_KEY=sk-proj-...ANTHROPIC_API_KEY=sk-ant-...GOOGLE_GENERATIVE_AI_API_KEY=...ADMIN_PASSWORD=secure-password-hereAGENT_URL=http://localhost:8080The editor/API use HTTP Basic Auth with username admin and the ADMIN_PASSWORD you set.
Optional Variables
Section titled “Optional Variables”# Optional server port (default: 9000)PORT=9000
# Optional config path overrideAGENT_CONFIG_FILE=/app/agent.config.yaml
# Optional workspace directoryWORKSPACE_DIR=/app/agent-workspace
# Optional database path overrideDB_PATH=/app/data/sessions.db
# MCP Server credentialsCONTEXT_7_API_KEY=ctx7sk-...GITHUB_PAT=ghp_...
# Google Vertex AI configurationGOOGLE_GENAI_USE_VERTEXAI=FALSE
# OpenTelemetry (observability)OTEL_DENO=trueOTEL_SERVICE_NAME=capsule-apiOTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318OTEL_EXPORTER_OTLP_PROTOCOL=http/protobufDocker Configuration
Section titled “Docker Configuration”Basic Run
Section titled “Basic Run”docker run \ --env-file .env \ -e AGENT_URL=http://localhost:8080 \ -p 8080:9000 \ -v $(pwd)/agent.config.yaml:/app/agent.config.yaml \ -it brycewcole/capsule-agents:latestVolume Mounts
Section titled “Volume Mounts”Configuration:
-v $(pwd)/agent.config.yaml:/app/agent.config.yamlDatabase persistence:
-v $(pwd)/data:/app/dataShared workspace:
-v $(pwd)/workspace:/app/agent-workspaceCustom frontend:
-v $(pwd)/custom-frontend:/app/staticComplete Example Configurations
Section titled “Complete Example Configurations”GitHub Manager
Section titled “GitHub Manager”agent: name: Github Manager description: Manages GitHub repositories, issues, and PRs model: name: openai/gpt-5-mini
tools: exec: enabled: true read_file: enabled: true edit_file: enabled: true
mcpServers: context7: type: http url: "https://mcp.context7.com/mcp" headers: Authorization: "Bearer ${CONTEXT_7_API_KEY}"
github: type: http url: "https://api.githubcopilot.com/mcp" headers: Authorization: "Bearer ${GITHUB_PAT}"Coordinator Agent with Scheduling
Section titled “Coordinator Agent with Scheduling”agent: name: Coordinator Agent description: Orchestrates research and writing tasks model: name: anthropic/claude-sonnet-4-5
tools: memory: enabled: true exec: enabled: true
a2a: - name: research_agent agent_url: "http://agent-research:80" - name: writer_agent agent_url: "http://agent-writer:80" hooks: - type: discord enabled: true webhookUrl: "${DISCORD_WEBHOOK_URL}"
schedules: - name: daily_summary prompt: "Use research_agent to gather latest updates, then writer_agent to create a summary" cron_expression: "0 9 * * *" enabled: true backoff: enabled: true schedule: [600, 1800, 3600]Validation and Defaults
Section titled “Validation and Defaults”The config file is validated on startup against the schema. A few behaviors to be aware of:
- If the configured model is missing or unavailable, the server auto-selects the best available model from the built-in registry.
- If no provider API keys are set, the server logs a warning and no model will be available until a provider key is configured.
- Environment variable expansion in the config file will error if
${VAR}is used and the variable is not set.
Check container logs for validation and startup warnings:
docker logs <container-id>Best Practices
Section titled “Best Practices”- Start simple - Begin with basic config, add features as needed
- Use environment variables - Never hardcode secrets in YAML
- Enable memory selectively - Only when context persistence is needed
- Test cron schedules - Use crontab.guru to validate expressions
- Monitor token usage - Disable unused tools to reduce costs
- Backup data volume - Persist
/app/datafor chat history and memory
Next Steps
Section titled “Next Steps”- Explore example configurations
- Learn about the A2A protocol
- Review examples