Modern professionals spend hours daily reading long email chains and manually extracting tasks. SortMail fundamentally changes this by applying a "Database-First" and "Push, Don't Poll" architecture combined with a highly optimized Gemini 2.0 AI intelligence pipeline.
Automatically condenses long, multi-participant email threads into clear, actionable bullet points, discarding signature bloat and generic corporate noise.
Capable of reading and summarizing attached documents (PDF, DOCX, PPTX) via vector embedding to provide full context without forcing the user to open files.
Automatically converts emails into prioritized tasks (do_now, do_today, can_wait) based on AI confidence scores and urgency tracking.
Context-aware reply generation that reads the specific thread history and allows users to draft responses with explicit tone parameters.
Automatically tracks "waiting for reply" threads and seamlessly detects meeting times and deadlines hidden within unstructured email text.
Instead of relying on slow API calls to Gmail every time the user opens the app, SortMail loads instantly from a PostgreSQL database (under 50ms). Background synchronization uses Gmail's historyId to perform incremental delta syncs, only fetching exactly what has changed since the last sync.
To keep API costs exceptionally low, the intelligence pipeline executes a single LLM call per thread. A central engine requests a structured JSON response from Gemini 2.0 Flash. Pure extractor functions route this to the database, dropping processing cost to roughly ~₹0.25 per email (50% under budget).
SortMail utilizes a Redis Pub/Sub architecture combined with Server-Sent Events (SSE). When the AI finishes processing, the FastAPI backend publishes an intel_ready event. The Next.js frontend instantly invalidates its React Query cache, magically updating the screen without manual refreshes.
Built with Next.js 14, React Query, FastAPI, PostgreSQL, and ChromaDB. To maintain a robust integration between the AI engine and backend, the system utilizes strict Data Transfer Object (DTO) contracts to prevent AI hallucinations regarding database schemas.