Full-Stack Email & Calendar AutomationID: 104

Email & Calendar Automation Agent

A full-stack AI agent that classifies incoming Gmail messages with GPT-4, drafts smart replies, and auto-schedules meetings via Google Calendar — with an approval-gated Next.js dashboard for human-in-the-loop review

Next.jsGPT-4Google Calendar APIGmail APINeonDrizzle ORMNextAuthTypeScript
Email & Calendar Automation Agent
Click to watch in action

The Challenge

Manually triaging email, drafting replies, and coordinating meeting times is repetitive and time-consuming, and naive polling-based automation approaches waste LLM tokens by reprocessing old or already-seen messages.

The Solution

Built a multi-service architecture — a Next.js dashboard plus a separate Node worker — that uses Gmail's historyId-based incremental sync to process only new emails, GPT-4 structured outputs for classification and meeting-intent extraction, and the Google Calendar API for free/busy checks and event creation, all gated behind an approve/reject action feed.

System Architecture

Classification Agent

Classifies incoming emails by category (meeting request, urgent, newsletter, spam) using GPT-4 structured outputs.

Meeting Intent & Scheduling Agent

Extracts proposed meeting times, checks Google Calendar availability, and prepares event creation.

Reply Drafting Agent

Generates contextual reply drafts for review before sending, never auto-sends.

Key Outcomes

Reduced redundant LLM calls by switching to Gmail historyId-based incremental sync instead of full inbox polling.

Automated meeting scheduling by connecting GPT-4 meeting-intent extraction directly to Google Calendar free/busy checks and event creation.

Built an approval-gated dashboard so every AI-drafted reply and calendar event is reviewed before it goes live.

Tech Foundation

AI Models
GPT-4GPT-4o mini
Frontend
Next.jsNextAuth.js
Backend
Node.js WorkerDrizzle ORMNeon (Postgres)