Panda FPL
Production Multi-Agent AI System for Fantasy Premier League on WhatsApp

Overview
In Swahili, 'Panda' means 'to climb' — climbing the global leaderboard and dominating fiercely competitive mini-leagues. Across Kenya and East Africa, Fantasy Premier League is serious business, with millions of managers competing in high-stakes private leagues where real money, pride, and bragging rights are at stake. Yet every Friday, managers endure hours of analysis paralysis across disparate xG models, injury leaks, and press conferences. Panda FPL eliminates this friction by embedding an elite tactical War Room directly inside WhatsApp, delivering data-backed transfer recommendations and fixture swing simulations in sub-10 seconds.
The Challenge
Engineering conversational sports analytics over messaging surfaces presents formidable challenges: (1) natural language queries are highly ambiguous, leading monolithic LLMs to hallucinate obsolete bench rules or non-existent transfers; (2) managers expect sub-10-second response times despite complex multi-hop algorithmic calculations; (3) public messaging interfaces invite conversational banter that can rapidly inflate inference token costs without pre-authorization; and (4) European midweek fixtures frequently pollute Premier League difficulty schedules if not strictly isolated.
The Solution
I architected a specialized hierarchical multi-agent system. A Supervisor Router classifies inbound intent and delegates queries to domain specialists: the Tactician (chip planning, captaincy dilemmas, multi-gameweek transfers), the Scout (differential search, fixture swings via ClubElo ratings, and value picks with squad token masking), Accounts (billing, balances, transaction receipts), and Onboarding (syncing manager IDs). Crucially, I engineered an atomic credit-metering engine: user balances are verified and deducted in an atomic database lock before inference starts, protected by automated compensation refund hooks on upstream failure. Localized monetization is driven by sub-second Safaricom M-Pesa STK Push billing integrated alongside Paystack.
Key Results
Successfully packaged complex quantitative football analytics into a natural 30-second WhatsApp dialogue. The multi-agent pipeline delivers sub-10-second data-grounded insights without hallucination, while the atomic billing engine completely protects system unit economics. The project serves as a battle-tested blueprint for domain-specific agent routing, tool grounding, and mobile money monetization over messaging networks.
- Hierarchical Multi-Agent War Room (Supervisor Router + Tactician + Scout Specialists)
- ClubElo Fixture Difficulty Engine with Strict EPL Schedule Isolation
- Atomic Pre-Flight Credit Metering & Automated Compensation Refund Hooks
- Safaricom M-Pesa STK Push & Paystack Sub-Second Payment Automation
- Squad Token Masking for Context Window Optimization & Hallucination Elimination
Engineering Deep Dives
In-depth architectural postmortems, system design trade-offs, and production blueprints written for this project.
Behind the Multi-Agent Architecture of Panda FPL
How Swahili grit, mini-league stakes, RAG on official rules, and ClubElo data power a conversational FPL strategist.
Preventing Runaway LLM Costs with Atomic Credit Metering
The unit economics of conversational AI on WhatsApp, pre-flight credit deduction, and sub-second M-Pesa STK Push billing.
Engineering Sub-10-Second Tactical AI on WhatsApp
In-memory audio decoding, distributed debounce locks, and context pruning for real-time matchday traffic.
Tech Stack
Deep Dives
Architectural essays exploring the code and infrastructure: