Building an autonomous
email intelligence agent
How I replaced 20 minutes of morning inbox triage with a production multi-agent system that reads, prioritizes, and drafts replies — running silently in the background on every boot.
Inbox triage is expensive attention tax
Running a consulting business means your inbox is a mix of client messages, platform notifications, vendor emails, security alerts, and newsletters — all arriving at the same priority level. Every morning I was spending 15–20 minutes manually sorting what needed a reply, what was urgent, and what could be ignored.
I wanted a system that could do that triage for me, remember patterns over time, and hand me pre-written replies for the emails that actually needed one. Not a filter. Not a label. A reasoning agent.
A true multi-agent pipeline
The system uses two Claude models in sequence. The sub-agent handles focused single-email triage in parallel across all emails simultaneously. The orchestrator handles cross-email reasoning, memory context, and final HTML generation — working from clean JSON summaries rather than raw email bodies.
Why two models instead of one
The instinct is to use one model for everything. The better move is to give each model one job it's genuinely good at. Haiku is fast and cheap — perfect for the focused, repetitive work of summarizing a single email into structured JSON. Running 20 in parallel takes about 8 seconds total and costs $0.022.
Sonnet handles the harder job: reasoning across all summaries simultaneously, applying memory context from past runs, detecting patterns, and generating coherent HTML. Giving it clean JSON instead of raw email bodies makes it significantly more reliable — and the orchestrator's output improves over time as the memory layer accumulates.
| Model | Role | Why this model | Cost/run |
|---|---|---|---|
| claude-haiku-4-5 | Sub-agent — one per email, parallel | Fast, cheap, focused single-email triage | ~$0.022 |
| claude-sonnet-4-6 | Orchestrator — tool-use loop | Cross-email reasoning, memory, HTML generation | ~$0.097 |
The agent gets smarter over time
Three SQLite tables persist across every run. The orchestrator reads trend context before analyzing each day's emails — so by week two it knows that certain senders are recurring clients, that a Google security alert is worth flagging differently than a newsletter from the same domain, and that an Upwork message is the third this week.
| Table | Purpose | Key fields |
|---|---|---|
| digests | One row per day — daily summary history | date (unique), email_count, urgent_count, summary |
| senders | Categorized sender records with running counts | email (unique), name, category, notes, count, last_seen |
| processed_messages | Deduplication log — prevents double-processing | message_id (PK), thread_id, digest_date |
What lands in the inbox
Patrick Metz | West Atlas LLC
What it actually costs to run
The entire system runs on pay-as-you-go API pricing. No subscriptions, no infrastructure costs beyond the machine it runs on. At 20 emails per day the economics are essentially free.
What I'd tell someone building this
What gets built next
The agent already has the better brain. What it needs now are better bones — more reliable parsing, schema validation on model outputs, and priority reasoning that explains itself. The commercial path is a managed service for solo operators and small agencies who want this running for their inbox without touching code.