<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: KHAN REHAN</title>
    <description>The latest articles on DEV Community by KHAN REHAN (@lucifer_a73445e579a3be2a8).</description>
    <link>https://dev.to/lucifer_a73445e579a3be2a8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3936238%2F834cb04b-d47d-4b20-9fb5-cb0a08083336.png</url>
      <title>DEV Community: KHAN REHAN</title>
      <link>https://dev.to/lucifer_a73445e579a3be2a8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lucifer_a73445e579a3be2a8"/>
    <language>en</language>
    <item>
      <title>🏏 CaptainCool AI — Building a Multi-Agent IPL War Room with Gemini 2.5</title>
      <dc:creator>KHAN REHAN</dc:creator>
      <pubDate>Sun, 17 May 2026 12:33:37 +0000</pubDate>
      <link>https://dev.to/lucifer_a73445e579a3be2a8/captaincool-ai-building-a-multi-agent-ipl-war-room-with-gemini-25-h0b</link>
      <guid>https://dev.to/lucifer_a73445e579a3be2a8/captaincool-ai-building-a-multi-agent-ipl-war-room-with-gemini-25-h0b</guid>
      <description>&lt;p&gt;Modern T20 cricket is a tactical war room.&lt;/p&gt;

&lt;p&gt;Captains constantly calculate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bowling matchups&lt;/li&gt;
&lt;li&gt;dew impact&lt;/li&gt;
&lt;li&gt;field placements&lt;/li&gt;
&lt;li&gt;momentum shifts&lt;/li&gt;
&lt;li&gt;death-over strategy&lt;/li&gt;
&lt;li&gt;batter weaknesses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we asked ourselves:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What if IPL captains had an AI tactical command center?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That became &lt;strong&gt;CaptainCool AI&lt;/strong&gt; — a Gemini-powered multi-agent IPL strategist that thinks like a real captain under pressure.&lt;/p&gt;




&lt;h1&gt;
  
  
  🚀 What is CaptainCool AI?
&lt;/h1&gt;

&lt;p&gt;CaptainCool AI is a &lt;strong&gt;multi-agent AI system&lt;/strong&gt; that simulates an IPL captain’s decision-making process in real time.&lt;/p&gt;

&lt;p&gt;The user enters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;score&lt;/li&gt;
&lt;li&gt;wickets&lt;/li&gt;
&lt;li&gt;overs&lt;/li&gt;
&lt;li&gt;venue&lt;/li&gt;
&lt;li&gt;pitch conditions&lt;/li&gt;
&lt;li&gt;dew factor&lt;/li&gt;
&lt;li&gt;current batters&lt;/li&gt;
&lt;li&gt;bowlers remaining&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then multiple AI agents debate the best tactical move before generating the final captain’s decision.&lt;/p&gt;

&lt;p&gt;Instead of acting like a generic chatbot, the system behaves like a real IPL war room.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 The Core Idea
&lt;/h1&gt;

&lt;p&gt;Most sports AI projects simply generate commentary.&lt;/p&gt;

&lt;p&gt;We wanted something deeper:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tactical reasoning&lt;/li&gt;
&lt;li&gt;disagreement between agents&lt;/li&gt;
&lt;li&gt;live cricket analytics&lt;/li&gt;
&lt;li&gt;explainable decisions&lt;/li&gt;
&lt;li&gt;real-time debate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we designed a &lt;strong&gt;multi-agent architecture&lt;/strong&gt; powered by &lt;strong&gt;Google Gemini 2.5 Flash&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚡ The Multi-Agent System
&lt;/h1&gt;

&lt;p&gt;CaptainCool AI uses 5 specialized agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ Strategist Agent
&lt;/h2&gt;

&lt;p&gt;Acts like the tactical captain.&lt;/p&gt;

&lt;p&gt;Inspired by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MS Dhoni&lt;/li&gt;
&lt;li&gt;Rohit Sharma&lt;/li&gt;
&lt;li&gt;Hardik Pandya&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;choose next bowler&lt;/li&gt;
&lt;li&gt;field placements&lt;/li&gt;
&lt;li&gt;bowling rotation&lt;/li&gt;
&lt;li&gt;timeout timing&lt;/li&gt;
&lt;li&gt;impact player decisions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2️⃣ Stats Analyst Agent
&lt;/h2&gt;

&lt;p&gt;The data-driven cricket analyst.&lt;/p&gt;

&lt;p&gt;Uses tools to analyze:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;batter vs bowler matchups&lt;/li&gt;
&lt;li&gt;win probability&lt;/li&gt;
&lt;li&gt;pitch behavior&lt;/li&gt;
&lt;li&gt;dew impact&lt;/li&gt;
&lt;li&gt;venue patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This agent actively performs Gemini tool calling.&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Devil’s Advocate Agent
&lt;/h2&gt;

