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.
Every email passes through five stages, streamed to you in real time via Server-Sent Events. Each stage progressively enriches and classifies.
Incremental sync via historyId delta. Batched thread fetching with exponential backoff. Upserts thread metadata and attachments to Neon Postgres.
384-dim vectors via Gemini Embedding (batched 100/req). Parallel enrichment: security scan, business data extraction, newsletter/promo heuristic signals.
Rule engine matches known senders — LinkedIn, GitHub, Amazon, and more. ~40% of emails classified at zero LLM cost.
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.
Urgency scoring, deadline extraction, action item detection, reply-status classification. Heuristic fast-track for receipts/notifications, LLM for ambiguous threads.
Three classification tiers — heuristic, semantic, and LLM — minimize cost while maximizing accuracy. The system learns from every correction.
Domain heuristics handle known patterns instantly. Semantic similarity via pgvector catches high-confidence matches. Claude Sonnet handles the rest.
Describe a category in plain English and the system generates synthetic exemplar embeddings, so new buckets start classifying accurately from day one.
Parallel enrichment scans every thread for phishing patterns, suspicious senders, URL shorteners, PII exposure, and financial fraud signals.
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.
A weighted formula ranks urgency, deadlines, and action items to surface what matters most — with one-click links to the original thread in Gmail.
Volume trends, sender frequency, reply rates, urgency distribution, and hour-of-day patterns — all computed from parallel SQL aggregations.