← Back to work

Hedwigs

Enterprise-grade AI Chief of Staff and unified productivity workspace — autonomously triages inboxes, coordinates calendars, and bridges communication across 27+ SaaS applications with strict Human-in-the-Loop governance.


THE PROBLEM

Modern knowledge workers drown in information overload across fragmented tools (Gmail, Outlook, Jira, Linear, HubSpot, Slack, Zendesk, Zoom), wasting hours copying context and manually drafting replies. Furthermore, standard AI agents pose severe security risks if allowed to mutate databases or send emails without oversight, and static LLM drafts sound robotic and unnatural.

WHAT I BUILT

  • 27+ Integrated SaaS Connectors & Command Channels: Built on the Corsair SDK unifying Google Gmail (push Pub/Sub), Google Calendar, Microsoft Outlook, Teams, Zoom, HubSpot CRM, Notion, Linear, Jira, Slack, Zendesk, Intercom, Fireflies.ai, Cal.com, Calendly, Todoist, and Asana into a single keyboard-first workspace, controllable remotely via Telegram Bot and WhatsApp Cloud API webhook command channels
  • Sub-Second Webhook-to-WebSocket Realtime Pipeline: Pub/Sub push notifications hit Next.js edge routers ('/api/webhooks/corsair'), emitting asynchronous Inngest events ('corsair/webhook.received') to normalize rows into 'sync_items', trigger parallel pgvector embedding generation and LLM triage classification, and broadcast WebSocket deltas via Supabase Realtime in under 2 seconds total latency
  • Human-in-the-Loop PendingAction Trust Architecture: Read-only agent tools execute instantly, while write operations ('sendEmail', 'createEvent', 'createIssue', 'hubspotLogEmail', 'notionCreatePage', 'supportReplyTicket') are intercepted into a 'pending_actions' staging table; execution requires explicit cryptographic human approval via Web UI cards, Telegram inline keyboards, or WhatsApp interactive buttons
  • Voice-Matched AI Style Profiling Engine: Inngest background jobs ('backfill.ts') sample outgoing user emails ('sent_message_samples'), synthesize structured JSON voice profiles ('StyleProfile' via GPT-4o) across word count and sign-off milestones, and perform pgvector cosine similarity retrieval ($1 - \text{embedding} \Leftrightarrow \text{query}$) to inject top-3 matching sent replies into few-shot LLM prompts
  • High-Concurrency Serverless Orchestration (Inngest v4.5): Manages 21 distinct background job suites handling webhook deduplication, email backfilling, vector embedding generation, thread summarization, AI triage classification ('priority_scores' & 'sender_affinities'), GDPR account deletion, org seat synchronization, and automated retention purging
  • Enterprise Security & Billing Infrastructure: Row Level Security (RLS) policies ('sync_items_select_own') in PostgreSQL 16+, Clerk Enterprise SSO (SAML/OIDC via 'sso_connections'), append-only security audit trails enforced by database-level triggers, and Dodo Payments metered subscription billing ('usage_records')

TECHNOLOGY STACK

Next.js 15Next.js 15ReactReacttRPCtRPCPrismaPrismaSupabaseSupabasePostgreSQLPostgreSQLInngestInngestOpenAIOpenAITypeScriptTypeScriptTailwind CSSTailwind CSSVercelVercel
TECHNICAL HIGHLIGHT

When the AI Chief of Staff invokes a mutating tool (e.g., 'sendEmail' or 'createIssue'), custom middleware intercepts the invocation, prevents external API execution, and stages the parameters inside a 'pending_actions' PostgreSQL table with 'status: "pending"'. Interactive approval cards are simultaneously broadcast to the Web UI, Telegram, and WhatsApp; only when the user taps Approve does the 'executePendingAction' tRPC router decrypt the Corsair OAuth token ('dek') and execute the REST payload.