惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
罗磊的独立博客
S
SegmentFault 最新的问题
V
V2EX
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
D
Docker
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
M
Microsoft Research Blog - Microsoft Research
Martin Fowler
Martin Fowler
S
Secure Thoughts
B
Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
T
True Tiger Recordings
GbyAI
GbyAI
P
Proofpoint News Feed
P
Privacy International News Feed
Jina AI
Jina AI
The Cloudflare Blog
I
Intezer
AWS News Blog
AWS News Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security Archives - TechRepublic
NISL@THU
NISL@THU
The Register - Security
The Register - Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Palo Alto Networks Blog
S
Schneier on Security
L
LINUX DO - 热门话题
C
CXSECURITY Database RSS Feed - CXSecurity.com
Security Latest
Security Latest
C
Cybersecurity and Infrastructure Security Agency CISA

DEV Community

Unity’s AI agent went public: the developers of a static analysis tool on what that means for code quality Anna's Archive publica un llms.txt para los LLMs que rastrean su catálogo Why I Built Mneme HQ: Preventing AI Agent Architectural Drift I Built a Pay-Per-Call Crypto Signal API with x402 — Heres the Architecture 🚀 “From Prompts to Autonomous Agents: What Google I/O 2026 Changed” The Power of Distributed Consensus in Autonomous SOCs Sixteen TUI components, copy-paste, no dependency The Boring Reliability Layer Every Autonomous Agent Needs Nven - Secret manager Building Multi-Tenant Row-Level Security in PostgreSQL: A Production Pattern The Hardest Part of Being a Developer Isn't Coding Building Vylo — Looking for Collaborators, Partners & Early Support I Thought Memory Fades With Time. It Actually Fades With Information. ORA-00064 오류 원인과 해결 방법 완벽 가이드 I registered an AI agent at 1 AM and something cracked open in my head Pitch: Nven - Sync secrets. Ship faster. Why y=mx+b is the heart of AI From Routines to a Crew — Building a System That Plans Its Own Work & executes it 25 React Interview Questions 2026 (With Answers) — Hooks, React 19, Concurrent Mode An open source LLM eval tool with two independent quality signals Using Dashboard Filtering to Get Customer Usage in Seconds from TBs of Data Skills, Java 17, And Theme Accents 4 Hard Lessons on Optimizing AI Coding Agents Arctype: Cross-Platform Database GUI for LLM Artifacts Your robots.txt says GPTBot is welcome. Your server says 403. Organizing How to Use AWS Glue Workflow 5 n8n Automations Every Digital Agency Should Be Running (Bill More, Work Less) Getting Started with TorchGeo — Remote Sensing with PyTorch Designing a Scalable Cross-Platform Appium Framework Google Antigravity 2.0 & Slash Commands Building a Unified Adaptive Learning Intelligence with Gemma 4, Flutter, and Multi-Model Orchestration Looking for beta testers for a £60 server management application The Disk-Pressure Incident That Taught Me to Always Set LimitRanges and Other Lessons from Mirroring EKS Locally. Why AI Should Not Write SQL Against ERP Databases Vibe coding works until it doesn't. The debt is real. Shipping at the Edge: Migrating a Coffee Subscription Platform to Cloudflare Workers Stop Tab-Switching: A Developer's Guide to Color Tools That Actually Fit the Workflow DevOps vs MLOps vs AIOps: What Changes, What Stays, and a Simple Roadmap to Get Started Run Powerful AI Coding Locally on a Normal Laptop 5 n8n Automations Every WooCommerce Store Needs (Save 10+ Hours/Week) What I Learned Building My Own AI Harness Hytale Servers Will Fail Treasure Hunts Until We Fix Our Event Handling Redux in React: Managing Global State Like a Pro Unfreezing Your GitHub Actions: Troubleshooting Stuck Deployments and Protecting Your Git Repo Statistics Unlocking Project Discoverability on GHES: A Key to Software Engineering Productivity When the Cleanup Code Becomes the Project Rockpack 8.0 - A React Scaffolder Built for the Age of AI-Assisted Development Mismanaging the Treasure Hunt Engine in Hytale Servers Will Get You Killed Stop Calling It an AI Assistant. It’s Already Managing Your Company Why Hardcoded Automations Fail AI Agents Why I built a post-quantum signing API (and why JWT is on borrowed time) Weekend Thought: Frontend Build Tools Suffer From Work Amnesia A 10-Line Playwright Trick That Saved Me Hours on Every Sephora Run AI Is Changing Engineering Culture More Than We Realize Everyone Was Focused on Gemini, But Infinite Scaler Was the Real Twister "Gemma 4 Analyzed My Bank Statements – Apparently I 'Have a Problem' with Coffee and Late-Night Apps" #css #webdev #beginners #codenewbie The Hidden Layer Every AI Developer Must Learn AlphaEvolve: Google DeepMind's Gemini-Powered Evolutionary Coding Agent RDS Reserved Instance Pricing: Every Engine, Every Rule, Real Dollar Savings How To Build An AI-Powered MVP Without Burning Your Startup Budget In 2026 Reading a Psychrometric Chart Without Getting Lost LMR-BENCH: Can LLM Agents Reproduce NLP Research Code? (EMNLP 2025) How to turn text into colors (without AI) Building Real-Time Apps in Node.js with Rivalis: WebSockets, Rooms, Actors, and a Binary Wire This Week In React #282 : Security, Fate, TanStack, Redux, Jotai | Hermes-node, Expo, Rozenite, Harness | TC39, Bun, pnpm, npm, Yarn, Node AI Copilot vs AI Agent Architecture - What's Actually Different (And Why It Matters) Smart Contract Security: NEAR's Futures Surge and AI Token Risks Database Maintenance: Tracing Production Incidents to Their Root Cause Stop juggling AI SDKs in PHP — meet Prisma Google Quietly Changed What “Apps” Mean at I/O 2026 The Infrastructure Team Is the Real Single Point of Failure Building SQLite from Scratch: 740 Lines of C++23 to Understand Every Byte of a .db File The 4 Levels of Hermes Agent Scaling Framework: From One Hermes Agent to a Fully Automated Team Your AI Has a Memory. It Just Doesn’t Know What to Remember. Claprec: Engineering Tradeoffs - Limited time vs. Perfection (6/6) Building a Daily Google News API Monitor in Python Building RookDuel Avikal: From Chess Steganography to Post-Quantum Archival Security Google I/O e IA: o que realmente muda na vida do dev? Color Contrast Failures: The Number One Accessibility Issue and How to Fix It # I Watched 15 Hours of Hermes Agent Videos So You Don't Have To Cómo solucionar el bucle infinito en useEffect con objetos y arrays en React The First Agent-Centric Cloud Security Platform — And Why We Didn't Build It That Way On Purpose Most Treasure Hunts Engines on Hytale Servers Are Built to Fail - Lessons from a Burned Database GhostScan v3.0 — From Closed-Source EXE to Open-Source Pentest Framework De hojas de cálculo a IA: construyendo una plataforma SRM moderna When is AI fine in education? Python Tools for Managing API Rate Limits in Data Pipelines How to Implement Exponential Backoff for Rate-Limited APIs in Python "My Web Chat Wasn't a Real Channel. That Broke My Agent Pipeline" next-advanced-sitemap v1.0.7 — safer URL ingestion & automatic trimming for Next.js sitemap generation I keep seeing people build an AI lead processing agent when they really need a 6-step rules engine AI Powered Student Learning Assistant Using Gemma 4 How I Built a Drop-In Proxy to Slash My OpenAI Bills by 20%+ Automatically Building a Sarcastic AI English Tutor with Persona-as-Code and Gemini Audio Input for Pronunciation Correction Five Years Later, I Finally Have 96GB VRAM — What It Actually Unlocks for Agent Loops Turning a 1-Line Idea Into a 40-Second Short with a 10-Beat Local Video Pipeline Running LTX-2.3 Alongside TTS on a Single 96GB GPU with a Cold-Start Architecture Cutting LTX-2 22B Peak VRAM by 40% with fp8_cast — and Why optimum-quanto Was a Trap HiDream Skeleton Mode: Prompt Beats OpenPose Ref — 8 Patterns Benchmarked
Captain Cool: I Built a Multi-Agent IPL Strategist with Google Gemini 2.5 Flash and ADK
Arnav Mahesh · 2026-05-17 · via DEV Community

