AI-powered email triage

Your inbox, sorted.
Before you even look.

A five-stage streaming pipeline connects to Gmail, embeds every email into vector space, classifies with semantic matching and LLM refinement, then triages with urgency scoring — all in real time.

ImportantCan WaitNewslettersPromotionsAuto-Archive
System Architecture

The classification pipeline

Every email passes through five stages, streamed to you in real time via Server-Sent Events. Each stage progressively enriches and classifies.

SYNCGmail Sync

Incremental sync via historyId delta. Batched thread fetching with exponential backoff. Upserts thread metadata and attachments to Neon Postgres.

EMBEDEmbed + Enrich

384-dim vectors via Gemini Embedding (batched 100/req). Parallel enrichment: security scan, business data extraction, newsletter/promo heuristic signals.

FASTDomain Fastpath

Rule engine matches known senders — LinkedIn, GitHub, Amazon, and more. ~40% of emails classified at zero LLM cost.

CLASSSemantic + LLM Classify

Cosine similarity against weighted exemplar embeddings (top-K per bucket). High-confidence matches resolve locally. Low-confidence goes to Claude Sonnet with few-shot examples.

TRIAGEAnalyze + Triage

Urgency scoring, deadline extraction, action item detection, reply-status classification. Heuristic fast-track for receipts/notifications, LLM for ambiguous threads.

Built for accuracy, not just speed

Three classification tiers — heuristic, semantic, and LLM — minimize cost while maximizing accuracy. The system learns from every correction.

Multi-Tier Classification

Domain heuristics handle known patterns instantly. Semantic similarity via pgvector catches high-confidence matches. Claude Sonnet handles the rest.

Smart Bucket Creation

Describe a category in plain English and the system generates synthetic exemplar embeddings, so new buckets start classifying accurately from day one.

Security Scanning

Parallel enrichment scans every thread for phishing patterns, suspicious senders, URL shorteners, PII exposure, and financial fraud signals.

Real-Time Pipeline

Five pipeline stages stream progress via SSE in real time. Partial results render as each stage completes — buckets fill in before the full run finishes.

Priority Action Queue

A weighted formula ranks urgency, deadlines, and action items to surface what matters most — with one-click links to the original thread in Gmail.

Email Health Dashboard

Volume trends, sender frequency, reply rates, urgency distribution, and hour-of-day patterns — all computed from parallel SQL aggregations.

Stack
Next.js 16App Router + RSC
Claude SonnetClassification & triage
GeminiEmbeddings + fallback LLM
pgvector384-dim semantic search
Neon PostgresServerless database
Drizzle ORMType-safe queries
SSE StreamingReal-time pipeline
Gmail APISync + send

Ready to take back your inbox?