<?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: Ritesh Deshmukh</title>
    <description>The latest articles on DEV Community by Ritesh Deshmukh (@ritesh_deshmukh_10e64446d).</description>
    <link>https://dev.to/ritesh_deshmukh_10e64446d</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%2F3936105%2F714b4251-c78c-4e8f-8475-b3193aa67658.jpg</url>
      <title>DEV Community: Ritesh Deshmukh</title>
      <link>https://dev.to/ritesh_deshmukh_10e64446d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ritesh_deshmukh_10e64446d"/>
    <language>en</language>
    <item>
      <title>UndercoverCaptain</title>
      <dc:creator>Ritesh Deshmukh</dc:creator>
      <pubDate>Sun, 17 May 2026 13:50:03 +0000</pubDate>
      <link>https://dev.to/ritesh_deshmukh_10e64446d/undercovercaptain-473</link>
      <guid>https://dev.to/ritesh_deshmukh_10e64446d/undercovercaptain-473</guid>
      <description>&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%2F1br3kz0pw30p91kh2947.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%2F1br3kz0pw30p91kh2947.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;br&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%2Fczhfj97vji6j2jrb4fip.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%2Fczhfj97vji6j2jrb4fip.png" alt=" " width="800" height="320"&gt;&lt;/a&gt;# OverMind: I Built a Multi-Agent IPL Captain Using Google Gemini — Here's How the Agents Argue&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"What if Dhoni's instinct, a data scientist's spreadsheet, and an argumentative assistant coach all lived inside one AI system?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the question I set out to answer at this hackathon. The result is &lt;strong&gt;OverMind&lt;/strong&gt; — a multi-agent AI system that acts as a virtual IPL captain, makes tactical decisions ball by ball, and &lt;em&gt;shows you the internal debate&lt;/em&gt; before committing to the call.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem: Cricket Strategy is a Multi-Brain Problem
&lt;/h2&gt;

&lt;p&gt;Real captaincy isn't one person thinking alone. Watch any IPL dugout — there's the captain reading the pitch, the coach watching the data, the assistant flagging the tired bowler, and the commentator framing it for the crowd.&lt;/p&gt;

&lt;p&gt;Most AI cricket tools give you &lt;em&gt;one&lt;/em&gt; answer from &lt;em&gt;one&lt;/em&gt; model. OverMind gives you &lt;strong&gt;four agents genuinely arguing&lt;/strong&gt; — and you see the argument.&lt;/p&gt;


&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Input (Match State)
        │
        ▼
  ┌─────────────┐
  │ Orchestrator │  ← multi-turn debate loop manager
  └──────┬──────┘
         │
    ┌────┴──────────────────────────────────┐
    │           │              │            │
    ▼           ▼              ▼            ▼
Stats       Strategist    Devil's       Commentator
Analyst     (proposes)    Advocate      (final voice)
(tool calls) │            (challenges)       │
    │         │              │               │
    │    ◄────┘  ← IF HIGH severity:         │
    │         revision round                 │
    │                                        │
    └────────────────────────────────────────┘
                        │
                        ▼
              Final Captain's Call
        (Decision + Debate + Win Probability)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Tech stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gemini 2.5 Flash via &lt;code&gt;@google/genai&lt;/code&gt; (JS/Node.js)&lt;/li&gt;
&lt;li&gt;Google Antigravity for agentic vibe-coding&lt;/li&gt;
&lt;li&gt;Google AI Studio for prompt prototyping&lt;/li&gt;
&lt;li&gt;Google ADK pattern for multi-agent orchestration&lt;/li&gt;
&lt;li&gt;Gemini function calling for live tool use&lt;/li&gt;
&lt;li&gt;Express.js backend + vanilla HTML frontend&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  The Four Agents
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Agent 1 — Stats Analyst 📊
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Pure data. No opinions. Just numbers and matchup records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a data-driven IPL cricket analyst. Given match state and available 
tools, you analyze bowler vs batsman matchups, venue history, and recent form. 
You speak in numbers and percentages. You MUST call the calculateWinProbability 
tool and at least one cricket stats tool before forming your analysis. 
Output structured JSON: { winProbability, keyMatchup, recommendation, confidence }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tools it calls:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;calculateWinProbability(innings, over, score, wickets, target, pitchFactor)&lt;/code&gt; — logistic regression based on required run rate, wickets in hand, overs remaining&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getBowlerVsBatsmanRecord(bowlerName, batsmanName)&lt;/code&gt; — dismissals, economy, dot ball %, average from Cricbuzz API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;getVenueStats(venue, playerName)&lt;/code&gt; — historical strike rate and average at venue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where the &lt;strong&gt;real Gemini function calling&lt;/strong&gt; happens. The agent doesn't hardcode win probability — it calls the tool and gets a live computed result.&lt;/p&gt;




