DEV Community

Cover image for cap cool
_51_Arnav_ Warale_
_51_Arnav_ Warale_

Posted on

cap cool

🏏 Building "Captain Cool": A Multi-Agent IPL Strategist Built Live During PBKS vs RCB
Tags: #GoogleCloudAPL #BuildwithAI #Gemini #Python #AI

If there’s one thing that matches the high-stakes pressure of an IPL run chase, it’s a 3-hour live hackathon.

For the Agentic Premier League (APL), the challenge was clear: move beyond basic "AI chatbots" and build a true Agentic Workflow using Google’s Generative AI stack—all while watching the live PBKS vs RCB clash at Dharamsala.

So, I built Captain Cool—an autonomous, multi-agent strategy engine designed to debate, analyze, and formulate high-stakes cricket tactics in real-time.

Here is a breakdown of how I used "Vibe Coding," Google Gemini 2.5, and the Google ADK to pull it off before the final over.

🚨 The Problem: Chatbots Don't Win T20s
A standard LLM wrapper is boring. If you ask a basic chatbot, "How do I bowl to Venkatesh Iyer in the 19th over?", it gives you a generic, Wikipedia-style answer.

But real IPL dugouts don't work like that. Real strategy requires pulling live environmental data, pitching an idea, arguing about the flaws in that idea, and committing to a final tactical blueprint. I needed an AI architecture that could mimic the internal debate of a championship-winning team.

đź§  The Solution: Multi-Agent Orchestration
Enter the Google Agent Development Kit (ADK). Instead of one AI model trying to do everything, I orchestrated four distinct AI personas using a mix of Gemini 2.5 Pro (for deep reasoning) and Gemini 2.5 Flash (for speed).

Here is the exact Agentic Loop running under the hood of Captain Cool:

📊 The Data Analyst (Tool User): Before any strategy is formed, this agent uses Python requests to autonomously hit the wttr.in API, pulling live humidity and temperature data for the stadium to calculate the "Dew Factor" and pitch grip degradation.

🧢 The Captain Strategist: Ingests the Analyst’s weather report and the live match state (e.g., 208/3, 19th over, Flat Pitch) to propose a primary tactical blueprint.

👿 The Devil's Advocate: This is where the magic happens. Acting as a cynical Vice-Captain, this agent actively reviews the Captain's plan, searching for flaws, edge cases, or counter-attacks based on the current batter's profile.

🎙️ The Match Commentator: Translates the final, resolved strategy into an electrifying live broadcast format for the UI.

📸 The Live MVP
[ 🛑 HACKATHON INSTRUCTION: Drag and drop your main Streamlit UI screenshot right here! ]

I built the frontend strictly using native Streamlit components. The goal was absolute stability and speed.

As you can see in the command center, when the match parameters are submitted, you don't just get an answer—you get the Tactical Blueprint, the Live Commentary, and full transparency into the Strategy Room Debate Log where the agents argued over the bowling lengths.

[ 🛑 HACKATHON INSTRUCTION: Drag and drop a close-up screenshot of your "Dissent Log" expander open, showing the agents arguing here! ]

⚡ The "Vibe Coding" Experience
Building this in under three hours required a radical shift in how I code. Using the Antigravity IDE, I leaned heavily into "vibe coding"—focusing strictly on prompting the system architecture, defining the agent personas, and managing state logic, while the AI handled the boilerplate UI rendering and CSS structuring.

It felt less like typing code and more like directing a team of engineers.

đź’» The Tech Stack
LLMs: Google Gemini 2.5 Pro (Reasoning) & Gemini 2.5 Flash (Speed)

Framework: Google ADK (Agent Development Kit)

Frontend: Streamlit

Tooling: Python requests (Autonomous API calling)

đź”— Check out the Code
Want to see how the agents communicate? Check out the full source code on GitHub:
👉 [ 🛑 HACKATHON INSTRUCTION: Paste your GitHub Repo Link Here! ]

The PBKS vs RCB match might be wrapping up, but the era of Agentic AI is just getting started. Huge shoutout to GDG for hosting an incredible APL build-a-thon!#gdgpune #gdgcloudpune

Top comments (0)