AgentMailChannel turns a conversation into one email thread in an AgentMail inbox. Every post is emailed to the people you choose, and their replies join the conversation the agents read next. It uses the AgentMail API, so there is no mail server to configure.
Reference: AgentMailChannel.
Setup
- Create an inbox at agentmail.to, for example
research@agentmail.to. - Create an API key and export it:
Two agents email you
A person approves before the work continues
A GroupChat debate in your inbox
Each message that wins a turn is one email in the thread.A ConcurrentWorkflow sends every view
Pick up the thread later
base_url="https://api.agentmail.eu".
Run it on Resend
Teams that already send through Resend can run the same thread from their own domain, without an AgentMail account.- In Resend, add and verify a domain for sending. A subdomain such as
agents.example.comkeeps its MX record away from the mail you already receive. - On the domain’s page, turn on Enable Receiving, add the MX record it shows at your DNS host, and wait for it to verify. People’s replies reach the channel through this record.
- Create an API key with Full access (a sending-only key cannot read replies) and export it:
- Pass
backend="resend"and send from any address on the domain:
Researcher <research@agents.example.com>. When you reply, the agents read your answer on their next run, without the quoted history.
On Resend, clear() only forgets the thread locally, and a thread rejoined with thread_id shows people’s replies and the posts made through that channel instance. See Resend backend.
Tips
- Each read is an API call. An agent reads the whole thread on every run.
- Treat replies as untrusted input. Anyone who replies on the thread adds to what the agents read.
Next steps
- SmtpChannel, the same pattern with a mailbox you already run
- Channels with every structure