← All work
AI · Email · 2026
BoxieAI
- Client
- Zephra Studio (in-house product)
- Role
- Sole engineer, full stack
- Year
- 2026

Overview
An AI inbox. It connects several Gmail accounts into one view, then classifies every email as Urgent, Opportunity or Noise, summarises it in a sentence or two, and drafts a reply. Live at boxieai.zephra.dev with Paystack subscriptions.
The challenge
Putting an LLM in front of someone's inbox means three hard constraints at once: it has to keep up with a continuous stream of mail without blocking the app, it has to hold OAuth access to private accounts safely, and every model call costs money, so the system has to know when not to call the model at all.
What I built
- Background pipeline on BullMQ + Redis: a recurring job syncs each connected Gmail account, and every new email becomes its own processing job with retries, so a slow or failed model call never blocks sync or the UI.
- User-defined rules run before the model. A matching rule classifies the email deterministically and skips the GPT-4o call entirely, which honours the user's intent and cuts API cost on obvious cases.
- Structured model output: GPT-4o returns JSON (category, summary, suggested reply, confidence), which is validated before saving; an unrecognised category falls back to Noise instead of breaking the inbox.
- Privacy by design: only the subject, sender and Gmail snippet are sent to the model, never the full body, and job logs record IDs only, never email content.
- OAuth refresh tokens encrypted at rest with AES-256-GCM through a TypeORM column transformer; accounts whose tokens are revoked are flagged for re-authentication instead of failing silently.
- Noise auto-archives after seven days, a daily briefing, and Pro-tier features (custom rules) gated through Paystack subscriptions with signature-verified webhooks.
Stack
- Next.js
- NestJS
- TypeScript
- PostgreSQL
- TypeORM
- BullMQ
- Redis
- OpenAI GPT-4o
- Gmail API
- Paystack
Results
- Classify, summarise and draft a reply for every email
- Rule matches skip the LLM call entirely
- Unit-tested encryption, rule matching and core services
What I'd change next
- Sync polls the 50 most recent inbox messages and de-duplicates by message ID. Gmail's history API (or push notifications via Pub/Sub) would make sync incremental and cut quota use as accounts grow.
- Classification has no evaluation set yet. A labelled sample of real emails, scored on every prompt or model change, is the next step before tuning prompts further.