&lt;h3&gt;
  
  
  Agent 2 — Strategist 🧠
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Captain's tactical brain. Reads the Analyst's findings and makes ONE specific call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are the IPL captain's tactical brain — like MS Dhoni's instinct combined 
with data. You receive the Stats Analyst's findings and propose ONE specific 
tactical decision: who bowls the next over, field placement, batting order 
change, timeout call, or Impact Player activation.

Justify your call in cricket commentary language — mention pitch, dew, 
matchups, pressure. Never use ML jargon. Output JSON: 
{ decision, primaryReason, alternativeConsidered, confidenceLevel }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What makes it agentic:&lt;/strong&gt; It's a &lt;em&gt;separate&lt;/em&gt; Gemini API call that receives the Analyst's output as context. Not one call wearing two hats — genuinely two calls, two system prompts, one conversation.&lt;/p&gt;




&lt;h3&gt;
  
  
  Agent 3 — Devil's Advocate 😈
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Finds the flaw in every plan. Proposes a counter-decision. Rates severity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are the assistant coach who always challenges the captain's first instinct. 
Your job is to find flaws in the Strategist's proposed decision. Consider:
- What if dew makes spin ineffective?
- Is the bowler being brought on actually tired or out of rhythm?
- Is the batter due for a big shot?
Challenge hard. Propose a counter-decision if the original is wrong.
Output JSON: { challenge, counterDecision, severity (low/medium/high) }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The key mechanic:&lt;/strong&gt; If severity === &lt;code&gt;"high"&lt;/code&gt;, the orchestrator routes back to the Strategist for a &lt;em&gt;revision round&lt;/em&gt;. The Strategist must either defend or update its decision. This is the loop that makes OverMind genuinely multi-turn.&lt;/p&gt;




&lt;h3&gt;
  
  
  Agent 4 — Commentator 🎙️
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; Takes the full debate transcript and turns it into cricket language any fan can understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are Harsha Bhogle meets Nasser Hussain — you turn tactical cricket 
decisions into vivid, exciting commentary. You receive the full agent debate 
and the final decision. Write:
1. FINAL DECISION — one crisp sentence
2. CAPTAIN'S CALL — 3-4 lines of rich cricket commentary explaining why
3. THE DEBATE — summarize what the Devil's Advocate said and how the 
   Strategist responded
4. WHY NOT THE OTHER OPTION — one line explaining the rejected alternative

Write like you're on air. No jargon. Output plain text.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Orchestrator: Where the Magic Happens
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;runOverMind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchState&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Step 1: Stats Analyst with real tool calls&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;analysis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;statsAnalystAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchState&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Step 2: Strategist proposes a decision&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;proposal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;strategistAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Step 3: Devil's Advocate challenges it&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;challenge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;devilsAdvocateAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Step 4: Revision loop if severity is HIGH&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;finalDecision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;severity&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;high&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;finalDecision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;strategistAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Step 5: Commentator writes the final call&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;commentary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;commentatorAgent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;finalDecision&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;finalDecision&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;commentary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;debateTranscript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;challenge&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;finalDecision&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;winProbability&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;analysis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;winProbability&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Strategist potentially runs &lt;strong&gt;twice&lt;/strong&gt; — that's the revision round, and that's what makes the debate real.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Full Match Scenario: CSK vs MI, Over 15
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Input:&lt;/strong&gt; Innings 2 | Over 15 complete | Score 120/3 | Target 185 | Striker: Jadeja (22 off 18) | Dew setting in | Wankhede&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Win probability: &lt;strong&gt;41%&lt;/strong&gt;. Jadeja scores at 178 SR against mystery spinners. Hardik's pace is down 2 kmph from over 10. Dew factor increasing — spin grip deteriorates by over 17.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Strategist (Round 1) says:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Bowl Hardik Pandya in over 16. His yorkers in overs 15-17 are a proven weapon — 8 wickets this season. Dew won't affect pace."&lt;/em&gt;&lt;br&gt;
Confidence: HIGH&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Devil's Advocate fires back:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Hardik's last over went for 14. A tired fast bowler at Wankhede against a set Jadeja on a small ground is a full-toss machine, not a yorker bowler. CSK will get 18+."&lt;/em&gt;&lt;br&gt;
Counter: Bowl Pollard. Severity: &lt;strong&gt;HIGH&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Strategist (Revision Round) says:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Conceded on the fatigue point. Revised: Pollard in over 16, with a 7-2 field. Third man back for Jadeja's ramp shot — he's played it twice tonight. Pollard's slower ball is a wicket-taking delivery with this setup."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Commentator's Final Call:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Kieron Pollard, over 16.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Rohit's gone to his big man, and you know what — this is smart captaincy. The temptation was Hardik, but look at him — he's been running hard all night and that last over told you everything. Pollard is fresh, he's got the slower ball, and crucially — he's got Jadeja's number this season. The field is set beautifully: seven men on the leg side, third man back for that ramp Jadeja's been teasing all match. If CSK get less than 14 off this over, MI win this game."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Tool Calls in Detail
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;calculateWinProbability&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Gemini function definition&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;winProbTool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;calculateWinProbability&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Calculate batting team win probability based on match state&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;object&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;innings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;over&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;wickets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;pitchFactor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1.0 = flat, &amp;lt;1 = difficult&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;innings&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;over&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;score&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wickets&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;target&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// The actual computation&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateWinProbability&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;innings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;over&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wickets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pitchFactor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ballsLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;over&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;needed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;score&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rrrRatio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;needed&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;ballsLeft&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// vs par RRR&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;wicketsInHand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;wickets&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Logistic regression weights (tuned on IPL 2022-2024 data)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2.1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.8&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;rrrRatio&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.15&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;wicketsInHand&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pitchFactor&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;winProbability&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prob&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;ballsLeft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;needed&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Stats Analyst calls this via Gemini function calling — the model decides &lt;em&gt;when&lt;/em&gt; to invoke it and &lt;em&gt;what arguments&lt;/em&gt; to pass. That's genuine agentic tool use, not hardcoded JSON.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Built with Google Antigravity
&lt;/h2&gt;

