Email infrastructure for agents built on Cohere

Wire Cohere tool use, classification, and reranking to MultiMail's REST API to give your agents production-ready email capabilities with approval gates and audit trails.


Cohere's platform covers the full range of enterprise AI tasks — generation, embeddings, reranking, and classification — making it a strong foundation for agents that need more than a single model's capabilities. Many teams reach for Cohere specifically when they want provider flexibility, on-premises deployment, or retrieval pipelines that combine generation with semantic search.

Connecting Cohere to email introduces the same set of production concerns it always does: approval flows, deliverability, rate limits, and audit trails. Cohere's API doesn't enforce any of these — it generates text and returns tool calls. MultiMail handles the email layer, including gated send modes that require human sign-off before any message leaves your infrastructure.

The integration follows Cohere's standard tool-use loop. You define MultiMail endpoints as tools, run the chat loop, and execute the function calls against MultiMail's REST API. Classification and reranking can run before or after inbox retrieval to filter, prioritize, or route messages without the model needing to reason about every email in a large inbox.

Built for Cohere developers

Approval gates Cohere can't provide

Cohere generates a tool call to send_email and stops. MultiMail's gated_send mode holds that message in a pending queue until a human approves it via the list_pending and decide_email endpoints. Your agent code doesn't change — the gate is enforced server-side.

Tool definitions that match real endpoints

MultiMail exposes check_inbox, send_email, reply_email, read_email, tag_email, and decide_email as stable REST endpoints. You can register these directly as Cohere tools and rely on consistent schemas across model versions.

Reranking works on real inbox data

Cohere's rerank model can prioritize emails returned by check_inbox before passing them to the generation model. This reduces context length and prevents the LLM from burying high-priority messages when the inbox is large.

Classification-driven routing without a large context window

Cohere's classify endpoint can label incoming emails by category, urgency, or sender type using a small example set. Pass those labels to MultiMail's tag_email endpoint to route messages before the generation model ever sees them.

Delivery controls enforced outside model logic

Rate limits, send-time windows, and domain allowlists are enforced by MultiMail regardless of what Cohere's model outputs. An agent that hallucinates a send call to an off-hours recipient gets queued, not delivered.


Try it with your agent

No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.

Paste this into your Cohere agent builder: 1. Get MultiMail ready. Read https://multimail.dev/llms.txt, follow its instructions to connect the MultiMail MCP server, create a free inbox, and set up a verified sending domain with a sender address I can use. 2. Wire MultiMail into my Cohere agent using Cohere Chat API tool use. Define MultiMail-backed functions as Cohere tools with JSON Schema parameters, pass them in the tools list, execute any returned tool_calls in my application, append the tool results as tool messages, then call Cohere chat again for the final response. 3. Give the agent exactly these email capabilities: check the MultiMail inbox for recent messages, draft a reply without sending it, and send or schedule email only through the connected MultiMail tools. Use Cohere classification to label inbox messages by intent and urgency, and Cohere reranking to prioritize the most relevant messages or candidate reply context. 4. Send a test email from the verified sender to my free inbox, have the agent check the inbox, classify and rerank the message, draft a concise reply, and show me the draft plus the intended recipient, subject, and send timing. 5. Run MultiMail in gated_send oversight mode for this setup. The agent may compose, reply, and prepare sends, but every send or scheduled send must wait for my explicit approval before MultiMail sends anything.

Step by step

1

Install the Cohere SDK and create a MultiMail mailbox

Install the Cohere Python client. Create a MultiMail account and provision a mailbox — use a custom domain or a @multimail.dev address for testing.

2

Define MultiMail endpoints as Cohere tools

Register check_inbox, send_email, and any other MultiMail endpoints your agent needs as tools in the Cohere tool format. Keep parameter descriptions specific — Cohere's model uses them to decide when and how to call each tool.

3

Run the tool-use loop

Call co.chat with your tools list, detect tool_calls in the response, dispatch each call to the corresponding MultiMail endpoint, and feed results back into the message history until the model returns a final text response.

4

Set oversight_mode to match your deployment stage

Update the mailbox oversight_mode as you build confidence in agent behavior. Start with gated_send so every outbound message is reviewed, then move to monitored once the agent's output quality is established. You can change this via the MultiMail dashboard or the create_mailbox API.


Common questions

Does MultiMail require any changes to the Cohere tool-use loop?
No. You define MultiMail endpoints as standard Cohere tools and dispatch calls to the REST API exactly as you would any other function. MultiMail's gating, approval, and delivery logic runs server-side and is invisible to the model.
Which Cohere models support tool use?
Tool use is available on command-r-plus and command-r. Use the -08-2024 or later dated variants for the most stable tool-call behavior. The ClientV2 API is recommended — it uses an OpenAI-compatible message format that makes dispatch logic straightforward.
Can I use Cohere's rerank endpoint on MultiMail's inbox output directly?
Yes. check_inbox returns a list of emails with subject, sender, and snippet. Pass each as a document string to co.rerank, then read only the top-ranked emails with read_email. This prevents large inboxes from exhausting the model's context window.
How does gated_send work when the model calls send_email?
MultiMail accepts the send_email request and returns a message_id with status pending. The message is held in a review queue until a human approves it via the decide_email endpoint or the MultiMail dashboard. The model's tool call succeeds — the gate is enforced after submission, not before.
Can I use Cohere's classify endpoint with MultiMail's tag_email?
Yes, and this is one of the more efficient patterns. Run co.classify on inbox subjects and snippets, then call tag_email with the resulting label. Tags persist on the email in MultiMail and can be used to filter subsequent check_inbox calls, keeping classification separate from generation.
Does MultiMail support webhook delivery for Cohere agents?
Yes. Configure a webhook URL in your MultiMail settings to receive inbound email events, delivery confirmations, and approval decisions. Your agent can react to these events rather than polling check_inbox on a schedule, which is more efficient for low-volume or time-sensitive workflows.
Is there a TypeScript/JavaScript option for Cohere + MultiMail?
Cohere publishes an official TypeScript SDK (cohere-ai on npm). MultiMail's REST API is language-agnostic — use fetch or any HTTP client to call the same endpoints. The tool definitions and dispatch loop translate directly from Python to TypeScript with no schema changes.

Explore more

The only agent email with a verifiable sender

Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.