&lt;p&gt;The most important agent.&lt;/p&gt;

&lt;p&gt;This agent intentionally challenges the proposed strategy.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Bowling leg-spin in heavy dew could backfire because grip reduction is significant.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This prevents shallow AI reasoning and creates real tactical debate.&lt;/p&gt;




&lt;h2&gt;
  
  
  4️⃣ Strategist Revision Agent
&lt;/h2&gt;

&lt;p&gt;After criticism, the strategist revises or defends the plan.&lt;/p&gt;

&lt;p&gt;This creates genuine multi-turn reasoning instead of fake “multi-agent roleplay.”&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ Commentator Agent
&lt;/h2&gt;

&lt;p&gt;Transforms tactical reasoning into cinematic IPL-style commentary.&lt;/p&gt;

&lt;p&gt;This made the experience feel like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;live sports broadcasting&lt;/li&gt;
&lt;li&gt;tactical television analysis&lt;/li&gt;
&lt;li&gt;IPL commentary panels&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🏗️ Architecture
&lt;/h1&gt;

&lt;p&gt;Our architecture was built using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Vanilla HTML/CSS/JS&lt;/li&gt;
&lt;li&gt;Google Gemini 2.5 Flash&lt;/li&gt;
&lt;li&gt;SSE Streaming&lt;/li&gt;
&lt;li&gt;Multi-agent orchestration&lt;/li&gt;
&lt;li&gt;Gemini tool calling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Input
   ↓
FastAPI Backend
   ↓
Orchestrator
   ↓
Strategist Agent
   ↓
Stats Agent + Tools
   ↓
Devil's Advocate
   ↓
Strategist Revision
   ↓
Commentator
   ↓
Oracle Decision Engine
   ↓
Live Streaming Frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🔧 Gemini Tool Calling
&lt;/h1&gt;

&lt;p&gt;One of the biggest goals was making the system genuinely “agentic.”&lt;/p&gt;

&lt;p&gt;So we implemented real Gemini tool usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;get_matchup_stats()&lt;/li&gt;
&lt;li&gt;calculate_win_probability()&lt;/li&gt;
&lt;li&gt;get_pitch_conditions()&lt;/li&gt;
&lt;li&gt;get_weather_and_dew()&lt;/li&gt;
&lt;li&gt;fetch_player_recent_form()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools allow the AI agents to reason using structured cricket intelligence instead of hallucinating tactics.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"bowler"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Jadeja"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"batter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rohit Sharma"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"strike_rate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;162&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dismissals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🎨 Frontend Experience
&lt;/h1&gt;

&lt;p&gt;We didn’t want a normal dashboard.&lt;/p&gt;

&lt;p&gt;We wanted:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“F1 race strategy room meets IPL broadcast studio.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So we built:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;futuristic glassmorphism UI&lt;/li&gt;
&lt;li&gt;tactical war-room aesthetic&lt;/li&gt;
&lt;li&gt;live AI debate feed&lt;/li&gt;
&lt;li&gt;streaming agent messages&lt;/li&gt;
&lt;li&gt;animated tactical cards&lt;/li&gt;
&lt;li&gt;dynamic field visualization&lt;/li&gt;
&lt;li&gt;momentum engine&lt;/li&gt;
&lt;li&gt;confidence meters&lt;/li&gt;
&lt;li&gt;Gemini health monitor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The frontend was built entirely using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;TailwindCSS&lt;/li&gt;
&lt;li&gt;Vanilla JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No React.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚔️ The Debate System
&lt;/h1&gt;

&lt;p&gt;This was the most exciting part.&lt;/p&gt;

&lt;p&gt;Instead of a single AI response, agents actually challenge each other.&lt;/p&gt;

&lt;p&gt;Example flow:&lt;/p&gt;

&lt;h3&gt;
  
  
  Strategist
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;“Bring Bumrah now for wide yorkers.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Stats Analyst
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;“Yorkers reduced boundary percentage by 41% tonight.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Devil’s Advocate
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;“But the left-hander has a strong scoop-shot range against wide yorkers.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Strategist Revision
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;“Adjusting field: deep third goes finer.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This made the system feel alive.&lt;/p&gt;




&lt;h1&gt;
  
  
  📡 Real-Time Streaming
&lt;/h1&gt;

&lt;p&gt;We implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSE (Server Sent Events)&lt;/li&gt;
&lt;li&gt;async FastAPI streaming&lt;/li&gt;
&lt;li&gt;live agent feed&lt;/li&gt;
&lt;li&gt;cinematic loading states&lt;/li&gt;
&lt;li&gt;reconnect handling&lt;/li&gt;
&lt;li&gt;retry management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The UI streams each tactical message in real time like a live war-room broadcast.&lt;/p&gt;




&lt;h1&gt;
  
  
  🛡️ Solving Gemini Free-Tier Challenges
&lt;/h1&gt;

