Warm sunlit workspace desk with soft morning shadows
ENGINEERING SHOWCASE · AI EMAIL INTELLIGENCE

From chaotic
inbox to clear
actions.

SortMail parses high-volume inboxes, isolates non-obvious commitments, and extracts structured action items using a Database-First PostgreSQL architecture and Gemini 2.0 Flash.

MGmail & Outlook
<50ms DB Cache
Zero Cloud Retention
Gemini 2.0 Flash
Intelligence3 Active
Cached
LLM: ~₹0.24/emailZero Cloud Retention
EXECUTIVE BRIEFING10:24 AM

Q3 Analytics Agreement & Deliverable Schedule

From: Priya Mehta (priya.mehta@vertexlabs.com)

BLUF Summary

Priya requested legal review and sign-off on revised indemnification terms before Friday 5:00 PM UTC.

IntentContract Sign-Off & Scope Approval
DeadlineFriday, Oct 17 · 5:00 PM UTC
Action Items (3)Click to toggle
Review updated Section 8 indemnification cap with legal counselToday, 3:00 PM
Confirm receipt and approval of ₹1.5L SSO budget additionFriday, 12:00 PM
Q3_Analytics_Agreement_v3.pdf
Magic bytes verified
Latency: 720ms · Token reduction: 82%
01 / CORE INTELLIGENCE

Understand threads.
Extract commitments.
Ship responses.

SortMail processes thread context in a single pass. It discards conversational padding and surfaces concrete obligations before you open individual messages.

01 / BRIEFINGSRFC-822 Sanitizer

Executive Summaries

Condenses multi-party exchanges into structured bullet points. The ingestion engine strips disclaimers, signature blocks, and redundant quotes before passing clean conversational text to Gemini.

Extraction Metric24-email chain condensed into a 3-bullet BLUF in 720ms. 82% token reduction.
02 / ATTACHMENTSChromaDB Vectors

Vector Document Parsing

Attached PDFs, spreadsheets, and Word documents are chunked into 500-token blocks with 50-token overlap. Queries run against local vector embeddings so you can query contracts without manual downloads.

In-Inbox Vector Query"What are the indemnification caps in section 8.2?" answered in 410ms.
03 / ACTIONSP0 / P1 / P2 Triage

Task Extraction

Parses commitments ("please sign", "will deploy by", "review needed") and maps them to assigned owners, urgency categories, and completion criteria. Pushed directly to PostgreSQL task tables.

Task DispatchExtracted 3 actionable items; assigned 2 to current user with verified due dates.
04 / ASSISTANCETone Adaptive

Contextual Drafts

Synthesizes the previous 5 thread interactions and matches your communication style. It prepares a complete response payload ready for review, keeping you in full human control before dispatch.

Human In The LoopDraft generated in 680ms; zero emails sent without deliberate human confirmation.
05 / DEADLINESISO 8601 UTC

Timeline Tracking

Normalizes informal phrases like "by end of day Thursday" or "before our call on the 24th" into validated UTC timestamps. Highlights waiting-for-reply states before deliverable dates expire.

Normalized RecordConverted "end of week" to 2026-10-17T17:00:00Z with high confidence (0.97).
06 / SECURITYMagic Bytes Gate

Attachment Guard

Validates file headers and binary magic numbers (%PDF-, PK, MZ) before preview generation. Disguised executables or polyglot scripts are blocked and isolated before touching your operating system.

Integrity GateIntercepted application/x-dosexec payload named Invoice_Q3.pdf in 12ms.
02 / SYSTEM ARCHITECTURE

Architected for zero data retention and sub-50ms cache reads.

SortMail decouples user requests from external mail APIs. State stays local in PostgreSQL, while Gemini 2.0 Flash is called only for structured delta extractions.

01 / Storage & Sync<50ms Read

Database-First Architecture

Instead of making blocking requests to external mail APIs on page load, SortMail serves cached metadata from PostgreSQL immediately. A lightweight background daemon leverages Gmail historyId tokens to stream delta changes into local storage, eliminating API rate limits and rendering inboxes in under 50ms.

SELECT thread_id, bluf, priority FROM thread_intelligence WHERE user_id = $1 ORDER BY updated_at DESC LIMIT 50;
02 / LLM Cost Control~₹0.24 / Email

Single-Pass Gemini Pipeline

Recursive agent loops create unbounded billing risk and slow turnaround. SortMail passes entire thread contexts to Gemini 2.0 Flash in a single structured invocation. Pure extractor functions map the JSON payload directly to the database, slashing processing expense to fractions of a rupee per message.

response_format = { "type": "json_object", "schema": ThreadIntelligencePayload }
03 / Real-Time Client PushServer-Sent Events

Push-Based Reactivity

When background extraction completes, the FastAPI backend publishes an intel_ready notification via Redis Pub/Sub. The browser receives the event over an open SSE connection, immediately refreshing the active view without manual page reloads or polling overhead.

EventSource('/api/v1/stream/events') → onmessage → optimistic UI merge (45ms)
04 / Schema BoundariesZero Hallucinations

Strict DTO Contracts

To guarantee reliable database writes, incoming LLM outputs undergo strict validation against Pydantic models. Messages failing schema verification route to an isolation quarantine for manual inspection rather than corrupting user records or propagating bad dates.

ValidationError → Dead-Letter Queue (DLQ) → Zero bad writes to Postgres
03 / PRACTICAL WORKFLOWS

How operators use SortMail
in real work.

SortMail is built for high-stakes inboxes where missed attachments, forgotten commitments, and slow replies directly impact revenue and deliverables.

01 / AGENCY OPSMulti-Client SOWs

Consulting & Client Services

Manage 25+ simultaneous client engagements without losing change requests or approval timestamps inside long conversational email threads.

Desk Flow:
Client sends: "Please add the SSO module by Friday, budget approved."
→ SortMail extracts scope addition, logs ₹1,50,000 billing flag, and generates approval confirmation draft.
02 / LEADERSHIP10-Min Morning Triage

Technical Founders & Operators

Triage 100+ inbound updates every morning across investor inquiries, enterprise sales leads, and engineering alerts in under 10 minutes.

Desk Flow:
Reads 1-sentence BLUF for all 18 unread threads.
→ Approves 6 pre-populated calendar responses with a single keyboard shortcut.
03 / COMPLIANCEZero Cloud Retention

Legal & High-Trust Operations

Extract redline contract clauses and enforce byte-level attachment verification for teams handling confidential agreements and financial documents.

Desk Flow:
Incoming 48-page NDA.pdf parsed into ChromaDB.
→ SortMail flags non-standard non-compete clause in section 12 without sending bytes to third-party clouds.
ENGINEERING SPECIFICATION

Inspect System Topology & Database-First Architecture

Explore the complete technical breakdown including PostgreSQL delta sync cursors, Gemini 2.0 Flash JSON schemas, and verified latency benchmarks.

AI EMAIL INTELLIGENCE KNOWLEDGE BASE

Frequently Asked Questions

Showing 10 of 10 questions

SortMail is an email intelligence engine that converts overflowing inboxes into prioritized, actionable briefings. It runs background synchronization, strips conversational noise and signature clutter, extracts verified commitments and deadlines, indexes attached documents, and prepares contextual draft replies.

Interested in SortMail?
Type your email to connect directly

This system was engineered as a technical showcase. If you are interested in similar builds, architectural consulting, or private deployment, enter your email below.