<?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: Mayur Kate</title>
    <description>The latest articles on DEV Community by Mayur Kate (@mkate).</description>
    <link>https://dev.to/mkate</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%2F3936204%2F89f50f5d-4e4e-4d53-9615-59afefa8e4ca.png</url>
      <title>DEV Community: Mayur Kate</title>
      <link>https://dev.to/mkate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkate"/>
    <language>en</language>
    <item>
      <title>🏏 Captain Cool: Building a Multi-Agent IPL Strategist with Google Gemini &amp; ADK</title>
      <dc:creator>Mayur Kate</dc:creator>
      <pubDate>Sun, 17 May 2026 12:40:25 +0000</pubDate>
      <link>https://dev.to/mkate/captain-cool-building-a-multi-agent-ipl-strategist-with-google-gemini-adk-a9n</link>
      <guid>https://dev.to/mkate/captain-cool-building-a-multi-agent-ipl-strategist-with-google-gemini-adk-a9n</guid>
      <description>&lt;p&gt;In the high-pressure cooker of T20 cricket, a captain has mere seconds to make decisions that dictate the outcome of a match. Who bowls the death overs? How do you set a field for a rampaging Suryakumar Yadav on a gripping pitch? &lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;Agentic Premier League&lt;/strong&gt;, I set out to solve the captain-strategist problem. Standard AI chatbots are too generic &amp;amp; agreeable to make tough, high-stakes sports decisions. To fix this, I built &lt;strong&gt;Captain Cool&lt;/strong&gt;, a virtual IPL captain powered by the Google Gemini stack. &lt;/p&gt;

&lt;p&gt;Instead of a single prompt, Captain Cool uses a &lt;strong&gt;Multi-Agent Debate Framework&lt;/strong&gt; orchestrated via the &lt;strong&gt;Google Agent Development Kit (ADK)&lt;/strong&gt;. It actively fetches live weather data, proposes a strategy, aggressively critiques its own plan, and outputs a fan-friendly tactical breakdown.&lt;/p&gt;

&lt;p&gt;Here is a deep dive into the architecture, the agentic design, and how to run it yourself.&lt;/p&gt;




&lt;h3&gt;
  
  
  🏗️ High-Level Design (HLD) &amp;amp; Architecture
&lt;/h3&gt;

&lt;p&gt;To achieve a true "agentic" workflow, the system cannot rely on a single LLM call wearing multiple hats. It requires distinct personas executing a sequential loop.&lt;/p&gt;

&lt;p&gt;The application is built on a Python backend wrapping the &lt;code&gt;google-genai&lt;/code&gt; SDK and the &lt;code&gt;google-adk&lt;/code&gt;. The frontend is a sleek, responsive dashboard built with Streamlit.&lt;/p&gt;

&lt;h4&gt;
  
  
  The 5-Turn Agentic Loop
&lt;/h4&gt;

&lt;p&gt;Here is the logical flow of our system. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4wx6qq0yqmim00ukuoqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4wx6qq0yqmim00ukuoqf.png" alt=" " width="490" height="2048"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔬 Low-Level Design (LLD): The Agentic Team &amp;amp; Prompts
&lt;/h3&gt;

&lt;p&gt;To optimize for both speed and deep reasoning, I utilized model routing. The deep-thinking agents (Strategist/Advocate) run on &lt;code&gt;gemini-2.5-pro&lt;/code&gt;, while the fast data-gatherers and summarizers (Analyst/Commentator) run on &lt;code&gt;gemini-2.5-flash&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here are the system prompts engineered for the team:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The Stats Analyst (The Tool Caller)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;gemini-2.5-flash&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; To ground the LLM in reality rather than hallucinating conditions.&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"You are a precise cricket data analyst. You will receive a JSON of the current match state. Before doing anything else, you MUST execute your provided Python tool call &lt;code&gt;get_venue_weather(venue)&lt;/code&gt; to fetch the live temperature and dew risk for the provided stadium. Append this real-world data to the match context and pass it forward."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  2. The Strategist (The Captain)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;gemini-2.5-pro&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; The primary decision-maker.&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"You are an elite, proactive IPL Captain (think MS Dhoni or Rohit Sharma). Review the match state and the Analyst's weather report. Propose the exact next tactical decision: who bowls the next over, the field setup, and how to utilize remaining bowlers for the death. Be decisive and explain your cricketing reasoning based on matchups and pitch conditions."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  3. The Devil's Advocate (The Skeptic)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;gemini-2.5-pro&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; To force the AI to self-correct and avoid obvious traps.&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"You are a ruthless cricket tactician and skeptic. Review the Strategist's proposal. Your ONLY job is to attack this plan. Point out vulnerabilities, batter vs. bowler mismatches, or instances where they ignored the dew factor or pitch conditions. Do not be polite. Highlight the risk of their strategy."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  4. The Match Commentator (The Explainer)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;gemini-2.5-flash&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Role:&lt;/strong&gt; Fan-facing communication and stretch-goal execution.&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"You are a charismatic cricket commentator like Harsha Bhogle. Take the Strategist's final defended decision and explain the internal debate to the fans in exciting, natural cricket language. YOU MUST INCLUDE TWO THINGS AT THE END: 1) A Confidence Score (0-100%) for the decision. 2) A 'Counterfactual' explaining exactly how the win probability would drop if they had taken the safe route instead."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;💡 &lt;strong&gt;Architectural Choice: Cost &amp;amp; Latency Optimization&lt;/strong&gt;&lt;br&gt;
By routing the heavy analytical debate turns to &lt;code&gt;gemini-2.5-pro&lt;/code&gt; and the high-speed data fetching and summary turns to &lt;code&gt;gemini-2.5-flash&lt;/code&gt;, the architecture maximizes tactical accuracy while minimizing overall token latency and API consumption costs.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚙️ Real Tool Calling in Action
&lt;/h3&gt;