The Idea
What if an AI could think like MS Dhoni in the 18th over of a chase?
That was the question behind Captain Cool — a multi-agent AI system that acts as a virtual IPL captain, making real tactical decisions the way Dhoni, Rohit, or Hardik would. You give it the match state. It gives you the next decision, the reasoning, and the internal debate that led there.
This was built for the Google Gemini Hackathon in a single session using Google Antigravity, Gemini 2.5 Flash, and the Agent Development Kit (ADK).
🔗 Live Demo: https://captain-cool-ruddy.vercel.app/
🔗 GitHub: https://github.com/CodeCatalyst-07/captain_cool

The Problem
IPL captaincy is one of the most high-stakes real-time decision problems in sports. Every over, a captain must answer:

Who bowls next — and against which batter?
Should I use my Impact Player now or save them?
Is dew going to affect my death-over plan?
Do I attack or protect wickets here?

Current AI cricket tools give you stats. None of them reason like a captain. I wanted to build something that does.

Architecture Overview
Captain Cool is a 4-agent system built on Google ADK. Each agent has a distinct role, its own system prompt, and runs as a separate LlmAgent instance powered by Gemini 2.5 Flash.
USER INPUT (Match State)

┌─────────────────────┐
│ STATS ANALYST │ → Fetches live data, weather, builds tactical picture
└─────────────────────┘

