DEV Community

Atharva Kulkarni
Atharva Kulkarni

Posted on

Captain Talks — Building an Agentic AI for IPL with Google Gemini

What if AI could captain your IPL team? Captain Talks does exactly that — a browser-based agentic AI system built with Google Gemini that makes real-time tactical decisions, ball by ball.

What It Does

Tactical Decisions — Bowling changes, field placements, batting order, timeouts, and Impact Player calls — all reasoned and executed by the AI
Ball-by-Ball Simulation — Every delivery simulated with commentary and the captain's live thinking
Match Chat — Chat with the AI captain to challenge decisions or explore strategies
Live Scores — Optional integration with CricketData.org API for real match data.

Key Features
Tactical AI Decisions — The AI makes real captaincy calls: bowling changes, field placements, batting order shuffles, strategic timeouts, and Impact Player substitutions. Each decision comes with the captain's tactical reasoning.

Ball-by-Ball Simulation — Every delivery is simulated with live commentary, outcomes (dot, boundary, wicket), and a window into the captain's thinking after each ball.

Strategy Log — A running log tracks every decision and delivery, giving you a full tactical match record you can review and learn from.
Match Chat — A conversational layer lets you discuss strategy with the AI — ask about matchups, challenge a decision, or explore "what if" scenarios mid-match.
Live Match Data — The app can auto-fetch real IPL scores via the CricketData.org API, grounding the AI's decisions in live match context.
Quick Presets — Pre-loaded scenarios like a death-over chase or a powerplay collapse let you jump straight into high-pressure situations without setting up a full match.
Supabase Integration — Optionally connect a Supabase database to persist match sessions and chat history across browser sessions.

Why It Matters:
This project is a hands-on example of agentic AI in action — an AI that doesn't just respond, but reasons, decides, and acts across multiple steps. No backend needed. Runs entirely in the browser. All API keys stay local in your browser's localStorage.

Tech Stack
The project is intentionally lean and accessible:

Frontend: Vanilla HTML, CSS, and JavaScript — no framework overhead, runs in any browser
AI Engine: Google Gemini API via @google/genai
Live Data: CricketData.org API (free tier: 20 requests/day)
Database: Supabase (PostgreSQL) — completely optional

The entire AI reasoning loop runs client-side. No backend server required.

Top comments (0)