<?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: Sakshi Tupsundar</title>
    <description>The latest articles on DEV Community by Sakshi Tupsundar (@sakshi_tupsundar_c472672a).</description>
    <link>https://dev.to/sakshi_tupsundar_c472672a</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%2F3898412%2F98ee4b91-649b-4dd1-ad35-e2d1ce73d6e5.png</url>
      <title>DEV Community: Sakshi Tupsundar</title>
      <link>https://dev.to/sakshi_tupsundar_c472672a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sakshi_tupsundar_c472672a"/>
    <language>en</language>
    <item>
      <title>Captain Cool: A Multi-Agent Gemini Cricket Captain That Actually Debates</title>
      <dc:creator>Sakshi Tupsundar</dc:creator>
      <pubDate>Sun, 17 May 2026 12:43:38 +0000</pubDate>
      <link>https://dev.to/sakshi_tupsundar_c472672a/captain-cool-a-multi-agent-gemini-cricket-captain-that-actually-debates-1np1</link>
      <guid>https://dev.to/sakshi_tupsundar_c472672a/captain-cool-a-multi-agent-gemini-cricket-captain-that-actually-debates-1np1</guid>
      <description>&lt;p&gt;Cricket strategy is rarely one clean answer. A captain reads the pitch, watches the batters, checks the required rate, thinks about dew, and still has to justify the call under pressure. That is the idea behind Captain Cool, my Gemini-powered IPL strategy assistant built with Python and Streamlit. Instead of using one generic chatbot, I built a small team of specialized agents that argue like a real support staff before giving the final on-field call.&lt;/p&gt;

&lt;p&gt;The project is intentionally agentic. Each role is a separate Gemini-powered agent with its own prompt, responsibility, and output style. The Stats Analyst studies the situation using tools. The Strategist proposes the next move like a T20 captain. The Devil's Advocate challenges that plan and points out what could go wrong. The Strategist then gets another turn to defend or revise the call. Finally, the Commentator turns the decision into fan-friendly cricket language instead of technical AI wording.&lt;/p&gt;

&lt;p&gt;Why this is truly multi-agent&lt;/p&gt;

&lt;p&gt;This is not one Gemini call pretending to wear four hats. The repo has separate agent modules and prompt files for each role. The flow is coordinated in an ADK-style sequential orchestrator, where state is passed from one node to the next so the agents can genuinely react to previous outputs.&lt;/p&gt;

&lt;p&gt;Manual Input or Live URL&lt;br&gt;
Stats AnalystGemini + tools&lt;br&gt;
StrategistInitial plan&lt;br&gt;
Devil's AdvocateCritique&lt;br&gt;
StrategistRevision or defense&lt;br&gt;
CommentatorHindi match-call output&lt;br&gt;
That loop matters. The final answer is not just generated once and prettified. The Strategist is forced to face criticism, which makes the system feel much closer to a dressing-room debate than a normal chatbot response.&lt;/p&gt;

&lt;p&gt;The four key agents&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stats Analyst&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This agent looks at score, overs, wickets, venue, pitch, and dew, then uses Gemini tool calling to ground the analysis. In the current implementation, it has access to:&lt;/p&gt;

&lt;p&gt;a win probability tool&lt;br&gt;
a pitch context tool&lt;br&gt;
That gives the rest of the system a better match-state summary than pure prompt-based reasoning.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Strategist&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This agent acts like an IPL captain. It decides the next tactical move for the bowling side, including the next over plan, pace-versus-spin choice, field shape, and Impact Player thinking. The prompt is written to sound like a cricket brain, not an analyst dashboard.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Devil's Advocate&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the pressure-test agent. Its job is to disagree intelligently, expose weak assumptions, and suggest why the initial plan may fail against the current batters, surface, or match phase.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Commentator&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This agent converts the final decision into match commentary. In the updated version, the output is styled like an enthusiastic Hindi commentator in Devanagari, which makes the system feel closer to a live broadcast than a plain assistant.&lt;/p&gt;

