Project 1

ClientServe AI — AI Voice & Lead Follow-Up Platform

HashThink
ClientServe AI is a multi-tenant SaaS that gives small businesses and marketing agencies an AI front desk and outbound closer. It answers and places phone calls, books appointments, syncs CRM, and follows up on ad and social leads within seconds — so no inquiry goes cold after hours or during peak volume.
Overview

Description

ClientServe AI (clientserve.ai) is a production AI voice and messaging platform built for service businesses and lead-generation agencies. It replaces the gap between “lead arrived” and “human followed up” with an always-on agent that can talk on the phone, book into Google Calendar, update CRM, and continue conversations on Instagram and Facebook Messenger.

The product is workspace-scoped: a single business runs one workspace; agencies run many client workspaces under one account. Each workspace gets its own telephony (Twilio subaccount and numbers), knowledge base, integrations, campaigns, and Stripe-metered usage. The AI voice stack combines OpenAI Realtime for conversation with ElevenLabs for natural telephony audio, bridged over Twilio Media Streams.

Beyond inbound reception, ClientServe AI runs outbound campaigns against CRM, Meta, HubSpot, and uploaded audiences; auto-dials new Meta Lead Ads and WhatConverts leads; retries missed calls; and trains the agent on the business website and uploaded documents so answers stay on-brand.

Key Features

For Businesses (SMBs)

  • 24/7 AI inbound receptionist with optional “ring office first, then AI” fallback
  • Instant outbound AI callbacks when Meta Lead Ads or WhatConverts leads arrive
  • Appointment booking into Google Calendar during live calls
  • CRM / Leads hub with call transcripts, recordings, and post-call SMS summaries
  • Website crawl + document knowledge base so the agent answers from real business content
  • Embeddable AI chatbot for the company website
  • Stripe subscriptions with metered voice usage

For Agencies

  • Multi-workspace tenancy — isolate each client’s numbers, CRM, ads, and billing
  • Per-workspace metering and plan gating suitable for white-label-style client delivery
  • Shared product surface: Ads, Outreach campaigns, Automations, Analytics, Integrations
  • Campaign dialer with audiences, windows, retries, and run-level outcomes

Platform Features

  • Meta / Facebook Lead Ads connect, form sync, and webhook → CRM → optional auto-call
  • Instagram DM / comment and Facebook Messenger social automation with auto-reply
  • HubSpot and Square OAuth sync for customers and related records
  • Outbound campaign orchestrator (CRM, HubSpot, Meta, file, manual, Apollo audiences)
  • Missed-call retry (~1 hour) and booking reminder callbacks
  • Call recording to S3, transcripts, analytics, and usage dashboards
  • AI content generation hooks (n8n) for social creative workflows
  • Industry-tuned prompts (e.g. restaurants, aesthetics / clinics, home services)

Problem Solved

ClientServe AI targets the operational failures that cost service businesses and agencies booked jobs:

  • Slow speed-to-lead — Ad and form leads go cold in minutes; AI dials within seconds of webhook receipt
  • Missed and after-hours calls — Inbound AI answers when staff cannot; optional human-first dial with AI fallback
  • Manual CRM busywork — Leads, call logs, and transcripts land in the workspace CRM and sync outward where connected
  • Unqualified calendar noise — Voice agent qualifies and books into Google Calendar instead of dumping raw inquiries
  • Dead outbound pipelines — Campaign dialer works uploaded and CRM audiences with windows, retries, and stop rules
  • Social inbox lag — Instagram and Messenger inquiries get automated replies and lead capture
  • Fragmented business knowledge — Website crawl and document RAG keep the agent consistent with the brand
  • Agency multi-client chaos — Workspace isolation keeps numbers, ads, and billing separated per client
Technologies

Backend

  • NestJS
  • TypeScript
  • Prisma
  • PostgreSQL
  • Supabase
  • BullMQ
  • Redis
  • Twilio
  • OpenAI
  • ElevenLabs
  • Stripe
  • Sentry
  • AWS S3

Frontend

  • Vite
  • React 18
  • TypeScript
  • Tailwind CSS
  • Radix UI
  • shadcn
  • TanStack Query
  • Framer Motion
  • Recharts

Other

  • Meta Graph API
  • HubSpot OAuth
  • Square OAuth
  • WhatConverts
  • Google Calendar OAuth
  • n8n
  • Flowise
Role And Contributions

Role

Core full-stack engineer on ClientServe AI at HashThink — NestJS multi-tenant API, AI voice / telephony, campaign orchestration, Meta and CRM automations, and production dashboard features — working alongside the product team on a live SaaS at clientserve.ai.

