Pattern
How to put an AI agent in email, WhatsApp, Slack or Teams
You put an AI agent in email, WhatsApp, Slack or Teams by connecting it to each platform's official messaging interface, so people message it where they already work. One core agent sits behind thin adapters that handle each channel's rules, such as WhatsApp's 24-hour reply window.
Explained from public sources. Mai has not built this yet.
On this page
In plain English
People already live in their inbox, their team chat and, for many UK customers, WhatsApp. An agent that needs its own app or login gets forgotten. Putting the agent into those channels means a manager can ask it something in Teams, a supplier’s email gets a sensible draft reply, and a customer on WhatsApp gets an answer at nine at night. Behind the scenes it is one agent; each channel is just a different door into it.
How it works
Each platform has an official way for software to receive and send messages, and each has its own rules. The pattern is one core agent with a thin adapter per channel.
Channels: Email, Teams, Slack, WhatsApp. Then Adapters: Verify and normalise. Then Core agent. Then You approve. Then Reply in the same channel.
The adapter does four jobs: check the message really came from the platform, turn it into a standard internal message (who, which conversation, what text, any attachments), hand it to the agent, and turn the agent’s answer back into whatever the channel needs. The agent never needs to know whether it is talking through Slack or email.
What each channel involves:
- Email (Microsoft 365). Microsoft Graph can notify an app when new mail arrives, using change notifications delivered to a webhook, instead of the app polling the mailbox. Subscriptions expire and must be renewed; for Outlook messages the maximum lifetime is under seven days, and shorter if the notification includes the message content. The agent then reads the message and drafts or sends a reply through the Graph mail API, within the permissions it has been granted.
- Microsoft Teams. An agent appears in Teams as a bot, built with Microsoft’s Teams SDK or the Bot Framework, and can be used in a personal chat, a group chat or a channel. To message someone unprompted, for example a morning reminder, the app must already be installed for that person or in that team, and the agent has to store the conversation ID from an earlier event so it knows where to send.
- Slack. Slack’s Events API sends each event to the app either over an HTTP endpoint or through Socket Mode. The app must acknowledge within three seconds or Slack treats the delivery as failed and retries. So the adapter should accept the event, put it on a queue and let the agent think afterwards.
- WhatsApp. Through the WhatsApp Business Platform, when a customer messages you a 24-hour customer service window opens, and each new message from them resets it. Inside the window the agent can reply with ordinary messages. Once it closes, the business can only send template messages, which Meta must approve in advance and which fall into marketing, utility or authentication categories. For a UK business that wants an agent on WhatsApp, this shapes the design: proactive follow-ups need approved templates written up front.
Where it goes wrong
- Slow acknowledgements. A model call takes longer than three seconds, so an adapter that waits for the agent before answering Slack will see duplicate deliveries from retries. Acknowledge first, process second, and de-duplicate on the event ID.
- Missing the WhatsApp window. An agent that tries to chase a customer two days later with a free-form message will have it refused. Follow-ups outside the window must use an approved template.
- Expired subscriptions. Graph subscriptions lapse silently if no one renews them, and the agent simply stops seeing new mail. Renewal needs its own scheduled job and an alert when it fails.
- Losing the thread. Each channel identifies conversations differently. If the adapter does not map them to the right internal conversation, the agent replies without context or mixes up two people.
- Inconsistent behaviour. Building a separate bot per channel tends to produce four agents with four sets of rules. One core agent avoids that.
- Treating messages as instructions. Anything arriving by email or WhatsApp comes from outside the business and may try to instruct the agent. See agent safety for how to handle untrusted input.
- Formatting. Teams cards, Slack blocks, WhatsApp text and HTML email all render differently. The adapter, not the agent, should handle the conversion.
How Mai AI uses it
In a Mai AI system I keep one core agent, or one router with specialist agents, and add channels as adapters. Each adapter verifies the sender, normalises the message, records it, and passes it on; replies go back through the same adapter. Adding WhatsApp later should not mean rebuilding the agent.
Inbound messages from outside the business are treated as untrusted content, and outbound messages that commit the business to anything wait for a person, following the same rules as human approval gates. In the AI chief of staff built for a UK property group, email, calendars and files are reached through Microsoft Graph and anything that matters needs a signed approval token, which is the model I start from for any Microsoft 365 business.
Which channels are worth adding depends on where your team and customers actually talk. The custom AI operations systems page lets you sketch that out and see what the system would need.
Questions and answers
Can an AI agent reply to customers on WhatsApp?
Yes, through the WhatsApp Business Platform. It can reply freely within 24 hours of the customer's last message; after that window closes, the business can only send pre-approved template messages.
How do you add an AI agent to Microsoft Teams?
You build it as a Teams bot (Microsoft now calls these agents) using the Teams SDK or Bot Framework, and install the app for the people, chats or teams that should use it. It can then reply in conversations and, once installed, send proactive messages such as reminders.
Can an AI agent read and reply to my company email?
Yes. For Microsoft 365, an agent can subscribe to new mail through Microsoft Graph change notifications and draft or send replies through the Graph mail API, limited to the mailboxes and permissions it has been granted.
Should I build one AI agent per channel?
Usually not. It is better to have one agent with its memory, tools and rules in one place, and a thin adapter per channel that translates messages in and out, so behaviour stays consistent everywhere.
Harnesses known for this
- Harness profileOpenClaw
OpenClaw is an open-source, self-hosted AI assistant that runs on your own machine and answers you in the chat apps you already use, such as WhatsApp, Slack, Teams and Telegram. It is best for one person or a small trusted team who want an always-on assistant with scheduled jobs, skills and tools under their own control.
- Harness profileHermes Agent
Hermes Agent is an open-source AI agent from Nous Research that runs on a server or your own machine, talks to you through the terminal or chat apps, and writes reusable skills from the work it does. It suits people who want a long-lived agent that remembers, runs scheduled jobs and improves with use, on any model provider.
Related entries
- PatternRouting and specialist agents
Routing means one agent reads each request and hands it to the specialist best placed to handle it, such as finance, operations or sales. Each specialist has its own instructions, tools and permissions, which keeps answers sharper and access tighter than one agent trying to do everything.
- PatternThe tool layer and MCP
AI agents reach real systems through tools: named functions such as "find invoice" that the model asks to run, while ordinary code does the actual work. MCP, the Model Context Protocol, is an open standard for offering those tools and data to any AI application in the same way.
- PatternHuman approval gates
Human approval gates sort every action an AI agent can take into three levels: draft only, needs a person to approve, or allowed to run automatically. The agent prepares, a person signs off anything that matters, and the system refuses any action that does not match what was approved.
- PatternHeartbeats and schedules
AI agents work without being asked when something other than a person wakes them: a schedule, a regular heartbeat check or an incoming event. Each wake-up gives the agent a fixed job, a time budget and a way to report back, so it can chase, prepare and flag things before anyone thinks to ask.
Sources
- Meta for Developers, WhatsApp Business Platform, sending messages and the customer service windowdevelopers.facebook.com
- Meta for Developers, WhatsApp template messages overviewdevelopers.facebook.com
- Microsoft Learn, Send proactive messages from a Teams agentlearn.microsoft.com
- Slack developer docs, Events APIdocs.slack.dev
- Microsoft Learn, Microsoft Graph change notificationslearn.microsoft.com