π Captain Cool β AI That Thinks Like an IPL Captain
What happens when you combine cricket strategy, multi-agent reasoning, and the Google Gemini ecosystem in a 3-hour hackathon sprint?
You get Captain Cool β an AI-powered IPL match strategist where multiple Gemini agents debate tactical cricket decisions like a real dressing room before making the final captainβs call.
Instead of building a generic chatbot with cricket terminology sprinkled on top, we wanted to simulate something much closer to a real IPL strategy room:
- analysts studying matchups,
- captains balancing risk,
- assistant coaches challenging decisions,
- and commentators explaining the logic to fans.
Built entirely on the Google AI ecosystem, Captain Cool became our attempt at turning agentic AI into a tactical cricket brain.
β‘ The Core Idea
During an IPL match, captains constantly make micro-decisions:
- Who bowls the next over?
- Should the spinner continue despite dew?
- Is it the right moment for the Impact Player?
- Do we attack or delay Bumrahβs final over?
- Which field setup reduces boundary probability?
Captain Cool processes the live match state and lets multiple AI agents argue over the best tactical decision before producing a final recommendation.
The result feels surprisingly close to a real cricket strategy meeting.
π§ Multi-Agent Architecture
Instead of relying on a single prompt, we decomposed the system into specialized Gemini-powered agents.
π΅οΈ Match Analyst Agent
Responsible for:
- venue conditions
- batter vs bowler matchups
- dew impact
- phase analysis
- tactical statistics
This agent also performs tool execution to fetch structured cricket insights.
π‘ Strategist Agent
The βcaptain brainβ of the system.
Inspired by tactical IPL leadership styles, this agent:
- proposes bowling changes,
- plans death overs,
- controls field aggression,
- and balances risk vs reward.
π₯ Devilβs Advocate Agent
This became the most interesting part of the project.
Its sole responsibility:
challenge the strategist.
Example:
βIf we use Bumrah now, who controls the 19th over against Tim David?β
This created genuine multi-agent reasoning instead of fake roleplay.
ποΈ Commentator Agent
The final layer converts raw AI logic into human cricket language.
Instead of:
βProbability optimization suggests pace utilization.β
The system explains:
βThe pitch is gripping slightly, so bowling pace-off cutters into the surface makes more tactical sense than feeding spin into the arc.β
This dramatically improved explainability.
π The Agentic Debate Loop
Our orchestration flow:
Match State
β
Analyst Agent
β
Strategist Proposal
β
Devilβs Advocate Critique
β
Strategist Revision
β
Commentator Explanation
β
Final Captain's Call
The important part:
the disagreement is visible.
We intentionally expose the internal tactical debate instead of hiding the reasoning.
π§© Full Runtime Architecture
[ User Inputs Live Match State via Streamlit UI ]
β
βΌ
[ app.py parses to Pydantic Schema ]
β
βΌ
ββββββββββββββββββββββββββββββββ
β agents.py Orchestrator β
βββββββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
β Match Analyst β β Strategist β β Devil's Advocate β
β (Gemini Flash) β β (Gemini Flash) β β (Gemini Flash) β
ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ
β β β
βΌ β β
[ NATIVE TOOL CALL ] β β
(get_matchup_stats) β β
β β β
ββββββββββββββββΊ Multi-Turn Loop ββββββββββββ
β
βΌ
[ Ultimate Captain Decree ]
β
βΌ
[ Rendered via Streamlit Chat ]
This architecture became the backbone of the project.
Instead of a single LLM generating tactical responses, the orchestrator coordinates multiple Gemini-powered specialist agents that challenge, refine, and evolve the decision before presenting the final tactical recommendation.
The visible disagreement between agents transformed the experience from βAI answering questionsβ into a realistic cricket strategy war-room.
π οΈ Tech Stack
AI & Agent Layer
- Google Gemini API
-
google-genaiSDK - Multi-agent orchestration inspired by Google ADK
- Gemini function/tool calling
Backend
- Python
- FastAPI
- Pydantic
Frontend
- Streamlit dashboard
- Custom dark-mode tactical UI
Development Workflow
- Built using Google Antigravity
- AI-assisted vibe coding
- Autonomous file scaffolding and iteration
π Example Match Scenario
We tested Captain Cool using a pressure scenario:
Match Situation
- RCB vs PBKS
- 150/2 after 14.2 overs
- Virat Kohli on strike
- Yuzvendra Chahal bowling
- Heavy dew expected later
π Analyst Insight
The Match Analyst agent triggered native tool execution and identified:
- Kohli performs strongly against traditional spin,
- but his scoring rate drops against googly-heavy leg-spin variations on slower surfaces.
π§ Internal Debate
Strategist
βAttack with leg-spin now before the dew settles in.β
Devilβs Advocate
βRisky. If Kohli survives the first six balls, the short boundary becomes a major issue.β
Strategist Revision
βFair. We hold the spinner back for one over and use hard-length pace into the surface first.β
π Final Captainβs Call
βBring back the pace bowler from the Pavilion End. Use cross-seam hard lengths into the pitch and protect square boundaries. Delay spin until the new batter arrives.β
β‘ Biggest Learnings
The most interesting realization from this build:
Multi-agent systems feel dramatically more intelligent when disagreement is visible.
The Devilβs Advocate agent consistently improved decisions by forcing counterfactual thinking.
Instead of:
βone smart AIβ
the project started feeling like:
βa real strategy room.β
πΈ Screenshots
Streamlit Tactical Dashboard
(Add your UI screenshot here)
Antigravity Development Workflow
(Add your Antigravity + code screenshot here)
Multi-Agent Debate Output
(Add your debate screenshot here)
π Future Improvements
If we continue developing Captain Cool, the next additions would be:
- Live Cricbuzz/ESPN integration
- Real-time win probability engine
- Voice commentary using Gemini Live API
- Memory across overs
- Multimodal pitch image analysis
- Full Google ADK orchestration
π GitHub Repository
π https://github.com/So-rush/captain-cool
π Final Thoughts
Cricket is ultimately a captainβs game.
Captain Cool was our attempt to explore what happens when tactical sports intelligence meets agentic AI reasoning inside the Google Gemini ecosystem.
And honestlyβ¦
watching AI agents argue about death-over bowling plans was way more fun than expected. π
Top comments (0)