┌─────────────────────┐
│ STRATEGIST │ → Proposes next decision in captain-speak
└─────────────────────┘

┌─────────────────────┐
│ DEVIL'S ADVOCATE │ → Raises 2 hard objections using cricket analytics
└─────────────────────┘

┌─────────────────────┐
│ STRATEGIST │ → Defends or revises based on challenge
└─────────────────────┘

┌─────────────────────┐
│ COMMENTATOR │ → Narrates final decision like Harsha + Shastri
└─────────────────────┘

FINAL DECISION + WIN PROBABILITY BEFORE vs AFTER
This is a genuine multi-turn debate loop — not a single prompt wearing four hats. Each agent runs independently with its own session, its own system prompt, and passes context forward to the next round.

The Four Agents

  1. Stats Analyst 📊 Role: Data gatherer and tactical picture builder This agent is equipped with two function-calling tools:

get_live_cricket_state() — calls CricketData.org API for live match data
get_pitch_weather() — calls OpenWeatherMap for dew risk and humidity at the venue

It outputs a structured JSON summary covering phase context (powerplay/middle/death), key matchups, bowler overs remaining, weather conditions, and a batting depth rating from 0 to 1.
System prompt excerpt:

"You are a cricket data analyst. Your job is to fetch live match data and build a precise tactical picture. Always output valid JSON with keys: phase, key_matchups, bowlers_remaining, batting_depth_rating, weather_summary, run_rate_context."

  1. Strategist 🏏 Role: The captain — proposes the next tactical decision This is the core decision-making agent. It has the instinct of Dhoni, Rohit, and Hardik combined. It receives the Stats Analyst's output and proposes a concrete plan covering the next bowler, field setup, Impact Player usage, and batting approach. It uses compute_win_probability() as a tool to ground its decisions in real numbers. Output format is always: DECISION / RATIONALE / FIELD SETUP / CONTINGENCY System prompt excerpt:

