DEV Community

siddhi bhosale
siddhi bhosale

Posted on • Originally published at dev.to

🏏 Captain Cool β€” Orchestrating a Google Gemini Multi-Agent Debate Loop for Live IPL Strategy

During a high-stakes IPL match, a captain relies on a dugout brain trust: a data analyst pulling matchups, a defensive strategist drawing up lines, and a cynical advisor pointing out how the plan could blow up.

To replicate this, I built Captain Coolβ€”an agentic, multi-agent AI system engineered on the modern Google Gemini stack. It simulates real-time strategic debates to make the final, definitive match call.

πŸ”— Project Resources

GitHub Repository: `https://github.com/siddhi070306/APL.git

`

πŸ—οΈ Architecture Design & Multi-Agent Topology

The application implements a strictly decoupled multi-agent topology using separate client instances, individual system instructions, and specialized runtime configurations via an asynchronous Analyze βž” Propose βž” Challenge βž” Settle pattern managed by a Node.js gateway.

       [ User Inputs / Live Cricbuzz URL ] 
                        β”‚
                        β–Ό
           [ Express POST /api/strategy ]
                        β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                             β–Ό
1. Stats Guru (Analyst)       2. Captain Cool (Turn 1)
   └── Tool: scraperTool         └── Generates Initial Proposal
         β”‚                             β”‚
         β–Ό                             β–Ό
   [ Extracted HTML/Fallback ]   3. Devil's Advocate (Critic)
         β”‚                             └── Sharp Tactical Dissent
         β”‚                             β”‚
         β–Ό                             β–Ό
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β–Ό
              4. Captain Cool (Turn 2)
                 └── Synthesizes Debate & Executes Final Command

Enter fullscreen mode Exit fullscreen mode

End-to-End Simulation Walkthrough

The Match Situation:
Venue: M. Chinnaswamy Stadium, Bengaluru (Short 55m leg-side boundary).

Situation: Chasing team needs 13 runs off 5 balls. A destructive left-handed finisher is on strike. Flat pitch, heavy evening dew.

Dugout Dilemma: Trust the primary right-arm fast yorker specialist cracking under pressure, or bring on the mystery off-spinner?

The Agentic Output Stream:

πŸ”Ή 1. Stats Guru Breakdown: "Strike batter hits right-arm pace at a strike-rate of 188.5, but struggles against turning balls sliding into the body (avg 14.2). However, spin economy rates spike by 24% at this venue once dew sets in."

πŸ”Έ 2. Captain's Initial Proposal: "We are pulling the pace bowler out of the firing line. I am bringing on the mystery spinner to choke the angles and drag the length back."

πŸ”» 3. Devil's Advocate Critique: "Bringing on a spinner with a wet ball at Chinnaswamy is absolute suicide! The dew means zero gripβ€”that ball is going to turn into a slippery full-toss. With a tiny 55m boundary on the leg side, he will clear the stadium roof."

🟩 4. Final Tactical Directive (Captain Cool's Command): "The advisor's warning about the wet ball grip is valid. We adjust. We stick with the fast bowler, but change the line completely. We are bringing in the Impact Player to pack the off-side field. Bowler will deliver wide, cross-seam deliveries outside off-stump, out of the batter's swinging arc, completely removing the short leg-side boundary from play."

Conclusion

By separating concerns into distinct, cooperating Gemini agents, Captain Cool surfaces hidden environmental risks (like dew factoring into wet-ball dynamics) through collaborative filtering. Building this project inside Google Antigravity demonstrated how seamlessly complex multi-agent reasoning structures translate to lightweight Node.js/React codebases.

Top comments (0)