Skip to main content
Comis uses a single YAML file for configuration. If you used the setup wizard (comis init), it already created a working config. This guide explains what is in that file and how to customize it.
You don’t need to understand the technical details to use this feature. The configuration examples below are copy-paste ready.

Where config lives

When you set COMIS_CONFIG_PATHS, Comis reads config from that path instead of the default. You can point to multiple files using colon-separated paths (same convention as PATH):
Later files override values from earlier ones.

Minimal working config

This is the absolute minimum YAML that produces a working agent:
Everything else has sensible defaults. The gateway starts automatically on port 4766, logging is set to info level, and memory uses a local SQLite database. The API key is read from the .env file in your data directory — see Secrets and API Keys below.

Required: Agent configuration

Required: You must configure at least one agent with a name, provider, and model.
Every agent needs three fields:
Set ANTHROPIC_API_KEY in your .env file.
Never store API keys, tokens, or passwords directly in config.yaml. Use the .env file or Secret Manager for credential management.
The gateway enables the web dashboard and API access. It is enabled by default, but you can customize its settings.
The tokens section is optional. Without it, the gateway accepts unauthenticated requests on localhost. Add a token when you expose the gateway to a network.
Channels connect your agent to messaging platforms like Telegram, Discord, and Slack.
Here is an example with Telegram — the simplest channel to configure:
Set TELEGRAM_BOT_TOKEN in your .env file with the token from @BotFather.
Each platform has different settings. See the Channels section for step-by-step setup guides for all supported platforms.

Optional: Common settings

These settings have sensible defaults. Change them only when you need to.

Secrets and API keys

Comis resolves ${VAR_NAME} references in config values from environment variables or from the .env file in your data directory (~/.comis/.env by default). The setup wizard generates config with ${VAR} references and puts the actual values in .env. Here is a typical .env file:
Each provider has a standard environment variable name: For encrypted secret storage, run comis secrets init to set up the secrets vault. See Secrets Management for details.
Never store API keys, tokens, or passwords directly in config.yaml. Use the .env file or Secret Manager for credential management.

$include directive

Split your config into multiple files for organization:
The included file path is relative to the file that contains the $include directive. This is useful for separating channel credentials from the main config or sharing a base config across environments.

Validate your config

Check your config file for syntax errors and missing fields:
Expected output for a valid config:
If there are errors, you will see the specific field and issue:
To see the fully resolved config with all defaults filled in:

Context engine

The context engine manages what your agent sees each turn. The default mode is DAG. Most users do not need to change any context engine settings — the defaults work well.
~/.comis/config.yaml
The DAG mode (the dag engine version) — the Lossless Context DAG engine — is the default: version defaults to "dag" (set "pipeline" to opt into the simpler engine). DAG keeps the full faithful history losslessly (a verbatim fresh tail + transcript repair), zoomably compresses the oldest history under a token budget, and exposes the in-session ctx_* expansion tools. See Compaction for details.
See Config Reference for the complete list of all 27 context engine fields.

Advanced configuration

The config schema supports 41 top-level sections. This guide covered the essential ones. The remaining sections control memory, security, routing, scheduling, monitoring, plugins, and more.
For the complete reference of all configuration sections, see Config YAML Reference.

Next steps

Verify Installation

Run diagnostic commands to confirm everything is working.

Connect a Channel

Step-by-step guides for Telegram, Discord, Slack, and more.

Security

Understand the security protections built into Comis.

Config Reference

Complete reference for all 41 configuration sections.