Back to Case Studies
WhatsAppAgentic AIMicroservicesBackendWebGeminiWhisperSystem DesignLLMOpsAzureNext.jsPythonFastAPI

Signale WhatsApp AI

Event-driven multi-modal WhatsApp assistant on Azure Container Apps and Service Bus, scaling to 1,000+ beta users with Whisper audio, Gemini Flash vision, and 250+ deterministic spec tests.

Overview

Signale is a multi-modal personal assistant built directly on top of WhatsApp. Users send voice notes, photos, or text messages to organize notes, schedule reminders, and sync events with Google Calendar without leaving their chat thread.

Delivered as a 90-day engagement for a venture partner, we took the platform from initial architecture to a monetized production system serving thousands of active beta users.

User Workflow

Signale WhatsApp Workflow

"Remind me at 6pm to take out the trash, and schedule a 15 min event on my calendar."

Bot Response (Translated): "Reminder created: 'Take out trash'. Calendar event 'Take out trash' scheduled for Sept 14th at 18:00."

Engineering Constraints

Launching a consumer AI assistant over the WhatsApp Business API introduced three immediate constraints:

  • Multi-Modal Payloads: Incoming webhooks carry arbitrary combinations of text, voice notes (OGG/Opus audio), and images that must be unified into a single conversational context.
  • Webhook Timeouts: Meta's webhook ingress requires fast HTTP 200 OK acknowledgments; synchronous LLM or audio transcription calls inside the request handler cause webhook retries and duplicate messages.
  • Burst Traffic: Group chat referrals create sudden concurrency spikes that require rapid horizontal scaling from low baseline idle cost.

Event-Driven Architecture on Azure

We decoupled webhook ingestion from multi-modal inference using asynchronous queues and KEDA-scaled serverless containers on Azure.

1. Core Stack

  • Ingestion & Orchestration API: Python FastAPI with LangGraph managing conversational state and tool routing.
  • Asynchronous Decoupling: Azure Service Bus buffers all incoming WhatsApp webhooks. The ingestion endpoint validates the payload signature, enqueues the event, and returns 200 OK in milliseconds while background workers process media and LLM calls.
  • Queue-Driven Compute: Azure Container Apps scale worker replicas from 1 to N based on Service Bus queue depth via KEDA rules, keeping idle compute costs under $5/month while absorbing traffic bursts.

2. Multi-Modal Processing Pipeline

  • Audio Transcription: Dedicated worker service consuming audio jobs from Service Bus and transcribing Portuguese and English voice notes via OpenAI Whisper.
  • Vision Extraction: Dedicated worker service using Gemini Flash to extract structured descriptions, OCR text, and semantic tags from user-uploaded images.
  • Intent Routing: LangGraph state machine routing normalized text across specialized handlers (Reminders, Notes, Calendar Sync, and Semantic Search).

Visual Semantic Retrieval

When a user sends an image, the vision worker indexes both the raw media in Azure Blob Storage and its extracted semantic description in PostgreSQL (pgvector), enabling natural-language retrieval over personal media.

Image Semantic Retrieval

"Show me my dog pics" — Signale executes a vector similarity search over the user's indexed media descriptions and returns the matching images via WhatsApp.

Voice-to-Structured State

Voice notes are transcribed and parsed directly into structured list mutations or calendar actions.

Audio to Structured Data

User Audio (7s): "Add banana, apples, and beer to my supermarket shopping list."

Bot Response (Translated): "Note saved: Supermarket Shopping List. • banana • apples • beer"

Multi-Intent Reminders & Interactive Callbacks

A single utterance frequently contains multiple distinct actions across different subsystems.

1. Multi-Intent Execution Complex Reminder Setting

"Prepare lunch at 11:45 and book in calendar, remind me about it" — Dispatches two parallel tool executions:

  1. Inserts an event into the user's linked Google Calendar via OAuth.
  2. Schedules a delayed WhatsApp notification job.

2. Interactive State Transitions Interactive Reminder

Scheduled reminders render native WhatsApp interactive reply buttons ("Mark as completed", "Snooze"), allowing deterministic state updates without invoking the LLM.

3. Domain-Bounded Intent Routing & Type-Safe Outputs

Rather than relying on brittle keyword regexes or unconstrained tool calling, we structured the agent around four explicit domain models:

  • Notes Store (CRUD and semantic retrieval over user notes and media)
  • Calendar Engine (Google Calendar OAuth sync and conflict checks)
  • Reminder Scheduler (Temporal parsing and delayed job scheduling)
  • Conversational Fallback (General Q&A and onboarding guidance)

Schema Enforcement with Pydantic

Every LLM node uses structured output parsing (StructuredLlmAgent backed by Pydantic) to validate tool arguments before execution. This eliminates malformed or hallucinated JSON payloads and guarantees type safety across boundaries between the LLM and PostgreSQL.

4. Specification-Driven QA

Conversational state machines are prone to subtle regressions when prompts or models change. We enforced behavior through automated testing:

  • 10-Point UX Specification: Explicit handling rules for ambiguous timestamps, mixed-language inputs (Portuguese/English code-switching), and implicit conversational references.
  • 250+ Integration Tests: Every release ran against an automated regression suite covering multi-turn golden scenarios (such as appending to existing shopping lists, rescheduling conflicting meetings, and recovering from expired OAuth tokens).

5. Fault Tolerance & Worker Resilience

Background media workers (ImageProcessor, AudioProcessor) were hardened against external API failures:

  • Dead-Letter Queues (DLQ): Poison messages exceeding retry thresholds are isolated in Service Bus DLQs for inspection without blocking active partitions.
  • Exponential Backoff: Transient rate limits from WhatsApp Media APIs or LLM endpoints trigger jittered retries.
  • Cache-Miss Fallback: If a media asset expires in the local Blob Storage cache, the worker transparently re-fetches the media URL from the WhatsApp Graph API.

6. Deployment & Operations

  • CI/CD: GitHub Actions pipelines running the test suite, building multi-stage Docker images, and deploying immutable revisions to Azure Container Apps.
  • Connection Pooling: PgBouncer sidecar multiplexing asyncpg connections in transaction mode (read the deep dive).
  • Monetization: Stripe billing integration paired with a Next.js web dashboard for subscription and account management.

Zero-Downtime Revision Traffic Splitting: Deployments use Azure Container Apps revision management. New container revisions boot and pass readiness probes against staging queues before receiving 100% of live webhook traffic, preventing dropped chat sessions during releases.

Outcomes

  • 90-Day Delivery: Shipped from initial repository setup to a Stripe-monetized production platform in 12 weeks.
  • Verified Concurrency: Handled 1,000+ concurrent beta users during launch spikes with stable ~120ms API latency and zero database connection timeouts.
  • Unit Economics: KEDA scale-to-zero workers kept baseline idle compute under $5/month while scaling horizontally during campaign bursts.

— Pedro

Founder & Principal Engineer