Skip to content

Agentic Inbox

Maintained
cloudflare/agentic-inbox

A self-hosted email client with a built-in AI agent, running entirely on Cloudflare Workers, Email Routing, Durable Objects and R2.

View on GitHub
Stars
8.2k
Forks
1.1k
Watchers
8.2k
Open issues
50

Overview

Agentic Inbox is a self-hosted email client that runs entirely in your own Cloudflare account, with a built-in AI agent that can read, search, and draft replies to your mail. Incoming messages arrive through Cloudflare Email Routing, every mailbox lives in its own Durable Object with a SQLite database, and attachments are stored in R2.

Key Features

  • Full email client: rich-text composer, threaded replies and forwards, folders, search, and attachments
  • Per-mailbox isolation: each mailbox runs in its own Durable Object with SQLite storage
  • Built-in AI agent: a side panel with tools for reading, searching, drafting, and sending email
  • Auto-drafting: the agent reads new inbound mail and prepares draft replies — sending always requires your explicit confirmation
  • Configurable: custom system prompt per mailbox, persistent chat history, and visible tool calls
  • Protected by Cloudflare Access: production deployments require Access, so your inbox is never exposed to the public internet

Tech Stack

Layer Technologies
Frontend React 19, React Router v7, Tailwind CSS, TipTap, Kumo
Backend Hono, Workers, Durable Objects (SQLite), R2, Email Routing
AI Agents SDK (AIChatAgent), AI SDK, Workers AI
Auth Cloudflare Access JWT validation

Getting Started

You need a Cloudflare account with a domain, plus Email Routing (receiving), Email Service (sending), and Workers AI enabled.

  1. Deploy with the “Deploy to Cloudflare” button, which provisions R2, Durable Objects, and Workers AI and asks for the domain you want to receive mail on.
  2. Enable Cloudflare Access on the Worker and save the POLICY_AUD and TEAM_DOMAIN values as Worker secrets.
  3. Create an Email Routing catch-all rule that forwards to the Worker.
  4. Enable the send_email binding for outbound mail.
  5. Create a mailbox in the app, such as [email protected].

For local development:

npm install
npm run dev

Use Cases

  • A private, AI-assisted inbox for a personal or company domain
  • A reference architecture for building email-driven agents on Cloudflare
  • Triage and draft help for shared support addresses

License

Apache License 2.0.

Similar open-source projects, ranked by shared categories and tags.

All Tools projects →