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 Later files override values from earlier ones.
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):Minimal working config
This is a minimal agent definition. It still needs a usable credential, OAuth profile, or local provider:The schema supplies defaults for the other sections. Logging defaults to
debug; the gateway defaults to loopback port 4766; local state uses SQLite.
Credentials are resolved through SecretManager, whose default writable
backend is the encrypted store.Required: Agent configuration
Every agent needs three fields:- Anthropic
- OpenAI
- Google
- Ollama (local)
comis secrets set ANTHROPIC_API_KEY, or provide
it through a protected environment variable.Recommended: Gateway
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.Recommended: Channels
Here is an example with Telegram — the simplest channel to configure:TELEGRAM_BOT_TOKEN with comis secrets set TELEGRAM_BOT_TOKEN, or
provide it through a protected environment variable, using 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 through SecretManager. New wizard
setups use security.storage: encrypted, place credential ciphertext in
~/.comis/secrets.db, and keep SECRETS_MASTER_KEY in the owner-readable
~/.comis/.env file. Back up that key separately; losing it makes the database
unrecoverable.
Plain environment variables and the file storage mode are explicit
alternatives. They do not provide the encrypted store’s at-rest protection.
Common static-key providers use these names. See Environment Variables for the complete catalog, aliases, and multi-value provider requirements.
The wizard initializes encrypted storage automatically. For a manual setup, run
comis secrets init, back up the generated master key, then add values with
comis secrets set <NAME>. See Secrets Management.
$include directive
Split your config into multiple files for organization:$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: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) is the default: version
defaults to "dag" (set "pipeline" to opt into the simpler engine).
Canonical messages and tool results remain recoverable, but the active model
prompt is still token-budgeted. It keeps a verbatim fresh tail and represents
older regions with selected raw steps or explicitly lossy summaries. The
in-session ctx_* tools recover underlying detail on demand; they do not put
the full canonical transcript into every provider call. See
Compaction for details.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.
