2026In production

Email assistant

HCPA · Solo backend, lead frontend

Drafts sourced replies to 40 to 50 emails a day per consultant. A person checks each one.

The problem

The assistant reads each email, pulls the client's details and drafts a reply with sources. A consultant checks every draft before it is sent.

What I built

Gmail sync, email sorting, client context from Pipedrive, and search over past cases and official sources. A guard against prompt injection and a lock against double sends.

Under the hood

  • NestJS
  • Postgres with pgvector
  • BullMQ
  • Gmail API
  • OpenAI
  • Next.js

How it works

  1. Gmail APISync and sort email
  2. PipedriveClient details
  3. pgvectorSearch past cases and official sources
  4. OpenAIDraft a reply with sources
  5. ConsultantChecks every draft before it is sent