Skip to content
AI System

AI Agent for Inbox & Task Handling

An AI agent we built for our own inbox: it triages every email, drafts replies from past answers, sends action items to a task app, and waits for approval before sending.

AI Agent for Inbox & Task Handling screenshot

The problem

The costly part of our inbox was the first pass: reading every email to work out what it was, what it needed and when, then writing replies we had written many times before.

What we built

An agent that classifies and summarises each email, drafts replies from the most similar past answers, exports action items to Google Tasks through n8n, and holds every reply for approval. Version 2 adds a web interface, four model providers and a public demo.

Features

  • Classification with confidence and reasons
  • Summaries, key points and action items
  • BM25 retrieval of past replies for drafting
  • Approve, edit, rewrite with feedback, or skip
  • Task export to Google Tasks via an n8n webhook
  • Follow-ups, morning digest and stats
  • Demo mode with recorded answers

Our role

  • Product design
  • Agent and prompt design
  • Backend and web UI
  • n8n integration
  • Deployment

Results

  • Every email arrives sorted, summarised and with its action items listed
  • Replies drafted in our own voice, with the past replies they drew on shown
  • Nothing is sent without a person approving it
  • Open-sourced under MIT, with a demo that needs no account or API key

The full story

Why we built it

We built the first version for our own inbox at CodeITronics. Client threads, carrier and vendor email, invoices and a steady stream of newsletters all landed in one place, and the expensive part wasn't replying: it was the first pass of reading, sorting and remembering what each email needed.

The first version was a Python script that read Gmail, classified and summarised each email with an LLM, drafted replies using past answers, and asked for approval in the terminal. It worked, but only for whoever was sitting at that terminal.

What we changed in version 2

  • A web interface for the approval step. A triage board sorted by priority, an email view with the summary, action items and the draft side by side, and Approve, Edit, Rewrite and Skip.
  • Drafts that show their sources. The drafter retrieves the most similar past replies and the UI lists them, so you can see why a draft reads the way it does. Every approved reply becomes a new example.
  • Tasks out of the inbox. Action items are posted to an n8n webhook that creates Google Tasks. High-priority email is exported automatically.
  • Any of four model providers. Anthropic, OpenAI, Gemini or DeepSeek, chosen in configuration.
  • A demo anyone can run. A fictional mailbox with recorded AI answers, so it works without Gmail or an API key.

Decisions we made

A person approves every reply by default. An agent that emails customers on its own is a liability until you trust it. Auto-send exists as a setting, and we leave it off.

Keyword retrieval instead of a vector database. A personal inbox has hundreds to a few thousand approved replies. BM25 ranking is instant, needs no model download, and its matches are easy to explain. The first version's Chroma and sentence-transformers stack added more weight than it was worth at this size.

SQLite and one process. It's a single-user tool, so there is one file to back up and nothing else to run.

Try it

The demo runs the real pipeline over a fictional logistics company's inbox. The code is open source under the MIT license.

Screens

Each email gets a summary, action items, a priority with its reason, and a drafted reply citing the past replies it used.
Each email gets a summary, action items, a priority with its reason, and a drafted reply citing the past replies it used.
A follow-up escalation, drafted and sent to the task list within the same pass.
A follow-up escalation, drafted and sent to the task list within the same pass.
The morning digest: what to act on first, replies waiting, follow-ups due.
The morning digest: what to act on first, replies waiting, follow-ups due.
Action items exported to a task app through an n8n workflow.
Action items exported to a task app through an n8n workflow.
Phishing is flagged and never answered.
Phishing is flagged and never answered.
Rules: approval on by default, which categories get drafts, auto-export of tasks.
Rules: approval on by default, which categories get drafts, auto-export of tasks.
ProductAI Inbox & Task Agent