&lt;p&gt;OverMind was vibe-coded over 3 hours in Antigravity. The &lt;code&gt;.antigravity/&lt;/code&gt; folder in the repo contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agent trace logs from each run (showing which agent called which tool)&lt;/li&gt;
&lt;li&gt;Prompt iteration history (I went through 4 versions of the Devil's Advocate system prompt before it started challenging hard enough)&lt;/li&gt;
&lt;li&gt;The commit history shows the moment I added the revision loop — that was the turning point where the system felt genuinely alive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key things Antigravity helped with:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scaffolding all 4 agent files in one shot&lt;/li&gt;
&lt;li&gt;Writing the Gemini function calling boilerplate correctly the first time&lt;/li&gt;
&lt;li&gt;Debugging the orchestrator revision loop (the &lt;code&gt;severity === 'high'&lt;/code&gt; routing logic had an off-by-one bug on the conversation history)&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Stretch Goals Implemented
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Win probability gauge&lt;/strong&gt; in the UI — shows the shift from pre-decision to post-decision projected probability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debate timeline UI&lt;/strong&gt; — each agent's output shown as a chat-style timeline so you can follow the argument step by step&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence scores&lt;/strong&gt; — Strategist outputs &lt;code&gt;confidenceLevel&lt;/code&gt; which the Commentator references&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Counterfactual line&lt;/strong&gt; — Commentator always ends with "why not the other option"&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What I'd Do With More Time
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Cricbuzz URL scraping&lt;/strong&gt; — paste a live match URL, Gemini's URL context tool reads the scorecard automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice I/O&lt;/strong&gt; — Web Speech API in + Gemini Live API out, so the captain literally talks back&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory across overs&lt;/strong&gt; — Gemini context caching to track the full match arc cheaply across 20 overs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimodal input&lt;/strong&gt; — feed Gemini a pitch image or scorecard screenshot&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The revision loop is everything.&lt;/strong&gt; A system where the Strategist can &lt;em&gt;change its mind&lt;/em&gt; because of the Devil's Advocate is categorically different from a system that just presents multiple options. The revision loop is what turns OverMind from a chatbot with cricket lipstick into something that actually feels like a dugout debate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate system prompts matter.&lt;/strong&gt; Early versions used one Gemini call with a long prompt asking for multiple roles. The quality improved dramatically when each agent got its own API call and its own system prompt. The Commentator in particular — when it only had to think about &lt;em&gt;how to say things&lt;/em&gt;, not &lt;em&gt;what to decide&lt;/em&gt; — started producing genuinely vivid cricket language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let the agents surprise you.&lt;/strong&gt; I didn't expect the Devil's Advocate to start flagging fatigue signals I hadn't put in the match state. It inferred from the economy rate data that the bowler had been bowling in short bursts — and challenged the plan on that basis. That's the system working better than I designed it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔗 GitHub repo: &lt;a href="https://github.com/RDX2OO7/Agentic-Premier-League.git" rel="noopener noreferrer"&gt;https://github.com/RDX2OO7/Agentic-Premier-League.git&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - 🎯 Live demo: &lt;a href="https://agentic-premier-league-lemon.vercel.app/" rel="noopener noreferrer"&gt;https://agentic-premier-league-lemon.vercel.app/&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Built with Google Gemini 2.5 Flash, Google Antigravity, and way too much love for IPL cricket.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
