What if every IPL captain had a full war-room of specialist AI analysts — each with a different role, each debating the optimal call — before every single over?
That question became TactiXI-AI: a multi-agent swarm we built in 36 hours at the National Developer Hackathon 2025. Five specialist AI agents. Real-time run-rate mathematics. Strategic DNA profiles of India's greatest captains. This is the full story of how we built it.
The Problem: Cricket Has a Data Problem Hiding in Plain Sight
Walk into any IPL dugout during a tense Super Over and you'll find something surprising. Amid analysts with laptops, coaches with earpieces, and physios tracking biometrics — the most important decisions are still made on instinct.
Cricket is no longer just a game of physical prowess. It's a game of high-dimensional numbers, millisecond decision-making, and structural field placement tactics. A single delivery can swing a team's win probability by 30%. A misread of dew on the outfield at over 14 can cost a team the match. And yet the tools available to a captain at the point of decision are shockingly primitive.
We saw a gap wide enough to bowl a Malinga yorker through.
Why a Single AI Model Wasn't Enough
Our first instinct — like most teams at a hackathon — was to build a single AI assistant. Feed it the scoreboard, ask it what to do. Simple. Elegant. Completely wrong.
The problem with a single model is the same problem with asking one analyst for everything: they optimise for the loudest signal and miss the quieter vulnerabilities. An AI asked "what field should I set?" will give you a confident answer. But it won't tell you that the same field leaves a 43-metre gap at mid-wicket that a left-hander will exploit in the 17th over. It won't stress-test its own recommendation.
Elite decision-making in sport is adversarial by nature. The best coaching teams include someone whose entire job is to poke holes in the primary plan. We needed to build that structure into the AI itself.
Core design principle: The swarm must contain a voice that actively tries to defeat its own recommendations. Without adversarial pressure, confidence becomes overconfidence — and overconfidence loses T20 matches in the death overs.
This drove the entire architecture: a sequential debate pipeline where each agent has a different mandate, a different prompt persona, and a different objective. The final call is a reconciliation of genuine conflict — not a consensus echo chamber.
The Architecture: Five Phases, One Captain's Call
We built TactiXI-AI as a five-phase sequential debate pipeline using Google Gemini 2.5 via @google/genai, orchestrated with the Agent Development Kit (ADK).
Phase 1 — Environment Intelligence (Pitch Analyst) · gemini-2.5-flash
Before any tactical recommendation, the system needs to understand the physical battlefield. The Pitch Analyst ingests the selected venue and synthesises boundary dimensions (72m straight at Wankhede vs. the notoriously short 56m square at Chinnaswamy), turf characteristics, and historical first-innings scores. This becomes the immovable environmental brief that every subsequent agent operates within.
Phase 2 — Numerical Telemetry (Data Scout) · TypeScript Math Engine
The Data Scout synthesises live scoreboard parameters through a custom TypeScript match mathematics engine we built from scratch. It calculates Current Run Rate, Required Run Rate, and — most critically — the Wicket-Pressure Index, a proprietary decay function that exponentially penalises win probability as wickets fall in the early overs. These hard numbers are injected directly into the system prompts of every downstream agent. The AI's strategic reasoning is always anchored to real-time arithmetic, not vibes.
Phase 3 — Plan A Proposal (Lead Strategist) · gemini-2.5-pro
Armed with the Phase 1 brief and Phase 2 telemetry, the Lead Strategist formulates primary bowling matchup and field placement recommendations. This is where Gemini 2.5 Pro earns its place: the agent considers striker weakness profiles, stadium-specific boundary exploits, and the current pressure index to produce one concrete, actionable Plan A — stated with conviction.
Phase 4 — Stress-Test Critique (Devil's Advocate) · gemini-2.5-pro
This is the phase that separates TactiXI-AI from every other AI cricket tool. The Devil's Advocate receives Plan A and is explicitly prompted to destroy it. It hunts for dew-risk vulnerabilities the Plan ignores, boundary holes in the proposed field, strike-rotation opportunities the batting side will exploit, and fatigue factors the lead strategist dismissed. It does not propose an alternative — its entire job is to surface the weaknesses.
The quality of Phase 5's final call depends entirely on the quality of this critique.
Phase 5 — The Reconciled Captain's Command · gemini-2.5-pro
The final agent receives the full debate transcript and reconciles it into a single definitive command. But here's where the magic happens: the reconciliation is filtered through the active Captain DNA Profile, meaning the same match state produces a fundamentally different final call depending on whether the persona is MS Dhoni, Rohit Sharma, or Gautam Gambhir.
The Mathematics: Grounding AI in Deterministic Truth
The single biggest risk with LLM-based systems in high-stakes environments is confident hallucination: the model sounds certain, the reasoning sounds coherent, but the underlying arithmetic is wrong. In a match where a team needs 47 off 18 balls, an AI that misunderstands the run-rate dynamic could recommend a containing field when the batting side is already 40% likely to win.
We solved this by building a deterministic Match Mathematics Engine in TypeScript that runs before every Gemini call and injects hard, verified numbers directly into every system prompt. The agents are not asked to calculate. They are told the answer — and their reasoning must be consistent with it.
CRR = Runs ÷ Overs Completed
RRR = (Target − Runs) ÷ Overs Remaining
WPI = 100 × (Wickets ÷ 10) × (1.5 − Overs ÷ 20)
The Wicket-Pressure Index (WPI) is our most innovative contribution. It's not a standard cricket statistic — we derived it from first principles. The function exponentially penalises the batting side's win probability as wickets fall, scaled against overs remaining. A team at 3/40 in over 6 carries a vastly higher Pressure score than 3/130 in over 16. That difference materially changes the recommended field placement.
This hybrid architecture — deterministic mathematics feeding probabilistic AI reasoning — is what makes TactiXI-AI trustworthy enough to actually use in a dugout environment.
Captain DNA Profiles: Same Match State, Three Different Calls
This was the feature that made our demo the most memorable moment of the hackathon. Three captain personas, each encoded as a philosophical filter applied at Phase 5 reconciliation.
CaptainArchetypePhilosophyMS DhoniIce-cold defendSpin choke in middle overs. Hold back strike bowlers for the death. Drag the batting side into a desperate final three balls. Patience as aggression.Rohit SharmaMatchups analyticalPace yorkers mapped to striker blind zones. Release angles engineered to match the batter's weakest technical quadrant. Data-driven on every delivery.Gautam GambhirAttacking chokeAggressive close-in slips from ball one. Choke the singles. Invite the mistake. Force high-risk shots by removing the easy option entirely.
These aren't cosmetic. Dhoni's profile deprioritises the Phase 4 boundary-risk warnings — he knows the batter will panic and mis-hit. Gambhir's profile amplifies the singles-choke analysis. Rohit's profile queries the Phase 2 engine for striker-specific historical matchup data before committing to any call.
Five Lessons from Building a Production AI Swarm in 36 Hours
- Adversarial prompting is not optional. The quality of the final call is almost entirely determined by the quality of the Phase 4 critique. A weak devil's advocate produces an overconfident, unchallenged recommendation. Invest in the dissenting voice — it makes every other agent sharper.
- Ground your AI in deterministic truth before letting it reason. Every time we tested without the Math Engine, the Gemini agents would subtly misread the run-rate situation. With it, every recommendation was internally consistent with the arithmetic reality of the match.
- Model selection per phase matters enormously. Using gemini-2.5-flash for Phases 1 and 2 — where the task is structured data synthesis, not open-ended reasoning — reduced latency dramatically with zero quality loss. Reserve gemini-2.5-pro for the phases that actually need it.
- Personas are a serious prompting technique, not a gimmick. The captain DNA profiles produced measurably different outputs — not just in tone, but in the actual field placements and bowling changes recommended. Well-constructed personas shift the model's reasoning priorities in ways that are meaningful and consistent.
- The demo is part of the product. A swarm that outputs a wall of text loses. A swarm with a stunning UI, live slider interactions, and a chatbot that responds in three seconds wins. Engineering and design are not separate disciplines at a hackathon — they are one deliverable.
Tech Stack
Google Gemini 2.5 Pro + Flash
Agent Development Kit (ADK)
@google/genai
TypeScript (custom Match Math Engine)
Dark-mode glassmorphism CSS
Real-time swarm orchestration
Context-aware Dugout Chatbot
What's Next
TactiXI-AI is a proof of concept that validates the core architecture. The five-agent debate pipeline works. The mathematics engine keeps the AI honest. The captain DNA profiles produce meaningfully different outputs.
The roadmap from here:
Live ball-by-ball ingestion — real-time ESPNCricinfo scraping to replace manual inputs; every ball triggers the swarm automatically
Biometric fatigue telemetry — GPS + heart-rate data from wearables feeding directly into the Wicket-Pressure computation
Cross-format expansion — T20 World Cup, Big Bash, PSL, each with their own pitch and boundary models
Mobile coaching companion — the captain's call and top three devil's advocate risks, surfaced within three seconds of a wicket falling
Historical validation layer — running the swarm backwards across archived IPL data to benchmark decision quality
TactiXI-AI proves that multi-agent swarms can serve as direct decision-support tools in professional sport — not someday, but today. We built the war-room. Now we want to put it in the dugout.
Built with passion, coffee, and Gemini 2.5 · National Developer Hackathon 2025
Top comments (0)