Bot platform adapters now ship in the
praisonai-bot package. praisonai bot serve still works exactly as documented here; for a standalone install see praisonai-bot Migration.Quick Start
routes: is the preferred field name for gateway routing configuration — gateway runtime accepts both routing: and routes: interchangeably in YAML.
Message routing lets you send different types of messages to different AI agents. For example, direct messages go to your personal assistant, while group messages go to a support agent.
How Routing Works
The user sends a message; the gateway detects the chat context, looks up the matching route, and forwards the turn to that agent.
A user messages from a DM or group; the gateway detects the context, picks the matching agent, and returns its reply.
Route Contexts
| Context | Description | Example |
|---|---|---|
| dm | Direct / private message | User sends a DM to your bot |
| group | Group chat message | Message in a Telegram group or Discord server |
| channel | Channel message | Message in a Slack channel |
| default | Fallback for any unmatched context | Any message that doesn’t match above |
Configuration
Define routes in thechannels section of gateway.yaml:
Routing Examples
- Personal + Support
- Single Agent
- Multi-Channel
- Workforce (one platform, many roles)
Route DMs to a personal assistant and group messages to support:
Going further: per-peer / per-role bindings
When chat-type routing isn’t specific enough — e.g. one specific user, a Discord role, or a specific channel id — use the priority-ordered bindings surface.Gateway Route Bindings
Route by sender, role, channel id, or bot account — with priority ordering.
Routing Flow Diagram
Routing is configured per channel. Each platform can have completely different routing rules — Telegram DMs can go to one agent while Discord DMs go to another.
Best Practices
Always define a default route
Always define a default route
Set
default on every channel so unexpected contexts (new group types, API changes) still reach an agent instead of failing silently.Isolate agents by context
Isolate agents by context
Route
dm and group to different agents when personal and support workflows must not share memory or tools. See Platform-Aware Agents.Use bindings for fine-grained routing
Use bindings for fine-grained routing
When chat-type routing is not enough, add priority-ordered Gateway Route Bindings for specific users, roles, or channel IDs.
Scope tools per route
Scope tools per route
Pair routing with Gateway Tool Policy so public group chats cannot invoke dangerous tools available to trusted DMs.
Related
Gateway Route Bindings
Advanced routing by peer, role, channel id, and bot account — with priority.
Gateway Tool Policy
Scope the toolset per route — keep stranger DMs from running dangerous tools.