&lt;p&gt;Instead of hardcoding a JSON payload to fake "live context," the Stats Analyst agent uses Google Gemini's native function calling to execute a real Python script.&lt;/p&gt;

&lt;p&gt;When the user inputs "Wankhede Stadium", the Analyst executes a function that pings the free &lt;strong&gt;Open-Meteo API&lt;/strong&gt;, parses the coordinates, and returns the exact live temperature and humidity to determine the dew risk. This proves the system can break out of its training data and interact with the live internet to make decisions.&lt;/p&gt;




&lt;h3&gt;
  
  
  📸 End-to-End Walkthrough: The Wankhede Scenario
&lt;/h3&gt;

&lt;p&gt;Let's look at the system in action during a high-stakes scenario.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Situation:&lt;/strong&gt; 2nd Innings. 15.6 overs gone. 67 runs needed off 24 balls. Suryakumar Yadav (75 off 34) is on strike. Pitch is slowing down and gripping.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4k4h76136k33cy7uh17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4k4h76136k33cy7uh17.png" alt=" " width="284" height="1444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we click "Generate Strategy", the ADK routes the inputs through our 5-turn debate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fheij585shucsyrp6yww1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fheij585shucsyrp6yww1.png" alt=" " width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Debate:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Strategist&lt;/strong&gt; proposes bowling Rashid Khan in the 17th over, arguing that we need a wicket-taking option immediately on a gripping pitch, saving Bumrah for the absolute death (18 and 20).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Devil's Advocate&lt;/strong&gt; violently objects, calling it a "glaring vulnerability" and a "perilous gamble" because SKY is a master at dissecting wrist-spinners and is fully set.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Defense:&lt;/strong&gt; The Strategist absorbs the critique but defends the move, stating that bowling a medium pacer like Mohit Sharma is just as risky but without the wicket-taking upside. It's a calculated necessity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, the &lt;strong&gt;Commentator&lt;/strong&gt; agent wraps it up, translating the intense AI reasoning into an engaging broadcast format, complete with a 75% confidence score and a detailed counterfactual.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7wz9s0e1wtw8d52lv8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7wz9s0e1wtw8d52lv8u.png" alt=" " width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔄 Handling Advanced Match Context (Dew &amp;amp; Impact Players)
&lt;/h3&gt;

&lt;p&gt;To satisfy the strict requirements of the problem statement, the system evaluates two high-stakes variables:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Dew Factor:&lt;/strong&gt; Instead of guessing, the Stats Analyst uses live tool-calling to fetch humidity data, allowing the Strategist to know if the ball will turn or slip.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Impact Player Availability:&lt;/strong&gt; The underlying &lt;code&gt;match_state.json&lt;/code&gt; contract accepts an optional &lt;code&gt;impact_player_available&lt;/code&gt; boolean flag. When set to &lt;code&gt;true&lt;/code&gt;, the Strategist explicitly evaluates bench options if a quick breakthrough or pinch-hitting acceleration is required in the middle overs.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  🎯 Hitting the Stretch Goals
&lt;/h3&gt;

&lt;p&gt;This architecture was specifically designed to hit the hackathon's advanced requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Explainability:&lt;/strong&gt; The Commentator removes ML jargon and outputs pure cricket logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence &amp;amp; Counterfactuals:&lt;/strong&gt; Hardcoded into the final output agent for deep fan insight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Across Overs:&lt;/strong&gt; The Streamlit &lt;code&gt;session_state&lt;/code&gt; appends the final strategy to a &lt;code&gt;match_history&lt;/code&gt; list. If the user advances the over from 15.6 to 16.0, the context is fed back into the Strategist, ensuring the AI remembers its previous overs!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  💻 Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google Gemini API:&lt;/strong&gt; &lt;code&gt;gemini-2.5-pro&lt;/code&gt; &amp;amp; &lt;code&gt;gemini-2.5-flash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Agent Development Kit (ADK):&lt;/strong&gt; Orchestrating the multi-agent pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Antigravity:&lt;/strong&gt; Google's agentic IDE used for 100% of the vibe-coding and environment setup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamlit:&lt;/strong&gt; For the rapid, chat-based dashboard UI.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏆 Try it Yourself!
&lt;/h3&gt;

&lt;p&gt;Want to see the agents debate your favorite IPL scenarios? The complete codebase is open-source and ready to run locally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/mayureshkate/captain-cool-ipl/tree/main" rel="noopener noreferrer"&gt;https://github.com/mayureshkate/captain-cool-ipl/tree/main&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Quick Start Guide:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repository&lt;/span&gt;
git clone https://github.com/mayureshkate/captain-cool-ipl.git
&lt;span class="nb"&gt;cd &lt;/span&gt;captain-cool-ipl

&lt;span class="c"&gt;# 2. Set up the virtual environment&lt;/span&gt;
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate  &lt;span class="c"&gt;# On Windows use: venv\Scripts\activate&lt;/span&gt;

&lt;span class="c"&gt;# 3. Install dependencies&lt;/span&gt;
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="c"&gt;# 4. Add your Gemini API Key&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"GEMINI_API_KEY=your_api_key_here"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .env

&lt;span class="c"&gt;# 5. Launch the Streamlit App&lt;/span&gt;
streamlit run app.py &lt;span class="nt"&gt;--server&lt;/span&gt;.port 3000

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cricket is a captain's game. But with Gemini and ADK, it's an agent's game too.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for the Agentic Premier League Hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  gdgcloudpune
&lt;/h1&gt;

&lt;h1&gt;
  
  
  gdgcloudapl2026
&lt;/h1&gt;

</description>
    </item>
  </channel>
</rss>
