AI21 Labs handles generation — summarization, drafting, classification. MultiMail handles delivery, approvals, and audit trails so those outputs reach real inboxes safely.
AI21 Labs provides language models optimized for task-oriented text generation: summarization, structured completion, and chat. These capabilities map directly onto email workflows — classifying inbound messages, drafting context-aware replies, and condensing long threads into actionable summaries.
The gap AI21 doesn't fill is the send surface. Generating a well-structured reply is different from routing it through SMTP, enforcing per-mailbox identity, queuing it for human approval, or logging it for compliance. That's what MultiMail provides.
The integration pattern is straightforward: AI21 produces text, your agent calls MultiMail's REST API or MCP tools to act on it. You get the generation quality of AI21 with the governance guarantees — approval flows, webhook events, delivery receipts, audit logs — that production email requires.
Set oversight_mode to gated_send and every outbound message generated by your AI21 model sits in a pending queue until a human approves it. The decide_email endpoint lets your agent check queue status and handle approvals programmatically.
MultiMail binds each mailbox to a verified identity. Emails sent via send_email carry that identity in headers, preventing agents from spoofing sender addresses even when the generation model has no awareness of that constraint.
Configure a webhook on any MultiMail mailbox and your AI21-backed agent receives a POST the moment an email arrives — with headers, body, thread ID, and sender reputation signals already parsed.
Call get_thread to fetch a full conversation, pass it to AI21's summarization endpoint, then store the result or use it to inform a reply. The thread data includes timestamps, participants, and tags — not just raw body text.
MultiMail records every read, send, tag, and approval event with timestamps and actor identity. When a compliance audit asks what your agent sent and when, the answer is already there — no log scraping required.
Use mm_test_ keys during development. Emails are accepted, queued, and returned via API but never delivered externally. Switch to mm_live_ keys when you're ready to go to production — no code changes needed.
No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.
Install the official AI21 client library and set your API key as an environment variable.
Sign up at multimail.dev, generate an API key, and create a mailbox. Use mm_test_ keys during development — emails are processed but never delivered externally.
Point a MultiMail webhook at your agent's endpoint so AI21-backed processing triggers automatically when email arrives. The payload includes the email ID, thread ID, subject, and parsed body.
In your webhook handler, call get_thread to fetch context, pass it to AI21 for classification or drafting, then call the appropriate MultiMail endpoint. Start with read_email and tag_email before enabling sends.
Once classification is working, enable reply drafting with oversight_mode set to gated_send. Check list_pending to review queued messages before they go out. Promote to monitored or autonomous only after reviewing several approval cycles.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.