How routing works
When a message arrives, Comis checks your routing rules from most specific to least specific. The first matching rule wins. If nothing matches, the default agent handles it. Each rule is called a binding. A binding says: “When a message matches these conditions, send it to this agent.” You can match on any combination of platform type, channel, server, or user.Specificity
More specific rules always win over general ones. Comis assigns a weight to each type of match condition, and rules with higher total weight take priority:| Match condition | Weight | Example |
|---|---|---|
| Specific user | Highest | ”Messages from user 12345 go to the VIP agent” |
| Specific channel | High | ”Messages in #support go to the support agent” |
| Server or guild | Medium | ”All messages in the Marketing server go to the marketing agent” |
| Platform type | Low | ”All Telegram messages go to the Telegram agent” |
Configuration
| Option | Type | Default | What it does |
|---|---|---|---|
routing.defaultAgentId | string | "default" | Which agent handles messages that do not match any binding |
routing.bindings[].channelType | string | — | Match by platform (telegram, discord, slack, whatsapp, signal, imessage, irc, line) |
routing.bindings[].channelId | string | — | Match by specific channel identifier |
routing.bindings[].peerId | string | — | Match by specific user identifier |
routing.bindings[].guildId | string | — | Match by server or guild identifier |
routing.bindings[].agentId | string | (required) | Which agent to assign when this binding matches |
~/.comis/config.yaml
user-9876 in any channel will always go to
the VIP agent (highest specificity). A message in Discord channel 1234567890
from anyone else goes to the support agent. Any other Telegram message goes to
the personal agent. Everything else goes to the default agent.
Multiple agents setup
To use routing, you first need to define multiple agents in your configuration. Each agent gets its own identity, model, and settings:~/.comis/config.yaml
Worked example: support agent on Slack, scheduler agent on Discord
Say you want two distinct agents:- Helper answers customer questions in your Slack
#supportchannel - Pip manages reminders and recurring jobs in your team Discord
~/.comis/config.yaml
#support, the router scores the message:
channelType=slack matches the first binding (weight 1) → routed to helper.
A Discord message matches the second binding instead → routed to pip. A
message from a channel with no matching binding (say, the web dashboard)
falls through to default.
Each agent has its own workspace at ~/.comis/workspaces/helper and
~/.comis/workspaces/pip, so their personalities and operating instructions
stay independent.
Identity
The workspace files that shape each agent’s personality.
Slash Commands
Commands you can type to control your agent.
