<?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: ARNAV AHIRRAO</title>
    <description>The latest articles on DEV Community by ARNAV AHIRRAO (@arnav_ahirrao).</description>
    <link>https://dev.to/arnav_ahirrao</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%2F3936305%2F4f5c764d-f268-467b-975b-77a5efc642fa.png</url>
      <title>DEV Community: ARNAV AHIRRAO</title>
      <link>https://dev.to/arnav_ahirrao</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arnav_ahirrao"/>
    <language>en</language>
    <item>
      <title>🏏 Building "Captain Cool": A Multi-Agent IPL Strategist with Google Antigravity &amp; Gemini 2.5</title>
      <dc:creator>ARNAV AHIRRAO</dc:creator>
      <pubDate>Sun, 17 May 2026 13:06:47 +0000</pubDate>
      <link>https://dev.to/arnav_ahirrao/building-captain-cool-a-multi-agent-ipl-strategist-with-google-antigravity-gemini-25-6h5</link>
      <guid>https://dev.to/arnav_ahirrao/building-captain-cool-a-multi-agent-ipl-strategist-with-google-antigravity-gemini-25-6h5</guid>
      <description>&lt;p&gt;Cricket is a captain's game. It’s not just about the numbers; it’s about the gut feeling, the matchup risks, and anticipating what the opposition will do next.&lt;/p&gt;

&lt;p&gt;For the Google Gemini Hackathon, I had 3 hours to build an agentic AI system that makes tactical decisions like a real IPL captain. But I didn't want a generic chatbot that just spits out cricket trivia. I wanted a system that debates itself before committing to a call.&lt;/p&gt;

&lt;p&gt;Enter Captain Cool: a multi-agent orchestration engine built entirely on the Google Gemini stack.&lt;/p&gt;

&lt;p&gt;Here is how I built it using Google Antigravity, the google-genai SDK, and zero bloated frameworks.&lt;/p&gt;

&lt;p&gt;🏗️ The Architecture: A Three-Agent Debate Loop&lt;/p&gt;

&lt;p&gt;To make genuinely good cricket decisions, the system cannot wear four hats in a single API call. It needs distinct, isolated personas that pass context back and forth.&lt;/p&gt;

&lt;p&gt;I designed a 3-agent cyclic reasoning loop, overseen by a final Synthesizer:&lt;/p&gt;

&lt;p&gt;📊 The Stats Analyst: The anchor. This agent is strictly forbidden from giving advice. Its only job is to look at the match context and spit out raw data, matchups, pitch conditions, and historical trends.&lt;/p&gt;

&lt;p&gt;🎯 The Strategist: The decision-maker. It takes the Analyst's data and proposes an actionable plan (batting order, bowling rotation, field setups).&lt;/p&gt;

&lt;p&gt;⚠️ The Devil's Advocate: The stress-tester. It looks at the Strategist's plan, finds the biggest assumption or worst-case scenario (e.g., "What if we lose another wicket in the powerplay?"), and forces the Strategist to defend or adapt.&lt;/p&gt;

&lt;p&gt;These three agents loop for a configurable number of rounds, building a shared conversation history. Once the debate concludes, the Head Coach (Synthesizer) agent reads the entire transcript and outputs one definitive, battle-ready Markdown document.&lt;/p&gt;

&lt;p&gt;🛠️ The Tech Stack (Google In-House)&lt;/p&gt;

&lt;p&gt;Model: gemini-2.5-flash (Fast, highly capable, and perfect for multi-turn reasoning).&lt;/p&gt;

&lt;p&gt;SDK: Pure google-genai (Python). I intentionally avoided LangChain or AutoGen to keep the orchestration lightweight and fully custom.&lt;/p&gt;

&lt;p&gt;IDE: Google Antigravity. This was the secret weapon. I used Antigravity as an agentic pair-programmer to vibe-code the directory structure, wire up the Pydantic data schemas, and debug live API errors in real-time.&lt;/p&gt;

&lt;p&gt;🧠 The Prompts that Drive the Debate&lt;/p&gt;

&lt;p&gt;The magic is entirely in the system instructions. Here is how I scoped the Devil's Advocate to ensure it didn't just disagree for the sake of it, but actually improved the strategy:&lt;/p&gt;

