Skip to main content
Madhukar
Case Study

MailOS

Keyboard-First AI Command Center

MailOS — Keyboard-First AI Command Center project screenshot

Project Overview

MailOS is a keyboard-driven email client and scheduling platform designed to streamline inbox workflows. Integrating deeply with Google Workspace through Corsair SDK's multi-tenant OAuth, MailOS embeds a conversational AI agent capable of scheduling meetings, searching databases, and draft composition using hotkeys and voice commands. Users interact with the command center via a keyboard-only workspace using Vim shortcuts and a custom command palette.

Core Architecture & Integrations

The core engine of MailOS is built on Next.js, syncing email and calendar metadata in a localized PostgreSQL database. Real-time synchronicity is achieved by subscribing to Gmail Push Notification webhooks via Google Cloud Pub/Sub, triggering automated ingest queues. The auth flow handles multi-tenant credentials securely, executing automatic token refreshes through a custom middleware handler.

AI Command Center

MailOS employs a smart AI agent powered by the Vercel AI SDK, executing 5 primary tool integrations: • **Email Composition & Sending:** "Draft an email to John thanking him for the meeting and send it." • **Calendar Scheduling:** Automatically parses incoming emails for meeting requests, checks calendar slots, and replies with calendar links. • **Fuzzy Search:** Uses pgvector for semantic search over inboxes, retrieving messages based on conceptual query parameters rather than literal keywords. • **Priority Classification:** An offline model classifies incoming emails into Urgent, Medium, or Low priority tags based on historical user behavior.

UX Engineering & Speed

MailOS is optimized for ultra-low latency. With 15+ keyboard shortcuts supporting standard Vim navigation (j/k for list navigation, c for compose, / for global search, r for reply), power users can navigate their entire inbox without touching their mouse. The ⌘K Command Palette indexes all available operations and searches contacts using a customized fuzzy matching algorithm.

Engineering Challenges & Solutions

P

Challenge

Handling the massive, fast-moving stream of real-time Gmail webhook push notifications without dropping packets or hitting API limits.

S

Solution

Implemented a robust serverless queue handler that acknowledges webhooks instantly and queues background jobs for ingestion, parsing, and semantic embedding.

P

Challenge

Creating an accessible, glitch-free keyboard-first navigation layout in React that doesn't conflict with native browser shortcuts.

S

Solution

Constructed custom custom event listeners in React, utilizing aria-activedescendant for accessibility and preventDefault on specific keys to override default browser inputs.

Technologies Used

TypeScriptNext.jsReactDrizzle ORMPostgreSQLVercel AI SDKCorsair SDKZodpgvector

Key Metrics & Results

  • Inbox operations performed 3x faster compared to traditional standard clients.
  • Fuzzy search queries return accurate context-aware emails in less than 50ms using pgvector indexing.
  • Achieved seamless multi-tenant authentication handling hundreds of calendar events simultaneously.