Contributions

  • Multi-tenant workspace model with isolated Twilio subaccounts, numbers, and billing
  • Inbound / outbound AI voice path: Twilio Media Streams ↔ OpenAI Realtime ↔ ElevenLabs TTS
  • Meta Lead Ads OAuth, page picker, webhook leadgen → CRM → optional auto-outbound call
  • Instagram and Messenger social automation (connect, webhooks, lead capture, auto-reply)
  • Campaign orchestrator with sharded dial queues, audiences, retries, and run analytics
  • Missed-call retry and booking-reminder job pipelines (BullMQ)
  • Google Calendar booking tools for the live voice agent
  • Stripe Checkout, webhooks, and metered voice usage
  • Knowledge pipeline: website crawl, document embeddings, Knowledge Hub → agent tools
  • Production ops: EC2 / Nginx / PM2 deploys, Sentry, staging vs production API surfaces
Challenges And Learnings

Challenges

1. Real-time Telephony + AI Audio Bridge

Challenge: Keeping low-latency, duplex audio between Twilio Media Streams, OpenAI Realtime, and ElevenLabs TTS without dropouts, echo, or stalled sessions under variable network conditions.

Solution: Built a dedicated voice session layer that bridges Twilio streams to Realtime tool-calling sessions, streams ElevenLabs µ-law audio into the call, and handles reconnect / teardown cleanly per call lifecycle.

2. Multi-Tenant Telephony Isolation

Challenge: Agencies need many clients on one product without shared numbers, call history, or billing bleed.

Solution: Modeled Workspace as the hard tenancy boundary — per-workspace Twilio subaccounts, numbers, Trust Hub rows, Meta configs, CRM data, and Stripe usage events — with active-workspace preference for the dashboard.

3. Speed-to-Lead Automation Under Webhook Noise

Challenge: Meta Lead Ads and WhatConverts fire noisy, duplicate, or incomplete payloads; auto-calling the wrong or empty phone wastes money and damages trust.

Solution: Normalized lead field parsing, idempotent customer upserts by lead IDs, phone validation before dial, and feature flags for auto-outbound so workspaces can enable callbacks only when ready.

4. Campaign Dialer Fairness and Throughput

Challenge: Concurrent outbound campaigns across tenants can starve each other or hit Twilio concurrency limits.

Solution: BullMQ coordinator with dial shards hashed by auth user, configurable shard count and concurrency caps, per-run attempt / retry / stop rules, and outcome logging on campaign runs and calls.

5. Knowledge That Stays On-Brand

Challenge: Generic LLM answers invent hours, pricing, and services that hurt conversion and compliance.

Solution: Website crawler + document chunk embeddings (pgvector-style) with Realtime search_knowledge_base tools and Knowledge Hub prompt sync so the agent prefers business-sourced facts.

6. Human-First Call Forwarding with AI Fallback

Challenge: Businesses want staff to answer when available, but still need AI when the office misses the call.

Solution: Twilio Dial to the business line first; on no-answer / busy outcomes, dial-action webhook connects the same caller into the AI Realtime session without forcing a second customer callback.

7. Meta Ads Surface vs Instagram-Only Promotion

Challenge: /connect-ads is Page-centric; Instagram-only promotions without a linked Facebook Page do not appear in Page-filtered campaign lists.

Solution: Documented Page-linked matching (promoted_object.page_id) as the supported path; Instagram social automation remains a separate connect flow for DMs/comments; future work can match instagram_user_id or offer ad-account-level campaign views.

8. Billing That Matches Voice Cost Reality

Challenge: Voice minutes vary wildly by geography and call length; flat SaaS pricing alone underprices heavy dialers.

Solution: Stripe subscriptions plus metered usage events for voice, plan gates on CRM / chatbot / social features, and clear Professional vs Agency packaging for single businesses vs multi-workspace operators.

9. Post-Call Continuity

Challenge: A completed call without a written trail forces staff to re-listen to recordings.

Solution: Persist transcripts and recordings (S3), optional delayed SMS summary to the customer, and CRM / WhatConverts follow-up sync phases after outbound automation.

10. Production Reliability on a Lean Ops Stack

Challenge: Single-EC2 production with memory-sensitive Node processes must survive deploys, spikes, and long-running Media Stream connections.

Solution: PM2 process separation for API and frontend preview, memory restart thresholds, Nginx reverse proxy, Sentry error tracking, and staging (test.clientserve.ai / test-api.clientserve.ai) for safer rollout.

Learnings

1. Tenancy First

  • Workspace isolation must be designed into schema, Twilio provisioning, and OAuth tokens from day one
  • Agency products fail quietly when one client’s Meta page or number leaks into another workspace

2. Voice Is a Systems Problem

  • LLM quality is only one slice — telephony codecs, stream lifecycle, and tool latency dominate perceived quality
  • Always design for hangups, mid-call tool failures, and partial transcripts