"You are an IPL T20 captain with the combined instinct of MS Dhoni, Rohit Sharma, and Hardik Pandya. Propose the next tactical decision. Use cricket language only — no data science jargon. Structure your output as DECISION, RATIONALE, FIELD SETUP, CONTINGENCY."

  1. Devil's Advocate 😈 Role: The critic — challenges every proposal This agent receives the Strategist's proposal and must raise exactly 2 specific objections using phase analytics, matchup data, dew conditions, or boundary dimension logic. It must either force a revision or accept the defense with a clear verdict: VERDICT: REVISION REQUIRED or VERDICT: ACCEPTED. System prompt excerpt:

"You are a ruthless IPL data analyst. Your job is to challenge every strategy. Raise exactly 2 objections using phase-based analytics, matchup data, dew conditions, or bowling economy. End with VERDICT: REVISION REQUIRED or VERDICT: ACCEPTED."

  1. Commentator 🎙️ Role: Narrates the final decision This agent takes the entire debate transcript and writes one punchy paragraph of cricket commentary in the voice of Harsha Bhogle and Ravi Shastri combined. Zero data science language. Pure cricket emotion. System prompt excerpt:

"You are Harsha Bhogle and Ravi Shastri combined. Read the full debate transcript and narrate the final decision in one paragraph. Be emotional, technical, and vivid. Never use ML or data science language."

The Tools
Three Gemini function-calling tools power the system:

  1. get_live_cricket_state(match_id) Calls CricketData.org free API. Returns current score, overs, batsmen, bowler, and phase context.
  2. get_pitch_weather(venue) Calls OpenWeatherMap free API. Extracts city from venue string automatically ("Wankhede Stadium Mumbai" → "Mumbai"). Returns temperature, humidity, and dew risk (high/medium/low).
  3. compute_win_probability(target, runs, wickets, overs, dew_risk, batting_depth_rating) Pure local calculation. Base 0.5 with adjustments for required run rate brackets, wickets in hand, dew factor (+0.05 if high), and batting depth. Returns win probability as a float clamped between 0.0 and 1.0.

The Debate Loop
This is the heart of the system. Here's the actual flow in orchestrator.py:
python# Round 1: Stats Analyst builds the picture
stats_summary = await _run_agent_turn(stats_analyst_agent, match_state_prompt)

Round 2: Strategist proposes a decision

initial_proposal = await _run_agent_turn(strategist_agent, stats_summary)

Round 3: Devil's Advocate challenges it

devils_challenge = await _run_agent_turn(devils_advocate_agent, initial_proposal)

Round 4: Strategist defends or revises

final_decision = await _run_agent_turn(strategist_agent,
f"Prior proposal: {initial_proposal}\nChallenge: {devils_challenge}\nNow defend or revise.")

Round 5: Commentator narrates

commentary = await _run_agent_turn(commentator_agent,
f"Full debate: {initial_proposal}\n{devils_challenge}\n{final_decision}")
Each agent gets its own session_id with a UUID suffix for concurrency safety. Context is threaded as a cumulative transcript — no shared session state needed.

A Real Match Scenario
Input:

Innings: 2, Over: 14, Score: 134/4
MI batting, CSK bowling
Bumrah: 2 overs remaining, Chahar: 3 overs remaining
Venue: Wankhede Stadium Mumbai
Target: 185, Dew Factor: ON

Stats Analyst output:
json{
"phase": "death",
"bowlers_remaining": {"Bumrah": 2, "Chahar": 3},
"batting_depth_rating": 0.7,
"weather_summary": "haze with medium dew risk",
}
Strategist's initial proposal:

"Bring Bumrah on immediately. With a batting depth rating of 0.7 and 36 balls left, this is the moment to strike. His yorker is the only answer on a dewy Wankhede surface."

