Skip to content
Agentic AIAgentic email triage & scheduling

Email & Calendar Automation Agent

/Case Study

A 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
/03 · Agentic AIemail-agent-dashboard-alpha.vercel.app

Human-in-the-loop for high-stakes actions. Full distributed tracing on every run.

/Architecture

Ingestion
Gmail API via OAuth 2.0. HTML stripped before any LLM processing.
Classification
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.
Routing
low-stakes actions (archive promotions, mark newsletters read) execute automatically. High-stakes actions (schedule events, send replies) queue for human approval.
Execution
approved actions fire Gmail send API or Google Calendar API in real time — Google Meet link generation and attendee invite delivery included.
Tracing
unique trace ID per agent run; each pipeline step (fetch, clean, classify, route, execute) recorded as a timed span with full input/output logging.
Self-evaluation
GPT-4o evaluator scores each session on intent accuracy, action quality, and reasoning quality — flags decisions where the evaluator disagrees with the agent.

/Stack

Backend
Python · FastAPI · Pydantic · Loguru · Railway
LLM
OpenAI GPT-4o (function calling)
Integrations
Gmail API · Google Calendar API · OAuth 2.0
Frontend
React · Vite · Vercel
Repos
LucasLisboaDev/email-calendar-agent · LucasLisboaDev/email-agent-dashboard

/Key engineering decisions

05 points
  1. Function calling over freeform text

    Structured JSON output makes routing deterministic and auditable — no parsing fragile LLM prose.

  2. 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.

  3. HTML stripping before LLM

    Removes noise and token waste so classification focuses on message intent, not markup.

  4. Distributed tracing per run

    Every pipeline step is a timed span with I/O logging — debuggable in production without guesswork.

  5. Post-session self-evaluation

    Automated quality scoring catches classification drift before it reaches users.