All projects
Multi-tenant WhatsApp business automation suite

Sudarshan Pipes AI Assistant

The Sudarshan Pipes AI Assistant is a multi-tenant WhatsApp business automation suite built by Bhavesh Kumar Tiwari as AI Marketing Agents Engineer at Sudarshan Pipes (SEPL), a PVC and HDPE pipe manufacturer in Bengaluru. It combines bulk WhatsApp campaigns, an AI inbox that answers from the company knowledge base, tender BOQ extraction into GST quotations, AI tools for sales staff, and vendor KYC and staff registration forms.

Illustrative interface, not a screenshot

The problem

Sudarshan Pipes (SEPL) needed one place to run WhatsApp outreach and customer replies, read tender BOQs, prepare GST quotations and onboard vendors and technicians, instead of spreading that work across phones, spreadsheets and paper forms.

What I built

Built for Sudarshan Pipes (SEPL), a PVC and HDPE pipe manufacturer in Bengaluru. It began as a WhatsApp bulk-messaging tool with an AI chatbot and grew into an internal operations suite: campaigns, an AI-powered inbox, reading tender BOQs, generating quotations, vendor KYC, and staff and technician registration.

  • Two WhatsApp providers: a QR-linked WhatsApp Web session per user, or the official Business Cloud API with templates and delivery receipts
  • AI inbox: Hinglish-aware opt-outs, human handoff, and replies grounded in an uploaded Knowledge Base (internal-only docs never reach customers)
  • Bulk campaigns from Excel with per-contact fields, randomised pacing, hourly/daily caps, business-hours sending in the recipient's time zone, and automatic safety stops
  • BOQ → quotation: OCR and LLM extraction of tender documents, row repair and checks, pipe-line detection, GST quotations, and Excel / PDF / WhatsApp export
  • AI tools for staff: Ask AI, a sales Copilot, an Image Lead Extractor and photo-based pipe identification
  • Public Vendor KYC, multi-language technician registration, and an employee self-registration and staff directory
  • Secrets encrypted with AES-256-GCM, every query scoped to one user, and shared workspaces with owner-only settings

Results and impact

  • One platform covering campaigns, the AI inbox, BOQ-to-quotation, vendor KYC and staff registration
  • About 60 smoke-test scripts plus a dedicated campaign-reliability suite
  • Automatic safety stops and business-hours sending protect the company's WhatsApp account

Tech stack

  • React 19
  • Vite
  • Tailwind CSS
  • Node.js
  • Express
  • Socket.IO
  • Supabase (Postgres · Storage)
  • Baileys
  • WhatsApp Cloud API
  • NVIDIA (OpenAI-compatible)
  • Resend
  • Vercel
  • Render

In detail

Architecture

  • React 19 + Vite frontend on Vercel talks to a Node/Express backend over HTTPS and Socket.IO for live updates.
  • Supabase Postgres and Storage hold all data and files. The browser never reads tables directly; the backend scopes every query to one user.
  • AI runs on any OpenAI-compatible endpoint, NVIDIA by default (Llama, DeepSeek, Nemotron OCR, vision models), with a separate key and model per feature.
  • The server refuses to start without an encryption key, and warns at startup if a required SQL migration hasn't been run.
  • Public forms (KYC, technician, employee registration) need no login; the WhatsApp webhook is public but verifies its HMAC signature.

AI inbox and auto-reply

  • Opt-out check that understands Hinglish: “STOP”, “unsubscribe”, “bandh karo”, “mat bhejo”. “START” opts back in.
  • Human handoff: “talk to a human”, “call me” or “manager” flags the conversation and sends a holding reply.
  • AI replies grounded in a Knowledge Base built from uploaded TXT, MD, PDF or DOCX files, split into chunks for lookup.
  • New messages and unread counts are pushed to the dashboard as they arrive.

Campaigns

  • Four-step builder: Audience → Message → Safety → Review, with {{name}} / {{company}} fields filled per contact from Excel.
  • Recipients are claimed atomically, so nobody gets the same message twice.
  • Randomised delays (0.7×–1.4×), hourly and daily caps, and optional pauses every N messages.
  • Messages go out only during business hours in both your country and the recipient's, using the phone's country code.
  • Each WhatsApp error maps to an action: pause, retry with exponential backoff, fail permanently, or record an opt-out.
  • Automatic stops: pause if 50% of the last 20 sends failed, or after 5 identical errors in a row.
  • Sent → delivered → read tracking, scheduled sends, duplicate, retry failed and media attachments.

BOQ extraction and quotations

  • Upload a tender BOQ as PDF or Excel; scanned PDFs go through OCR, then an LLM extracts structured rows in chunks within a time budget.
  • Row repair checks qty × rate = amount, compares against the rate in words, and fixes OCR decimal errors (“45398 80” → 45398.80). Every change is logged and flagged rows must be reviewed.
  • Rule-based detection sorts each line into plastic pipe (HDPE, PVC, IS 4984…), other pipe, or not a pipe.
  • Quotations with your own rates, server-side GST (CGST + SGST or IGST), amount in words, and sequential numbers like SP/2026-27/0001.
  • Export as Excel with live formulas, a customer PDF, or send the PDF straight over WhatsApp.

AI tools for staff

  • Ask AI: an employee assistant answering from built-in knowledge, so a broken Knowledge Base can't break it.
  • Copilot: summarises a contact or conversation for a sales rep, with open questions, products discussed and talking points.
  • Image Extractor: reads business cards or lead lists with OCR / vision models into exportable lead rows.
  • Product Identification: identifies a pipe from a photo of it and its printed markings.

Forms, HR and admin

  • Vendor KYC form with document uploads, staff review and export.
  • Multi-language technician registration, plus employee self-registration and a staff directory with target progress and summary stats.
  • Storage monitor that emails alerts at 70 / 85 / 95 / 100% capacity, with a download-ZIP-then-clean-up tool.
  • Analytics: messages per day, campaign sent / delivered / read / failed, replies and opt-outs. Email via Resend.
  • Shared workspaces let one account open another's data after a share-list check; settings and WhatsApp stay owner-only.

Data, security and testing

  • API keys, WhatsApp tokens and sessions encrypted at rest with AES-256-GCM.
  • Schema built from 21 ordered Supabase migrations.
  • Security smoke tests for AI-key leaks, encryption at rest, JWT claims, internal-knowledge isolation and shared-access rules.
  • About 60 smoke-test scripts run against a fake Supabase client, plus a dedicated campaign-reliability suite.

Need something like this built?

I'm Bhavesh Kumar Tiwari, an AI automation engineer in Bengaluru, India, open to full-time, freelance and remote roles. Email me at tiwaribhaveshkumar@gmail.com.