
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.
From: Priya Mehta (priya.mehta@vertexlabs.com)
Priya requested legal review and sign-off on revised indemnification terms before Friday 5:00 PM UTC.
SortMail processes thread context in a single pass. It discards conversational padding and surfaces concrete obligations before you open individual messages.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
SortMail is built for high-stakes inboxes where missed attachments, forgotten commitments, and slow replies directly impact revenue and deliverables.
Manage 25+ simultaneous client engagements without losing change requests or approval timestamps inside long conversational email threads.
Triage 100+ inbound updates every morning across investor inquiries, enterprise sales leads, and engineering alerts in under 10 minutes.
Extract redline contract clauses and enforce byte-level attachment verification for teams handling confidential agreements and financial documents.
Explore the complete technical breakdown including PostgreSQL delta sync cursors, Gemini 2.0 Flash JSON schemas, and verified latency benchmarks.
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.
This system was engineered as a technical showcase. If you are interested in similar builds, architectural consulting, or private deployment, enter your email below.