DEV Community

Titus Eddy
Titus Eddy

Posted on

I Built an AI-Powered WhatsApp Helpdesk with Aurora DSQL, Multi-Model AI, and a Visual Chatbot Builder

The Problem

Millions of small and mid-sized businesses — especially across Africa and emerging markets — run their entire customer support on WhatsApp. Yet the tooling available is either enterprise-priced, dumb (no AI), or introduces unbearable latency for distributed users.

I wanted to build something that's:

  • AI-native from day one (not bolted-on)
  • Multi-region with sub-100ms database latency globally
  • Accessible to any business with a WhatsApp number
  • No-code friendly for building complex chatbot flows

What I Built

ImaradeskAI — a full-stack WhatsApp customer support platform that turns any WhatsApp Business number into an intelligent helpdesk with AI-powered automation, visual chatbot flows, and real-time analytics.

🧠 Multi-Model AI Engine

Three providers working together — Gemini 2.5 Flash, GPT-4o, and Claude Sonnet 4 — switching transparently based on task type and availability.

Every inbound message gets:

  • Intent classification into 9 categories with confidence scoring
  • Sentiment analysis (-1 to +1) feeding escalation risk
  • Language detection + auto-translation — respond in the customer's native tongue
  • Conversation summarization for automatic ticket generation

The system caches classifications and embeddings, so repeated queries are near-instant.

🤖 Visual No-Code Chatbot Builder (13 Node Types)

A drag-and-drop flow canvas where non-technical users can build complex conversation logic without writing code:

Node Type What It Does
Trigger Entry point — keyword, regex, business hours, first message
Send Message Send text to the customer
Quick Replies Present numbered options for structured responses
AI Response Single-turn AI generation using conversation context
Agent (Full AI) Multi-turn autonomous agent with memory + KB access
Knowledge Base Vector similarity search + AI-synthesized answer
Condition Multi-rule branching (contains, regex, equals, not_equals)
Delay Configurable wait (optimized for serverless at ≤5s)
Connector Merge multiple branches into one path
Action Side effects: create ticket, assign agent, add tag, close
API Call External HTTP calls with SSRF protection (blocks private IPs)
Smart Reply Template-based replies with shortcut matching
Human Handoff Escalate to agent + auto-create ticket + assign team

The flow engine supports:

  • Trigger priority matching (specific keywords before catch-all)
  • Depth-limited execution (max 20 nodes) to prevent infinite loops
  • Stateful conversations — activeFlowId + currentNodeId per contact
  • Full execution logging for debugging and analytics

📚 RAG Knowledge Base with Vector Embeddings

Upload (PDF/DOCX/TXT/CSV) → Extract Text → Embed → Store → Cosine Search → AI Generate
Enter fullscreen mode Exit fullscreen mode
  • Documents embedded with gemini-embedding-001 or text-embedding-3-small
  • Vectors stored as JSON arrays directly in Aurora DSQL — no separate vector DB needed
  • Cosine similarity ranks all KB entries against the user's query
  • Top-k results passed as context to AI for grounded, hallucination-resistant answers
  • Files managed in AWS S3 with UUID-based naming for security

🌍 Multi-Region Database with AWS Aurora DSQL

This was the biggest architectural bet. Aurora DSQL gives us:

  • Two active regions (us-east-1 + us-east-2) with automatic geo-routing
  • Short-lived IAM tokens via DSQL Signer (auto-refreshed every 10 min)
  • Connection pooling per region with failover to secondary
  • Client lat/lon routing — the nearest cluster handles each request
function getNearestRegion(lat: number, lon: number) {
  const regions = [
    { endpoint: US_EAST_1_ENDPOINT, lat: 39.0, lon: -77.5 },
    { endpoint: US_EAST_2_ENDPOINT, lat: 40.0, lon: -83.0 },
  ];
  // Euclidean distance → return closest endpoint
}
Enter fullscreen mode Exit fullscreen mode

The result: sub-100ms database responses regardless of where the user is connecting from.

🎫 Intelligent Ticketing + SLA Engine

Tickets are auto-created from AI conversation analysis with generated titles and descriptions. SLA policies define per-priority timers, and an escalation risk score (0-100) considers:

Factor Points
SLA due within 30 min +40
Urgent priority +25
Customer frustration (4+ follow-ups) +15
Negative sentiment streak +15
Stale (8+ hrs no update) +10

📊 AI-Powered Analytics

  • AI Copilot — suggests replies to agents with acceptance rate tracking
  • Voice of Customer — sentiment distribution, complaint detection, praise identification
  • Agent Quality Score — resolution rate (40%) + sentiment impact (35%) + activity (25%)
  • Contact Health Score (0-100) — engagement recency, open tickets, message frequency
  • Topic Trending — intent volume week-over-week with severity classification
  • Workload Distribution — agent capacity management with concurrent chat limits

📢 Broadcast Campaigns

  • Scheduled or immediate mass messaging via WhatsApp templates
  • Audience segmentation with JSON-based filters (tags, segments, contact lists)
  • Real-time delivery analytics: sent → delivered → read → replied → failed
  • Template variable substitution: {name}, {phone}, custom fields

Tech Stack

Layer Technology
Framework Next.js 16, React 19, TypeScript
Styling Tailwind CSS 4, Radix UI, shadcn/ui
Database AWS Aurora DSQL (PostgreSQL-compatible, multi-region)
ORM Drizzle ORM
File Storage AWS S3
AI Models Gemini 2.5 Flash, GPT-4o, Claude Sonnet 4
Embeddings gemini-embedding-001, text-embedding-3-small
Auth JWT (jose) + bcrypt, httpOnly cookies
Messaging Meta WhatsApp Cloud API (Graph v21.0)
Deployment Vercel (Edge + Serverless)
Charts Recharts
Forms React Hook Form + Zod

What's Next

  • More regions (eu-west-1, af-south-1 for African markets)
  • Voice message transcription with Whisper
  • CSAT surveys sent via WhatsApp after ticket resolution
  • Shopify/WooCommerce integration for order status automation
  • Team performance leaderboards with gamification

Live Demo: imaradesk-ai.vercel.app


If you're building WhatsApp-based tools or working with Aurora DSQL, I'd love to hear your experience. Drop a comment below!

Top comments (0)