Devil's Advocate:

"OBJECTION 1: Medium dew risk means the ball is already skidding — Bumrah's straight yorker becomes a half-volley. Wide yorkers are safer.
OBJECTION 2: Burning both Bumrah overs now leaves overs 18 and 20 uncovered if this partnership holds."

Strategist's final decision:

"DECISION: Bring Bumrah on but instruct wide yorkers and back-of-length cutters only — no straight full tosses.
RATIONALE: The DevilsAdvocate is right about dew. Adjust the length, not the bowler.
FIELD SETUP: Two slips, a gully, deep square leg, fine leg, deep cover.
CONTINGENCY: If no wicket in this over, hold Bumrah's second spell for over 19."

Commentary:

"And there it is — Dhoni's ghost walking the boundary! The skipper backs his gun, but with a tactical tweak that only a true student of the game would make. No straight yorkers tonight, Harsha — the dew has stolen that weapon. But Bumrah with wide yorkers and cutters? That's still a nightmare for any batter alive!"

Win Probability: 62% → 66% (+4% strategy impact)

Tech Stack
LayerTechnologyAI ModelsGoogle Gemini 2.5 FlashAgent FrameworkGoogle ADK (Agent Development Kit)Function Callinggoogle-genai SDKBackendFastAPI + UvicornFrontendReact 18 + Vite + Tailwind CSSCricket DataCricketData.org (free tier)WeatherOpenWeatherMap (free tier)Frontend DeployVercelBackend DeployRender.com

Project Structure
captain-cool/
├── captain_cool/
│ ├── config/settings.py # API keys + constants
│ ├── tools/
│ │ ├── cricket_api.py # Live cricket data tool
│ │ ├── weather_tool.py # Dew/weather tool
│ │ └── win_probability.py # Win probability calculator
│ ├── agents/
│ │ ├── stats_analyst.py # Agent 1
│ │ ├── strategist.py # Agent 2
│ │ ├── devils_advocate.py # Agent 3
│ │ └── commentator.py # Agent 4
│ ├── orchestrator.py # Debate loop
│ └── api/server.py # FastAPI backend
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ │ ├── LandingPage.jsx # Hero + agents showcase
│ │ │ ├── AnalyzePage.jsx # Form + results
│ │ │ └── HowItWorksPage.jsx # Architecture diagram
│ │ └── components/
│ │ ├── MatchForm.jsx
│ │ ├── ResultCards.jsx
│ │ ├── WinProbBar.jsx
│ │ └── LoadingSpinner.jsx
└── tests/
├── test_tools.py # 25 tests
└── test_agents.py # 13 tests

What I Learned

  1. Multi-agent debate is genuinely better than single-agent prompting. The Devil's Advocate consistently caught things the Strategist missed — especially dew factor implications and bowling resource management. The final decisions were measurably more nuanced after the challenge round.
  2. ADK's session isolation matters. Giving each agent its own session_id with a UUID suffix prevented context bleed between rounds. Without this, the Commentator would sometimes "remember" the Strategist's early proposals and contradict the final decision.
  3. Free APIs are enough for a hackathon. CricketData.org's free tier (100 calls/day) and OpenWeatherMap's free tier (1000 calls/day) were more than sufficient for the demo. The agents handle API failures gracefully and still produce quality output from the manually entered match state.
  4. Gemini 2.5 Flash understands cricket. I didn't need to explain IPL rules, Impact Player mechanics, or death-over conventions in detail. The model had strong prior knowledge of T20 cricket strategy that made the system prompts much shorter than expected.

What's Next

Real-time mode: Paste a Cricbuzz URL and the system scrapes live state automatically using Gemini's URL context tool
Voice mode: Web Speech API input + Gemini Live API output so the captain literally talks back
Memory across overs: Gemini context caching for multi-over strategic continuity
Confidence scores: "If you'd bowled X instead, win probability drops 8%"