Email & Calendar Automation Agent
/Case StudyA production-grade agentic AI system that autonomously manages email triage, smart reply drafting, and meeting scheduling using a full-stack Python and React architecture deployed on Railway and Vercel.
- Category
- Agentic AI
- Type
- Agentic email triage & scheduling
- Core stack
- Python · FastAPI · GPT-4o
- Status
- Live at email-agent-dashboard-alpha.vercel.app
Human-in-the-loop for high-stakes actions. Full distributed tracing on every run.
/Architecture
- Gmail API via OAuth 2.0. HTML stripped before any LLM processing.
- GPT-4o function-calling pipeline forces structured JSON output — intent label (meeting request, reply needed, spam/promo, FYI, urgent), suggested action, confidence score, and reasoning trace.
- low-stakes actions (archive promotions, mark newsletters read) execute automatically. High-stakes actions (schedule events, send replies) queue for human approval.
- approved actions fire Gmail send API or Google Calendar API in real time — Google Meet link generation and attendee invite delivery included.
- unique trace ID per agent run; each pipeline step (fetch, clean, classify, route, execute) recorded as a timed span with full input/output logging.
- GPT-4o evaluator scores each session on intent accuracy, action quality, and reasoning quality — flags decisions where the evaluator disagrees with the agent.
/Stack
- Python · FastAPI · Pydantic · Loguru · Railway
- OpenAI GPT-4o (function calling)
- Gmail API · Google Calendar API · OAuth 2.0
- React · Vite · Vercel
- LucasLisboaDev/email-calendar-agent · LucasLisboaDev/email-agent-dashboard
/Key engineering decisions
05 pointsFunction calling over freeform text
Structured JSON output makes routing deterministic and auditable — no parsing fragile LLM prose.
Human-in-the-loop for high-stakes actions
Auto-execute low-risk triage, require one-click Approve/Reject on the React dashboard before sending emails or creating calendar events.
HTML stripping before LLM
Removes noise and token waste so classification focuses on message intent, not markup.
Distributed tracing per run
Every pipeline step is a timed span with I/O logging — debuggable in production without guesswork.
Post-session self-evaluation
Automated quality scoring catches classification drift before it reaches users.