Skip to content

commune-dev/awesome-email-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Awesome Email for AI Agents Awesome

A curated list of email infrastructure, SDKs, tools, frameworks, and patterns for AI agent systems.

Email is the universal async protocol for AI agents. This list covers everything you need to give your agent a real inbox — from dedicated infrastructure to framework integrations to production patterns.

Criteria for inclusion: Tools must either be designed specifically for AI agents, or have demonstrated production adoption in agent stacks at scale.


Contents


Email Infrastructure

Tools and platforms for giving AI agents dedicated email capabilities.

Purpose-built for agents

Commune — Dedicated email infrastructure for AI agents. Each agent gets its own inbox, inbound emails fire webhooks, threads track across clients, and attachments are threat-scanned. Built-in: RFC 5322 threading, semantic vector search, structured JSON extraction, prompt injection protection, HMAC-signed webhooks with 8-retry delivery guarantee.

Transactional email (dual-use)

Resend — Modern email API for developers. Clean API, React Email templates, webhooks, inbound email support. Does not provision per-agent isolated inboxes. Best for agents that only need to send email (not receive).

SendGrid — Twilio's email platform. High-volume sending, deliverability tools, inbound parse webhook. Designed for bulk/marketing email; agent-native features require significant wrapper code.

Postmark — Focused on transactional email deliverability. Inbound webhook support. No per-agent inbox isolation.

Amazon SES — AWS email service. Low cost at scale. Inbound email to S3/SNS/Lambda. Requires significant setup for agent use cases.

Self-hosted email servers

Postal — Open source mail server for high-volume sending. Self-hosted alternative to SendGrid/Mailgun. Ruby-based.

Mailu — Full-featured mail server stack (Docker). SMTP, IMAP, antispam, webmail. Useful for agents needing IMAP access to existing mailboxes.

Haraka — High-performance Node.js SMTP server. Extensible via plugins. Used for custom inbound processing pipelines.


MCP Servers

Model Context Protocol servers that give AI assistants (Claude Desktop, Cursor, Windsurf) email capabilities.

commune-mcp — Email tools for Claude Desktop, Cursor, and Windsurf. Create inboxes, read threads, send email. uvx commune-mcp.

mcp-server-gmail — Official MCP server for Gmail. Read/send from your personal Gmail account. Part of the official MCP servers collection.

mcp-server-sendgrid — Official MCP server for SendGrid email sending.


Framework Integrations

LangChain

CrewAI

  • commune-cookbook/crewai — Multi-agent crew examples: triage agent, specialist agent, QA agent all coordinating through Commune inboxes

OpenAI Agents SDK

Claude (Anthropic)

AutoGen


n8n / Workflow Automation

n8n-nodes-commune — n8n community node for Commune. Full coverage: Message (Send, List), Inbox (Create, List, Get, Update, Delete, Set Webhook, Set Extraction Schema), Thread (List, Get Messages, Update Status), Search, Delivery, and inbound email trigger.


Production Patterns

Architectural patterns for email in agent systems — with code examples.

Pattern 1: One inbox per agent

Each agent in your system gets a dedicated inbox. Customer support agents use support@company.com, billing agents use billing@company.com. This isolates thread history, makes routing explicit, and prevents cross-contamination between workflows.

# Create dedicated inboxes for each agent type
support_inbox = client.inboxes.create(local_part="support")
billing_inbox = client.inboxes.create(local_part="billing")
onboarding_inbox = client.inboxes.create(local_part="onboarding")

Pattern 2: Webhook → Agent → Reply in thread

The canonical agent email flow: receive webhook, run LLM, reply with thread_id.

@app.post("/webhook")
async def handle_email(request: Request):
    body = await request.body()
    verify_signature(body, headers["x-commune-signature"], WEBHOOK_SECRET, headers["x-commune-timestamp"])

    payload = json.loads(body)
    # Run your agent with the email content
    reply = await agent.run(payload["content"])
    # Reply in the same thread
    client.messages.send(to=payload["sender"], text=reply, inbox_id=payload["inboxId"], thread_id=payload["thread_id"])

Pattern 3: Structured extraction for zero-LLM parsing

Define a JSON schema on the inbox. Inbound emails are auto-parsed — no extra LLM call.

client.inboxes.set_extraction_schema(domain_id, inbox_id,
    name="support_ticket",
    schema={"type": "object", "properties": {
        "intent": {"type": "string"},
        "priority": {"type": "string", "enum": ["low", "medium", "high", "critical"]},
        "product": {"type": "string"}
    }}
)
# Every inbound email now has extracted intent, priority, product before your webhook fires

Pattern 4: Multi-agent coordination via email

Agents hand off tasks to each other via email. Agent A completes a subtask, emails Agent B with the result. Agent B replies when done. Full audit trail in thread history.

# Agent A hands off to Agent B
client.messages.send(
    to="billing-agent@company.com",  # Agent B's inbox
    subject=f"Process refund for {customer_email}",
    text=f"Customer {customer_id} requested refund of ${amount}. Order: {order_id}",
    inbox_id=agent_a_inbox.id,
)
# Agent B receives via webhook, processes, replies to Agent A

Pattern 5: Semantic search for agent memory

Vector search across all email history gives agents access to relevant past context.

# Before replying, search for relevant past interactions
past_context = client.search.threads(
    f"customer {customer_email} previous issues",
    inbox_id=support_inbox.id,
    limit=3,
)
context_str = "\n".join([t.snippet for t in past_context])
reply = llm.complete(f"Context from past interactions:\n{context_str}\n\nNew message: {email_content}\n\nReply:")

Pattern 6: Idempotent sends for reliable agents

Agent loops retry. Use idempotency keys to prevent duplicate emails.

client.messages.send(
    to="user@example.com",
    subject="Weekly report",
    text=report_body,
    inbox_id=inbox.id,
    idempotency_key=f"weekly-report-{user_id}-{week_number}",
)
# Safe to call 10 times — exactly one email is sent

Cookbook Examples

Complete, runnable code examples for email in agent systems.

Example Framework Description
Customer Support Agent Any Full support workflow: read, classify, reply
LangChain Email Tools LangChain @tool wrappers for Commune operations
CrewAI Multi-Agent Crew CrewAI Triage + specialist + QA agent pipeline
OpenAI Agents SDK OpenAI function_tool integration
Claude tool_use Anthropic Claude email tools
Structured Extraction Any Auto-parse email fields to JSON
Semantic Search Any Natural language inbox search
Webhook Handler TypeScript Express webhook + HMAC verification
Hiring Pipeline Any Candidate outreach + screening sequences
Sales Outreach Any Cold email + follow-up sequences
n8n Workflow n8n No-code email agent workflows

Articles and Talks


Contributing

Found a tool or pattern that belongs here? Open a pull request.

Criteria for inclusion:

  • Purpose-built for AI agents, OR proven production adoption in agent stacks
  • Actively maintained (last commit within 12 months)
  • Not spam or self-promotion without substance

See CONTRIBUTING.md for guidelines.


Related lists


Maintained by Commune · MIT License

About

Curated list of email and SMS infrastructure, tools, and patterns for AI agents — SDKs, MCP servers, frameworks, and production examples

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors