An inbox of 50–200 emails a day hides the few that matter. Email Agent is a cron-driven Python agent that pulls the inbox via IMAP, classifies each message with Gemini (urgent / FYI / spam / digest) and pushes a daily summary to Telegram.
It is for personal use. A handful of past silent-failure incidents shaped the L3 roadmap — every bug got an explicit fix and a new entry in the exception hierarchy.
- Status
- Live, personal use
- Autonomy (AAL)
- L2 → L3
- Volume
- ~50–200 emails/day
- Stack
- Python, IMAP, Gemini, Telegram
01
Triage, not deletion
Messages are sorted into urgent, FYI, spam and digest; spam goes to quarantine and is never auto-deleted.
02
A digest, not a daemon
It runs on cron with no long-running process and sends one Telegram digest with a category breakdown.
03
Errors that name themselves
An explicit ImapErrorClass exception hierarchy replaces broad catch-alls, so every failure class has a name.
The 54 lost emails
A broad `except:` once swallowed a PermissionError and 54 emails were silently lost. The fix landed, and a structured exception hierarchy is now mandatory.
There is still no external heartbeat: if the cron stops running, only the missing digest reveals it. That gap is the next step on the L3 roadmap.
Capabilities
Working now
- IMAP scan via configured Gmail account
- Gemini classification with explicit ImapErrorClass exception hierarchy
- Daily Telegram digest with category breakdown
- Spam quarantine without auto-delete (operator reviews)
- Cron-driven, no long-running daemon
- Venv hardened against environment drift
Status not stated
- Per-class retry logic with idempotency keys
Current autonomy level
Weakest link
A past incident: a broad `except:` swallowed PermissionError and 54 emails were silently lost. Fix landed; structured exception hierarchy is now mandatory. No external heartbeat yet — if the cron stops running, only the missing digest reveals it.
Roadmap to L3
- L2 lift — liveness file-touch + Ops Bot mtime watcher; classified errors via ImapErrorClass enum (done).
- L3 lift — pino-style structured logs to file, post-run digest count POSTed to Ops Bot, schema-validate every Gemini classification output via Pydantic.
- Verification gate — chaos test that revokes IMAP token mid-run and asserts a fatal Ops Bot event within 60 s.
Next step
Explore the available product and its current limits
LIVE means the project is available now; the weakest link and roadmap above state the current version’s limits.
Review the path to the target level