&lt;p&gt;Real tool use inside the workflow&lt;br&gt;
One of the hard requirements for this project was real tool usage from inside an agent, and Captain Cool does that through Gemini function calling in the Stats Analyst stage.&lt;/p&gt;

&lt;p&gt;The system currently uses:&lt;/p&gt;

&lt;p&gt;a custom win probability calculator based on score, target, wickets, and balls left&lt;br&gt;
a pitch context analyzer that explains how turning tracks, flat decks, two-paced surfaces, and dew change bowling decisions&lt;br&gt;
On top of that, I added a new stretch feature: live match URL ingestion. The app can now accept a Cricbuzz or ESPN-style live URL, scrape the page text, and ask Gemini to extract a structured MatchSituation object using schema-based output. That means the user no longer has to fill every field manually if live match context is available.&lt;/p&gt;

&lt;p&gt;The reasoning loop that makes the project interesting&lt;br&gt;
The most important part of the system is the multi-turn reasoning loop:&lt;/p&gt;

&lt;p&gt;The Stats Analyst creates the match-state summary.&lt;br&gt;
The Strategist proposes the first tactical plan.&lt;br&gt;
The Devil's Advocate attacks the weak points.&lt;br&gt;
The Strategist revises or defends the plan.&lt;br&gt;
The Commentator explains the final call like a broadcast moment.&lt;br&gt;
This back-and-forth is shown in the UI, not hidden. So if the captain changes from spin to pace-off cutters, or decides to delay the Impact Player move, the user can actually see why the revision happened. That improves trust and also makes the app more fun to use.&lt;/p&gt;

&lt;p&gt;A match scenario&lt;br&gt;
Imagine a chase where the batting team needs quick runs, dew is high, and two right-handers are set at the crease in the death overs. The Stats Analyst may flag that the required rate is climbing but that a wet ball reduces spinner control. The Strategist might initially recommend pace with yorkers and boundary riders. Then the Devil's Advocate may push back and warn that missing yorkers under dew could turn the over into a slot-ball disaster. The revised plan could become more nuanced: start with cutters into the surface, protect straight boundaries, and only return to yorkers once execution is under control.&lt;/p&gt;

&lt;p&gt;That is the kind of “why this, not that” reasoning I wanted Captain Cool to surface. The final answer should feel like cricket talk, not machine-learning talk.&lt;/p&gt;

&lt;p&gt;Extra functionality added in the updated version&lt;br&gt;
The latest version is stronger than the first draft in a few important ways:&lt;/p&gt;

&lt;p&gt;It now uses an ADK-style sequential orchestrator instead of a simple linear helper flow.&lt;br&gt;
It supports auto-fetching live match state from a pasted URL.&lt;br&gt;
It uses Gemini structured output to convert messy scraped text into a clean match schema.&lt;br&gt;
It includes a Hindi commentary layer for more broadcast-like fan output.&lt;br&gt;
It still keeps the experimental live visual analysis agent for frame-based or text-based match observation.&lt;br&gt;
The live visual agent is still best described as a prototype. It can analyze provided live context and optionally account for an uploaded frame, but it is not yet a full production-grade live video pipeline. I think that is important to state honestly.&lt;/p&gt;

&lt;p&gt;Tech stack&lt;br&gt;
Streamlit for the interface&lt;br&gt;
google-genai for Gemini calls&lt;br&gt;
google-adk for the workflow direction and agent pattern&lt;br&gt;
Pydantic for schemas&lt;br&gt;
requests and BeautifulSoup for live page fetching&lt;br&gt;
python-dotenv for config&lt;br&gt;
What I learned&lt;br&gt;
The biggest takeaway was that explainability matters more in sports products than in many other AI demos. Fans do not want a black-box answer. They want to know why the captain is going with a hard-length seamer, why fine leg is moving up, or why the spinner is being held back for one more over. Multi-agent design helped me make those trade-offs visible rather than hidden.&lt;/p&gt;

&lt;p&gt;Captain Cool is still evolving, but it already proves the core idea: if you let specialized Gemini agents debate like a real coaching group and then translate that debate into natural cricket language, the result feels much more useful than a generic sports chatbot.&lt;/p&gt;

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