Case study 01 Full Stack

AI BeeOmnichannel AI Sales & Support Agent

Type
Full Stack
Core stack
Next.js 16, React 19, TypeScript
AI Bee: Omnichannel AI Sales & Support Agent — screenshot
Fig. 1 — AI Bee.

AI Bee is a full-stack SaaS that puts one AI agent behind every Meta conversation a business has. It connects Facebook Pages, Messenger, Instagram and WhatsApp (plus Telegram and a website chat widget) into one unified inbox, answers customer DMs and comments 24/7 in the customer's own language, qualifies leads, books meetings and hands off to a human when needed.

01Overview

It is a Turborepo monorepo: a Next.js 16 / React 19 dashboard and marketing site, an Express + MongoDB API, a React Native companion app for the team, and a Shopify extension.

How one inbound message is handled:

  1. Meta sends a webhook; the API verifies its `X-Hub-Signature-256` signature and deduplicates it by message id.
  2. The turn is queued on BullMQ + Redis, and rapid-fire messages from the same person are buffered into a single turn.
  3. Voice notes are transcribed and images described with Gemini; the conversation language is detected.
  4. A RAG step retrieves the workspace's own knowledge base (Gemini embeddings, optional cross-encoder reranking) and a semantic cache can serve a known answer without an LLM call.
  5. The LLM agent (@openai/agents over DeepSeek) writes the reply with tool calls for meeting scheduling; persona, lookup and groundedness guards check it before it is sent.
  6. An action router creates meetings, notifies the team or hands the thread to a human, and emits events into a rules-based automation engine.

Around that pipeline the product includes:

  • Lead CRM with AI lead scoring, AI conversation summaries and bulk actions.
  • Comment moderation and per-post comment controls.
  • Human takeover: a teammate can pause the AI on one thread and hand it back.
  • Built-in video meetings (Agora) with booking from the chat.
  • Post scheduling, AI content and blog generation.
  • Stripe subscriptions metered by token usage, a partner programme, and a super-admin console.
  • Role-based access per workspace, an audit trail, and access tokens encrypted at rest.
  • Push notifications to the mobile app via Firebase.

02The hard parts

  1. Replies that stay grounded in the business's own facts: A sales agent that invents prices or delivery times is worse than no agent. I built a RAG pipeline over each workspace's knowledge base and put guards after the LLM (persona, lookup and groundedness checks, plus a final sanitiser) so a reply that isn't supported by the knowledge base is retried or rewritten before the customer sees it.
  2. Never promising what the team won't deliver: When the AI tells a customer "our team will call you", that has to be true. Replies that commit the team are gated on a push alert actually reaching a teammate first; if the alert fails, the reply is rewritten so it doesn't make the promise.
  3. Webhooks at real-world volume: Meta retries deliveries and customers send five short messages in a row. Signature verification, idempotent event claims, a BullMQ job queue, per-conversation turn locks and a message-fragment buffer keep each customer turn answered once, in order, with full context.
  4. Handing a conversation between AI and humans cleanly: Teams need to jump into a thread without the bot talking over them. I implemented human takeover across the messaging channels, so the AI stays quiet while a teammate is in the thread and every message shows whether the AI or a person sent it.
  5. Keeping LLM cost and latency down: A semantic reply cache, optional reranking with a tight timeout, and model experiments behind flags keep replies fast while subscriptions stay metered by token usage.

03Built with

  • Next.js 16
  • React 19
  • TypeScript
  • Redux Toolkit
  • Tailwind CSS 4
  • Node.js
  • Express
  • MongoDB with Mongoose
  • Redis + BullMQ
  • OpenAI Agents SDK
  • DeepSeek
  • Google Gemini (RAG embeddings)
  • Meta Graph API & Webhooks
  • WhatsApp Business API
  • Stripe
  • Agora (video meetings)
  • Firebase (push notifications)
  • React Native
  • Shopify
  • Turborepo

04Screens

AI Bee — screen 1 of 2
Fig. 2 — AI Bee, screen 1 of 2.
AI Bee — screen 2 of 2
Fig. 3 — AI Bee, screen 2 of 2.

Open to remote roles and freelance work

Have something to build? Let’s talk it through.

Tell me what you’re making, where it’s stuck, or what the role involves. Email reaches me fastest.