Cricket is a captain’s game.
So we asked ourselves a simple question:
What if an AI system could think like an IPL captain in real time?
That question became Captain Cool — a real-time multi-agent IPL tactical intelligence platform built entirely on Google’s Gemini ecosystem for the Agentic Premier League (APL) hackathon organized by GDG Cloud Pune.
Instead of building another generic AI chatbot with a cricket theme slapped on top, we wanted to build something that actually felt like an IPL tactical dugout.
Not just predictions. Not just commentary. Not just score analysis.
We wanted:
Live tactical debate
Pressure-aware captaincy decisions
Real field placements
Matchup intelligence
Visual cricket strategy
Agent disagreement
Real-time match ingestion
Broadcast-style presentation
The result was Captain Cool — an elite tactical war-room where multiple Gemini-powered agents collaborate, disagree, revise strategy, and ultimately make the next big IPL decision.
🚀 The Core Idea
In IPL cricket, the difference between winning and losing often comes down to tactical decision-making:
Who bowls the next over?
Do you save your strike bowler for the 19th?
Do you attack spin or pace?
Which side of the field do you protect?
Should the captain force square hitting?
Is the dew changing the bowling plan?
Real captains constantly balance:
match pressure
player matchups
pitch conditions
momentum
psychology
risk management
We wanted our AI system to do the same.
So instead of a single AI response, Captain Cool creates a live tactical debate between multiple specialized Gemini agents.
🧠 Multi-Agent Architecture
One of the biggest requirements of the APL hackathon was that the system had to be genuinely agentic.
That meant:
❌ Not one Gemini prompt pretending to be four people.
✅ Multiple independent Gemini-powered agents with different personalities, prompts, responsibilities, and reasoning styles.
Our system uses four primary tactical agents:
📊 Agent 01 — Stats Analyst
The Stats Analyst acts like a CricViz-style tactical analyst.
Responsibilities:
Batter vs bowler matchup analysis
Run-rate pressure evaluation
Death-over scoring patterns
Tactical risk estimation
Pitch + dew impact analysis
Example reasoning:
"High dew reduces Pathirana’s slower-ball grip, increasing the risk of missed yorkers under pressure."
🧠 Agent 02 — Strategist
The Strategist behaves like the actual IPL captain.
Responsibilities:
Next bowling decision
Tactical field setup
Pressure management
Bowling plan execution
Momentum control
Example reasoning:
"Attack now. If Kohli survives two more overs, the chase tilts permanently."
⚠️ Agent 03 — Devil’s Advocate
This became one of the most interesting parts of the entire project.
Instead of allowing the AI system to blindly agree with itself, we created a dedicated tactical critic.
Responsibilities:
Challenge risky strategies
Expose hidden tradeoffs
Force strategic reconsideration
Simulate alternative captaincy logic
Example reasoning:
"If Bumrah bowls now, who controls the 19th when the wet ball becomes impossible to grip?"
This creates actual tactical tension.
And more importantly:
The field setup and strategy can visibly change after the debate.
🎙️ Agent 04 — Commentator
Finally, the Commentator translates all tactical reasoning into fan-friendly broadcast-style cricket language.
Instead of AI jargon, the output feels like real IPL commentary.
Example:
"Mumbai are gambling slightly here, but one quiet over could suffocate this chase completely."
⚔️ Real-Time Tactical Debate
One of the hardest parts was making the system feel genuinely alive.
We didn’t want:
static AI outputs
giant text paragraphs
generic chatbot responses
We wanted a live tactical war-room.
So we built a structured multi-turn reasoning pipeline:
Live Match State
↓
Stats Analyst
↓
Strategist Proposal
↓
Devil’s Advocate Challenge
↓
Strategist Revision
↓
Final Captain Decision
↓
Commentator Explanation
This creates visible tactical evolution.
The AI system doesn’t just answer.
It debates.
🔗 Live Cricbuzz & ESPN Match Ingestion
One of the stretch goals in the challenge was live match ingestion.
We implemented:
✅ Cricbuzz live URL parsing ✅ ESPN Cricinfo support ✅ Dynamic scoreboard extraction ✅ Real-time tactical state generation
The user simply pastes a live match URL:
https://www.cricbuzz.com/live-cricket-scorecard/...
And the system automatically extracts:
Teams
Current score
Overs
Wickets
Striker
Non-striker
Bowler
Venue
Match phase
Required RR
Current RR
This instantly transforms the app into a real-time tactical engine.
🛡️ Anti-Hallucination Architecture
One major issue with sports AI systems is hallucination.
LLMs often invent:
players
bowlers
match states
fake field setups
To solve this, we built a strict structured match-state architecture.
Instead of letting Gemini freely invent context, every agent only reasons on validated entities.
Example:
{
"batting_team": "MI",
"bowling_team": "CSK",
"score": "172/5",
"overs": 17,
"striker": "Hardik Pandya",
"bowler": "Pathirana"
}
This dramatically improved realism and tactical consistency.
🏟️ Tactical Field Visualization
This became one of the strongest parts of the project.
Instead of just listing fielders in text, we built a live tactical field visualization system.
The UI dynamically renders:
Long-off
Long-on
Deep square leg
Third man
Sweeper cover
Deep midwicket
Bowling trajectories
Tactical protection zones
As the debate changes, the field can update visually in real time.
That means:
strategy becomes visual
debate has consequences
tactical intent becomes instantly understandable
This transformed the experience from:
“AI chatbot”
into:
“Professional IPL strategy software.”
🎨 UI Philosophy — Building an IPL War-Room
We wanted the UI to feel:
cinematic
premium
tactical
broadcast-grade
pressure-aware
The design direction was inspired by:
CricViz
Formula 1 strategy dashboards
IPL broadcast graphics
tactical command centers
The final interface includes:
✅ Match Control Panel ✅ Tactical Debate Timeline ✅ Executive Decision Engine ✅ Dynamic Field Visualization ✅ Win Probability Display ✅ Tactical Objective Cards ✅ Commentary Ticker
The goal was simple:
Make the system feel alive.
⚡ Technology Stack
Frontend
Next.js 16
TypeScript
Tailwind CSS
Framer Motion
Lucide Icons
SVG Tactical Rendering
Backend
Python FastAPI
BeautifulSoup4
Uvicorn
AI Layer
Google Gemini 2.5 Flash
Google GenAI SDK
Multi-Agent Orchestration
Structured Tactical State Engine
🧩 System Workflow
User Pastes Match URL
↓
Live Match Extraction
↓
Structured Match State
↓
Gemini Multi-Agent Debate
↓
Tactical Revision
↓
Field Visualization
↓
Final Captain Decision
↓
Broadcast Commentary
🎯 Key Challenge
The hardest part was balancing:
realism
orchestration
tactical quality
visual immersion
low latency
hallucination control
Especially during live match reasoning.
The biggest lesson:
Sports AI is not just about prediction.
It’s about believable tactical intelligence.
📸 Screenshots
Match Control + Tactical Debate
Dynamic Tactical Field Setup
Executive Decision Engine
🔥 What Makes Captain Cool Different?
Most sports AI systems:
generate predictions
summarize statistics
act like generic chatbots
Captain Cool instead focuses on:
✅ Tactical disagreement ✅ Pressure-aware captaincy ✅ Real cricket reasoning ✅ Live strategy evolution ✅ Multi-agent orchestration ✅ Visual tactical intelligence ✅ Broadcast-style presentation
The result feels much closer to:
an IPL tactical dugout
than:
a normal AI assistant.
🏆 Final Thoughts
This project started as a hackathon idea.
But somewhere during development, it stopped feeling like “just another AI project.”
The moment live debates started changing actual field placements visually, the system suddenly felt real.
That was the turning point.
Captain Cool became less of a chatbot and more of a living tactical war-room.
And honestly?
That’s exactly what we wanted.
🔗 GitHub Repository
GitHub: https://github.com/AntiDynamic/gdg_cricket.git
🙌 Huge Thanks
Big shoutout to:
GDG Cloud Pune
Google Gemini ecosystem
Agentic Premier League organizers
Everyone building insanely creative AI systems during the hackathon
The energy, atmosphere, conversations, food, and nonstop building vibe made this one of the most exciting hackathon experiences we’ve had.
Google Ai Studio: https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%5B%221qSsnfW3i6umcLH2o5udnnQvPXKh8edLA%22%5D,%22action%22:%22open%22,%22userId%22:%22101755463357330089295%22,%22resourceKeys%22:%7B%7D%7D&usp=sharing



Top comments (0)