The Problem
Support teams run one conversation across four inboxes. Context is lost between channels, the same question gets answered from scratch every time, and canned reply bots fail the moment a customer phrases something slightly differently, so everything escalates to a human anyway. The cost isn't the tooling, it's the repeated manual triage underneath it.
Architecture
Messenger · WhatsApp · SMS · Web → Unified Inbox → Mastra AI Framework (RAG Retrieval with PgVector + OpenAI) → Reply / Escalate
What I Built
RAG pipeline over PgVector: embeds each tenant's own documentation and past resolved tickets, so replies cite real product knowledge rather than a generic model prior.
Omnichannel ingestion: normalizes Messenger, WhatsApp, SMS, and web chat into a single conversation model, keeping thread context intact when a customer switches channel.
End to end type safety: tRPC and Prisma give one shared contract from PostgreSQL through to the React client, so schema changes surface at compile time instead of in production.
Confidence gated automation: the model answers when retrieval is strong and hands off to a human when it isn't, rather than guessing and burning customer trust.
Engineering Focus
Retrieval quality over model size. Most support questions are already answered somewhere in the customer's own docs: the hard part is chunking, embedding, and ranking well enough to find them reliably.
Why It Matters
Deflecting repeat questions is the entire ROI of support automation. Every conversation the system resolves without a human is margin the team keeps, and context that survives to the next ticket.
