01 / 05
Ingest
New mail lands in the Gmail inbox through the Gmail API. The agent picks it up on its next run and starts a trace for that thread.
Case study · AI systems · 01
Reads the inbox, drafts the reply, and waits for a human to say go.
A production-shaped Gmail agent: it classifies incoming mail, drafts a reply with an LLM, and holds everything in a review queue — nothing sends until a person approves it. Built with cost tracking, retry logic, and a Streamlit review dashboard, not left as a notebook demo.
How it works
Five stages, one gate
01 / 05
New mail lands in the Gmail inbox through the Gmail API. The agent picks it up on its next run and starts a trace for that thread.
02 / 05
An LLM call over Groq reads the thread and tags intent and category, so routine mail and edge cases get handled differently downstream.
03 / 05
A second LLM call writes a reply grounded in the thread. Every call here is wrapped in retry logic with exponential backoff.
04 / 05
The draft lands in a Streamlit review queue. A person approves, edits, or rejects it — rejected drafts go back for a rewrite.
05 / 05
Approved replies go out through the Gmail API. Every stage — classify, draft, approve, send — is logged with its cost and latency.
Production discipline matters more here than a clever demo. An agent that drafts a wrong reply and sends it anyway is worse than one that never shipped — so nothing leaves this agent without a person seeing it first.
Every LLM call carries a typed output schema, retry logic, and cost tracking. A failed or low-confidence call holds the message for review instead of silently dropping it or guessing at an answer.
The review queue isn't a bolt-on afterthought — it's the one step every message has to pass through, logged and timestamped like everything else in the run.
Tech used on this project
Open to freelance and contract work on agentic AI systems — email automation, WhatsApp and commerce agents, or something custom. If you can describe the problem, I can tell you honestly whether it's a good fit.