DiscordAgent
, SlackAgent
, and TelegramAgent
.
If you’re looking to add communication abilities to your existing AG2 agents, you can use the tools that underpin these agents, see Discord Tools, Slack Tools, and Telegram Tools.
These agents are currently in our
experimental
namespace, indicating that we have tested the functionality but their interface may change. Please use them with that in mind and we appreciate any feedback on them.If you do find any bugs please log an issue in the AG2 repository. If you would like to add more tools or functionality, we would love your contribution.Installation
Install AG2 with the necessary extra for the platform(s) you need.Capabilities
The send functionality is consistent across agents, they take a message and post it to the configured channel/group/bot. If a message is longer than the platforms permitted message length, they will split the message into multiple messages. The common retrieve functionality includes:- Retrieve the latest X messages from a channel/group/bot.
- Retrieve messages since a given date.
- Retrieve messages since a given message ID.
- Retrieve a message given its ID.
Platform configuration
Each agent is configured for a specific channel/group/bot. This configuration is applied when you create the agent. Discord, Slack, and Telegram all have their own authentication and channel/group/bot identifiers. See this notebook for more guidance on establishing those authentication details and identifiers.Using the Agents

Agent | Send Tool | Retrieve Tool |
---|---|---|
DiscordAgent | DiscordSendTool | DiscordRetrieveTool |
SlackAgent | SlackSendTool | SlackRetrieveTool |
TelegramAgent | TelegramSendTool | TelegramRetrieveTool |
ConversableAgent
you can use them in any conversation pattern in AG2.
An important component of the new agents (as opposed to just using their tools) is that the platform’s messaging requirements will be appended to their system message.
They cover aspects like maximum message length, preferred format (e.g. Markdown), and provide tips like using emojis.
Agent | System Message guidance |
---|---|
DiscordAgent | 2,000 character limit, Markdown, bold/italic/code, use emojis |
SlackAgent | 40,000 character limit, Markdown, bold/italic/code, emojis, notification formats |
TelegramAgent | 4,096 character limit, HTML, mentions and emojis |
has_writing_instructions
to False
when creating the agent.