LinXar Labs
LinXar OpsWhatsApp Cloud APIBullMQ & RedisGroq LLMPaystack WebhooksMulti-Tenant SaaS

LinXar Ops: Autonomous WhatsApp Operations Engine

Multi-Tenant Service, Booking & Commerce SMEs · Operations Automation / Conversational Commerce / SaaS

85%
3.5s
20+ hrs/wk

Overview

High-growth service and commerce businesses run on WhatsApp, yet their operations break the moment message volume scales. Staff spend hours answering repetitive pricing questions, checking calendar availability, and chasing Mobile Money or card confirmations by hand—while after-hours leads go cold overnight. We built LinXar Ops to replace manual inbox firefighting with an autonomous, multi-tenant operations engine. Every tenant connects their WhatsApp Business number via Meta Embedded Signup and gets an AI operator grounded in their live service catalog, pricing, staff availability, and payment links. LinXar Ops handles full booking, ordering, and Paystack checkout workflows end-to-end—and hands edge cases to human staff with full context.

The Challenge

Before LinXar Ops, business owners and front-desk teams were trapped inside WhatsApp threads all day. Customers waited 45–90 minutes for basic replies during peak hours and received zero responses after closing time. Staff manually cross-checked availability, typed out itemized quotes, sent payment details, verified transfer screenshots, and copied booking records into spreadsheets—creating dropped leads, double-booked slots, and constant context switching.

The Solution

LinXar Ops pairs an event-driven WhatsApp Cloud API ingestion pipeline with deterministic state-machine flows, Groq-powered intent reasoning, and automated Paystack settlement—isolated per tenant in Supabase PostgreSQL and streamed live to a Next.js operations console.

Real-Time Webhook Ingestion & Multi-Tenant Routing

Every inbound WhatsApp message is verified, compliance-checked, and queued for sub-second processing without blocking Meta's webhook SLA.

  • ›Express webhook endpoint verifies Meta signatures with timing-safe HMAC checks and routes messages to the owning tenant via Phone Number ID.
  • ›BullMQ + Redis (ioredis) queues decouple webhook acknowledgment from processing, backed by ComplianceManager for automatic opt-out/opt-in enforcement and normalized E.164 phone matching.

Hybrid Intent Reasoning & Deterministic Guardrails

Financial and booking-critical decisions are never left to LLM guesswork—deterministic pre-classifiers and database checks enforce accuracy.

  • ›Deterministic pre-classification (preClassifyIntent) intercepts payment and confirmation queries before calling the Groq SDK (groq-sdk) for natural-language intent detection and grounded responses.
  • ›Responses are anchored strictly to each tenant's Business Profile, live service/item catalog (with image cards), and SlotService availability in Supabase PostgreSQL.

Automated Booking, Ordering & Paystack Settlement

Customers browse services, pick time slots or build orders, and pay directly inside WhatsApp with automatic receipt generation.

  • ›FlowEngine orchestrates multi-step BookingEngine and OrderEngine state transitions persisted in Redis session state.
  • ›PaymentProcessor generates Paystack checkout links (Mobile Money & card), verifies payment webhooks via raw-body HMAC, triggers PDFKit receipt generation, and streams live status updates to the Next.js dashboard over Server-Sent Events (SSE).

Zero-Friction Human Escalation with Context

When a customer requests a person or hits a complex edge case, the bot steps aside cleanly and briefs the business owner.

  • ›HandoffManager writes a Redis silence lock (handoff:<clientId>:<phone>) and records a handoff_sessions entry so automated replies pause immediately.
  • ›The owner receives an instant WhatsApp alert containing the customer's name, normalized phone number, and exact trigger message, and can reply directly from the live Inbox.

Key Learnings

Never trust LLM classification alone for money or inventory: deterministic regex pre-classifiers and database-backed slot/price validation eliminated payment-link misfires.

WhatsApp phone numbers arrive in mixed local and international formats—normalizing every identifier to canonical E.164 across webhooks, Redis handoff locks, and SSE streams prevents split conversation threads.

Explicit Redis silence locks during human handoff are essential; without them, an automated reply firing mid-takeover immediately breaks customer trust.