- Receiving and replying to user messages on IM platforms such as Feishu and Discord;
- Pushing messages to a chosen IM platform on the agent’s own initiative;
- Routing messages to different agents and sessions by rule;
- Sending and receiving multimodal content such as images and files;
- Approving an agent’s tool calls right inside the conversation;
- Injecting channel context (platform, chat name, group vs. private) into the agent automatically, so replies fit the setting.
Supported platforms
Each platform has a built-in type id (channel_type) that you pick when creating a channel:
Enable channels
Channels start with the agent service. Declare which channel types the service accepts through thechannels argument of create_app:
Enable built-in channels
channels enables no channel types and keeps the feature off. To connect a platform beyond the built-in ones, add your channel class to the list; see Custom channel.
Distributed deployment
Channels support distributed multi-node deployment. Shared state (channel config, sessions, the message bus) all lives in Redis, and the nodes run as equals, each handling its own requests; swapstorage and message_bus for their Redis versions to scale out across machines.
At the connection level, every deployment node keeps its own long connection for each enabled channel. The platform may deliver one message to several nodes, but only one node is allowed to collect and send the reply for a given session at a time, so users never get a duplicate answer.
HTTP endpoints
A channel’s full lifecycle is managed through the endpoints under/channels:
For each endpoint’s full request and response fields, see the API part of this chapter.
Further reading
Message routing
Decide which agent answers and which session a message joins.
Connect Feishu
Create a Feishu bot and let agents chat in Feishu.
Connect Discord
Create a Discord bot and let agents chat in Discord.
Custom channel
Implement ChannelBase to connect a platform beyond the built-ins.