3. Webhooks Need Idempotency

  • Ad platforms retry; lead forms send test payloads; phone fields are messy
  • Upsert by external lead IDs and gate auto-dial behind validated phones

4. Async Queues Protect the Request Path

  • Campaign dials, crawls, retries, and Stripe usage belong on BullMQ, not in HTTP request threads
  • Shard and concurrency limits are product features, not just infra knobs

5. Integrations Are Product Surfaces

  • “Connected” is not enough — page pickers, ad account filters, reconnect states, and empty-state copy determine whether agencies trust the Ads tab
  • Separate social OAuth (IG/Messenger) from ads OAuth when Meta scopes and review differ

6. Knowledge Beats Prompting Alone

  • RAG + crawl beats a long static system prompt for hours, menus, and service areas
  • Sync Knowledge Hub into the live agent so dashboard edits show up on the next call

7. Metered Billing Aligns Incentives

  • Outbound campaigns can burn minutes fast; usage metering keeps unit economics honest
  • Plan gates communicate which automations are Professional vs Enterprise / Agency

8. Ops Simplicity Scales Further Than Expected

  • EC2 + Nginx + PM2 is enough for early production if process boundaries and monitoring are clear
  • Staging API/UI parity prevents “works on Lovable, breaks on prod” surprises
Achievements

Metrics

Impact Highlights

  • Faster first contact on paid leads vs manual dial queues
  • After-hours and missed-call coverage without staffing a night shift
  • Fewer unqualified calendar bookings via voice qualification + Google Calendar tools
  • Agency ability to stand up a new client workspace with isolated numbers and ads
  • Target speed-to-lead: contact new ad leads in under 60 seconds of webhook receipt
  • Coverage: inbound + outbound AI voice, Meta Lead Ads, Instagram / Messenger, Google Calendar, HubSpot, Square, WhatConverts

Testimonials

We were losing Facebook leads overnight. ClientServe AI calls them within seconds, books the ones who are ready, and drops the rest into our CRM with a transcript. Our front desk finally stopped drowning in callback lists.

Marcus Ellison

Operations Manager, Northline Home Services

As an agency, the workspace model is the difference. Each client gets their own numbers, Meta connection, and usage — we are not juggling shared inboxes anymore. Outbound campaigns plus Lead Ads auto-dial paid for itself in the first month.

Priya Nandakumar

Founder & Managing Director, BrightPath Lead Agency

The AI receptionist rings our clinic line first. If we miss it, the agent picks up, answers insurance and hours questions from our knowledge base, and books into Google Calendar. No-shows dropped because reminders actually go out.

Dr. Elena Vasquez

Practice Owner, Harborview Dental & Aesthetics

Technical Details

Architecture

ClientServe AI is a full-stack SaaS with a NestJS 11 API and a Vite + React 18 dashboard SPA. Tenancy is centered on Workspace: nearly all domain models carry workspaceId, and the UI switches active workspace for agencies managing multiple clients.

The backend is modular (Auth, Twilio, AssistantVoice, Campaigns / CampaignOrchestrator, Meta, HubSpot, Square, WhatConverts, Calendar, Customers, Leads, Documents, Websites, Payment / Subscriptions, MissedCallRetries, Analytics, Usage, and more). Persistence uses Prisma on PostgreSQL (including vector-backed document chunks for RAG). Background work runs on BullMQ and Redis — website crawls, campaign dial shards, missed-call retries, booking reminders, and Stripe usage reporting.

The voice path is the core differentiator: Twilio webhooks and Media Streams open a live session; OpenAI Realtime drives conversation and tool calls (calendar, knowledge search, SMS, handoff); ElevenLabs streams telephony-grade TTS back into the call. Recordings land in AWS S3; transcripts and call outcomes feed CRM and analytics.

Integrations are first-class Nest modules with OAuth and webhooks: Meta Lead Ads + Instagram / Messenger, HubSpot, Square, WhatConverts, and Google Calendar. Billing is Stripe Checkout + webhooks with metered voice usage. Observability uses Sentry; production deploys run on AWS EC2 behind Nginx with PM2 process management for API and frontend.

This architecture supports the full lead lifecycle: capture (ads, forms, social, inbound call) → qualify / converse (AI voice or chatbot) → book (Google Calendar) → persist (CRM + transcripts) → follow up (campaigns, SMS, retries).

Future Plans

Longer-term Vision

  • Omnichannel inbox unifying calls, SMS, Messenger, Instagram, and WhatsApp threads
  • Deeper CRM bidirectional sync and conversion upload back to ad platforms
  • Vertical packs (home services, clinics, restaurants) with turnkey prompts and compliance defaults
  • Stronger compliance posture (documented controls beyond marketing claims) for regulated verticals

Developed and Documented
by @ahmedshamswali