&lt;p&gt;One of the hardest parts was handling Gemini rate limits.&lt;/p&gt;

&lt;p&gt;Initially:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;too many agents&lt;/li&gt;
&lt;li&gt;too many requests&lt;/li&gt;
&lt;li&gt;quota crashes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We optimized heavily by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reducing prompt size&lt;/li&gt;
&lt;li&gt;compressing debate context&lt;/li&gt;
&lt;li&gt;caching responses&lt;/li&gt;
&lt;li&gt;adding retry queues&lt;/li&gt;
&lt;li&gt;exponential backoff&lt;/li&gt;
&lt;li&gt;fallback tactical logic&lt;/li&gt;
&lt;li&gt;lightweight local synthesis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made the demo stable enough for hackathon environments.&lt;/p&gt;




&lt;h1&gt;
  
  
  🎙️ Fun Features
&lt;/h1&gt;

&lt;p&gt;We also added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;voice commentary&lt;/li&gt;
&lt;li&gt;captain personality modes&lt;/li&gt;
&lt;li&gt;tactical alerts&lt;/li&gt;
&lt;li&gt;cinematic intro audio&lt;/li&gt;
&lt;li&gt;animated reconnect states&lt;/li&gt;
&lt;li&gt;backend diagnostics&lt;/li&gt;
&lt;li&gt;fallback tactical engine&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  💡 What We Learned
&lt;/h1&gt;

&lt;p&gt;This project taught us something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Multi-agent systems become powerful when agents genuinely disagree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Devil’s Advocate agent dramatically improved tactical quality because it forced deeper reasoning.&lt;/p&gt;

&lt;p&gt;We also learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;streaming UX matters a lot&lt;/li&gt;
&lt;li&gt;tool calling makes AI feel trustworthy&lt;/li&gt;
&lt;li&gt;sports strategy is a perfect use case for agentic AI&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🚀 Final Thoughts
&lt;/h1&gt;

&lt;p&gt;CaptainCool AI started as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What if Dhoni had AI assistants in his earpiece?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It evolved into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a tactical cricket simulator&lt;/li&gt;
&lt;li&gt;a real-time AI debate system&lt;/li&gt;
&lt;li&gt;a multi-agent sports intelligence platform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And honestly?&lt;/p&gt;

&lt;p&gt;Watching AI agents argue about IPL death-over tactics is ridiculously fun.&lt;/p&gt;




&lt;h1&gt;
  
  
  🏏 Tech Stack
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Google Gemini 2.5 Flash&lt;/li&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Vanilla JavaScript&lt;/li&gt;
&lt;li&gt;TailwindCSS&lt;/li&gt;
&lt;li&gt;SSE Streaming&lt;/li&gt;
&lt;li&gt;Gemini Tool Calling&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔥 Future Improvements
&lt;/h1&gt;

&lt;p&gt;We’d love to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;live Cricbuzz integration&lt;/li&gt;
&lt;li&gt;real scorecard ingestion&lt;/li&gt;
&lt;li&gt;multimodal pitch analysis&lt;/li&gt;
&lt;li&gt;AI-generated field maps&lt;/li&gt;
&lt;li&gt;voice conversations with captains&lt;/li&gt;
&lt;li&gt;real-time match simulations&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  👋 Thanks for Reading
&lt;/h1&gt;

&lt;p&gt;If you love:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cricket&lt;/li&gt;
&lt;li&gt;AI agents&lt;/li&gt;
&lt;li&gt;sports analytics&lt;/li&gt;
&lt;li&gt;Gemini-powered systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then CaptainCool AI was built for you.&lt;/p&gt;

&lt;p&gt;🏏⚡&lt;br&gt;
🏏 Built CaptainCool AI — a Gemini-powered multi-agent IPL war room that thinks like a real captain under pressure.&lt;/p&gt;

&lt;p&gt;⚡ Strategist Agent&lt;br&gt;
📊 Stats Analyst&lt;br&gt;
😈 Devil’s Advocate&lt;br&gt;
🎙️ Commentator AI&lt;/p&gt;

&lt;p&gt;Real tactical debate. Real tool calling. Real-time streaming. Built with Google Gemini 2.5 + FastAPI + Vanilla JS.&lt;/p&gt;

&lt;p&gt;“What if Dhoni had AI analysts in his earpiece?” 👀&lt;/p&gt;

&lt;p&gt;Huge shoutout to the amazing community and energy around building agentic AI systems 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  GoogleGemini #GeminiAI #GDG #GDGPune #GoogleDeveloperGroups #AI #AgenticAI #IPL #Hackathon #FastAPI #Python #WebDevelopment #GenerativeAI #GoogleAI #MultiAgentSystems #BuildWithAI #CloudCommunity #SportsAI
&lt;/h1&gt;

&lt;p&gt;@GDG Pune @GDG Cloud Pune&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>gemini</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
