Platform Engineering
Tage: Conversational Trading Assistant with Durable WhatsApp Ingress
Designed a resilient two-tier architecture pairing a NestJS core with a Python/FastAPI LangGraph AI engine, durable Twilio webhook queuing, multi-provider LLM failover, and persona-driven market analysis for African retail traders.
Client / Context
Blage Technologies Solutions
My Role
Senior AI/ML Engineer & Solutions Architect
Timeline
2026
Verified Deliverables & Impact
Executive Overview
Retail trading across African markets is predominantly conducted through mobile devices, with WhatsApp serving as the primary communication hub. However, traditional trading platforms demand complex desktop interfaces and jargon-heavy charts that isolate everyday traders.
Tage was designed as an intelligent WhatsApp conversational trading assistant capable of real-time market inquiries, pending trade approvals, price alerts, and automated market digests tailored to different trader personas.
The Architectural Challenge
Building conversational financial agents over WhatsApp presents unique reliability constraints:
- Webhook Loss Under Network Spikes: Mobile network latency and webhook bursts from Twilio can overwhelm stateless endpoints, causing dropped user messages.
- Provider Rate Limits & Outages: Single-provider LLM dependencies risk dropping conversational state during API outages.
- Adaptive Tone: Institutional traders require concise Greeks and order book metrics; novice retail users need jargon-free explanations without losing analytical precision.
The Solution & System Design
1. Two-Service Distributed Architecture
The system is decoupled into two specialized services sharing a managed PostgreSQL database with pgvector:
- Core Ingress Tier (NestJS / TypeScript): Manages cryptographic Twilio signature verification, immediate durable acknowledgment into Redis via Bull queues, user session state, and scheduled market digests.
- AI Orchestration Engine (Python / FastAPI): Consumes tasks from Bull queues, runs intent classification, coordinates LangGraph supervisor subgraphs, and executes persona-conditioned response generation.
[ WhatsApp / User ]
│
▼
[ Twilio Webhook ]
│ (HMAC Verification)
▼
┌────────────────────────────────────────────────────────┐
│ NestJS Platform Core │
│ - Instant 200 OK Acknowledgment │
│ - Bull / Redis Persistent Ingress Queue │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ FastAPI & LangGraph AI Engine │
│ - Intent Classifier (Trade / Alert / Query / Digest) │
│ - Multi-Provider Failover (OpenAI 4o ◄► Claude 3.5) │
│ - 5-Persona Conditioning Layer │
│ - Market Data Connectors (CoinGecko / Polygon) │
└──────────────────────────┬─────────────────────────────┘
│
▼
[ WhatsApp Reply ]
2. Multi-Provider LLM Failover
To guarantee sub-second conversational responsiveness and zero downtime, the engine implements automatic failover routing:
- Primary: OpenAI GPT-4o / GPT-4o-mini for structured JSON tool-calling and rapid market queries.
- Fallback: Anthropic Claude 3.5 Sonnet / Haiku for deep reasoning and zero-downtime redundancy.
3. Five-Persona Conditioning Engine
Tage adapts to five distinct user styles dynamically served through the same orchestration core:
- Institutional Trader: Concise, metrics-first, order-flow focused.
- Scalper: Fast volatility triggers and entry/exit zones.
- Day Trader: Intraday momentum, support/resistance levels.
- Novice / Learning: Structured educational explanations with safety warnings.
- Jargon-Free Outsider: Plain conversational English explaining market moves in relatable terms.
Results
The decoupled queue-backed architecture guarantees zero message loss even during market volatility spikes, with 99.9% uptime across multi-provider failover routing and sub-second generation times.