&lt;p&gt;ROLE: Your job is to stress-test the Strategist's plan and expose every assumption, gap, and risk. You are not contrarian for its own sake — you are the last line of defence against overconfident planning.&lt;/p&gt;

&lt;p&gt;RESPONSIBILITIES:&lt;/p&gt;

&lt;p&gt;Identify the single biggest assumption in the Strategist's plan and challenge it with a realistic counter-scenario.&lt;/p&gt;

&lt;p&gt;Propose the most dangerous opposition counter-strategy.&lt;/p&gt;

&lt;p&gt;Model the "bad day" scenario: if 2-3 things go wrong simultaneously, does the plan have a recovery path?&lt;/p&gt;

&lt;p&gt;CONSTRAINTS:&lt;/p&gt;

&lt;p&gt;You MUST propose an alternative or a mitigation for every risk you raise.&lt;/p&gt;

&lt;p&gt;🔥 Scenario Walkthrough: PBKS hunting 222 vs RCB&lt;/p&gt;

&lt;p&gt;To test the system, I fed it a brutal, high-pressure match state: Punjab Kings are 10/1 after 1.3 overs. They are chasing Royal Challengers Bengaluru's massive 222-run total at Dharamshala. Here is how the multi-agent system handled it:&lt;/p&gt;

&lt;p&gt;Turn 1: Stats Analyst&lt;br&gt;
The Analyst instantly flagged the pitch as batting-friendly, but noted the required run rate was already north of 11 RPO. It highlighted that with Shikhar Dhawan out early, the powerplay metrics were deeply compromised.&lt;/p&gt;

&lt;p&gt;Turn 2: Strategist&lt;br&gt;
The Strategist proposed sending in Liam Livingstone at No. 3 as an "Anchor-Accelerator Hybrid," tasked with hitting boundaries from ball one, followed by Sam Curran to stabilize if another wicket fell. It mandated reaching 55-60 runs by the end of the powerplay.&lt;/p&gt;

&lt;p&gt;Turn 3: Devil's Advocate&lt;br&gt;
The Advocate jumped in, pointing out a critical flaw: relying on Livingstone to anchor and accelerate is a high-risk paradox. If Livingstone falls early trying to hit, the middle order is exposed to RCB's spinners with no momentum. The Advocate demanded a strict contingency plan if PBKS found themselves at 30/3.&lt;/p&gt;

&lt;p&gt;The Output:&lt;br&gt;
The final synthesized strategy explicitly mapped out the batting order, the required run-rate milestones per over, and the exact "In-Match Triggers" for when to abandon the plan and swing for the fences.&lt;/p&gt;

&lt;p&gt;[ 📸 Insert Screenshot of your Terminal output here showing the debate ]&lt;/p&gt;

&lt;p&gt;[ 📸 Insert Screenshot of your final Markdown output here ]&lt;/p&gt;

&lt;p&gt;🚧 Building Challenges &amp;amp; Antigravity to the Rescue&lt;/p&gt;

&lt;p&gt;Building this in a 3-hour window wasn't without hurdles.&lt;/p&gt;

&lt;p&gt;Initially, the 3-agent loop fired so fast that it tripped the API rate limits (429 RESOURCE_EXHAUSTED). Instead of abandoning the multi-agent design, I used Google Antigravity to dynamically inject pacing (time.sleep(15)) into the orchestrator loop.&lt;/p&gt;

&lt;p&gt;Later, we hit a 404 NOT_FOUND error because I was trying to call legacy models. Antigravity helped me quickly refactor the class definitions to hardcode gemini-2.5-flash, ensuring perfect execution within the hackathon environment constraints.&lt;/p&gt;

&lt;p&gt;🏆 Conclusion&lt;/p&gt;

&lt;p&gt;Cricket strategy is complex, but by decomposing the problem into distinct analytical, strategic, and critical personas, Gemini 2.5 proved it can reason through a T20 match just as well as the commentators in the box.&lt;/p&gt;

&lt;p&gt;Code is live on GitHub! Bring the heat. 🏏&lt;/p&gt;

</description>
      <category>gdgcloudpune</category>
    </item>
  </channel>
</rss>
