<?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>Forem: Abhisar Choubey</title>
    <description>The latest articles on Forem by Abhisar Choubey (@sighkickk).</description>
    <link>https://forem.com/sighkickk</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%2F3542710%2F837d7689-46cb-4c45-bdfe-4dad8d9e65aa.png</url>
      <title>Forem: Abhisar Choubey</title>
      <link>https://forem.com/sighkickk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sighkickk"/>
    <language>en</language>
    <item>
      <title>Building a Multi-Agent AI Cricket Simulator in Vanilla JS</title>
      <dc:creator>Abhisar Choubey</dc:creator>
      <pubDate>Sun, 17 May 2026 12:03:12 +0000</pubDate>
      <link>https://forem.com/sighkickk/building-a-multi-agent-ai-cricket-simulator-in-vanilla-js-4dba</link>
      <guid>https://forem.com/sighkickk/building-a-multi-agent-ai-cricket-simulator-in-vanilla-js-4dba</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;"How I built a high-performance Sports HUD simulating cricket strategy using Google Gemini at GDG Cloud Pune Hackathon with mentors &lt;a class="mentioned-user" href="https://dev.to/pratik_kale"&gt;@pratik_kale&lt;/a&gt; &amp;amp; &lt;a class="mentioned-user" href="https://dev.to/antrixsh_gupta"&gt;@antrixsh_gupta&lt;/a&gt; "&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Have you ever wondered how different cricket captains would handle the exact same high-pressure situation? Would MS Dhoni's ice-cool logic prevail, or would Virat Kohli's sheer aggression win the day?&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/VudXVtMESMY"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I decided to find out by building &lt;strong&gt;Captains HUD&lt;/strong&gt;, a multi-agent AI simulator powered by Google Gemini! 🏏🤖&lt;/p&gt;

&lt;h2&gt;
  
  
  The Concept
&lt;/h2&gt;

&lt;p&gt;The idea was to create a "Sports Broadcast HUD" where different AI agents debate cricket strategy in real-time. I wanted an architecture that included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Stats Analyst&lt;/strong&gt;: Evaluates pitch conditions and calculates a "Pressure Index".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Strategist&lt;/strong&gt;: Takes on the persona of a famous captain (Dhoni, Kohli, Rohit, or Gambhir) and makes a tactical call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Devil's Advocate&lt;/strong&gt;: A critical agent that finds the fatal flaw in the Strategist's plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Commentary Desk&lt;/strong&gt;: Dynamic play-by-play commentary from legends like Harsha Bhogle and Ravi Shastri.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;To keep things lightning-fast and visually striking, I avoided heavy frameworks and stuck to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vanilla HTML/CSS/JS&lt;/strong&gt;: For a pure, responsive broadcast HUD.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google GenAI SDK&lt;/strong&gt;: To interact with the Gemini models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canvas Confetti&lt;/strong&gt;: For some explosive visual feedback! 🎉&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The "Mega-Prompt" Optimization
&lt;/h2&gt;

&lt;p&gt;Initially, I had each agent calling the Gemini API sequentially. This created latency and quickly hit Free Tier rate limits. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt; I refactored the backend into a single "Mega-Prompt" using strictly structured JSON schema output. I asked the AI to simulate the &lt;em&gt;entire&lt;/em&gt; debate in one go, returning a JSON object containing the internal monologue, the decision, the challenge, the rebuttal, and the final commentary. &lt;/p&gt;

&lt;p&gt;On the frontend, I simply staggered the rendering of this JSON payload using &lt;code&gt;setTimeout&lt;/code&gt; delays. The result? A single API call that &lt;em&gt;feels&lt;/em&gt; like a live, real-time debate to the user!&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;Building this project taught me that you don't always need complex orchestration frameworks for multi-agent systems. Sometimes, a well-crafted prompt with strict JSON schemas and clever frontend staggering can create a highly immersive AI experience.&lt;/p&gt;

&lt;p&gt;If you're building an AI app, focus on the user's &lt;em&gt;perception&lt;/em&gt; of the AI thinking! Simple CSS animations and delayed rendering can turn static text generation into a thrilling live event.&lt;/p&gt;

&lt;p&gt;Have you built any fun multi-agent systems? Let me know in the comments!&lt;/p&gt;

</description>
      <category>gdgcloudpune</category>
      <category>gdgpune</category>
      <category>buildwithai</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
