Skip to main content

Mail Pilot

AI-Powered Email Client — Architecture Deep Dive

🤖

AI-Native Email Client

The AI assistant has full control of the UI — navigating, filtering, composing, replying, and managing your inbox through natural language. Every action goes through typed, validated tools.

🛡️

Human-in-the-Loop

Every destructive or communication action (send, delete) requires explicit user approval. The approval dialog supports approve, reject, pause-and-edit, and cancel workflows.

🔧

Tool-Based Architecture

The AI never manipulates the DOM directly. All capabilities are exposed as typed, Zod-validated tools that mutate Zustand stores or invoke server actions — deterministic, testable, auditable.

📧

Rich Email Management

Virtualized thread lists with infinite scroll, TipTap rich-text compose, Gmail label-based views (inbox, sent, drafts, spam), and real-time sync via 15-second polling.

📄

File Reasoning

Upload PDFs, text files, and CSVs. The AI extracts text server-side and reasons about the content — enabling workflows like resume-to-job matching.

⚛️

State Duality

Zustand for transient UI state (filters, selection, compose draft, approval); React Query for server state (threads, messages) with automatic cache invalidation and pagination.