Fireside chat on an agentic simulation: Race Condition
By Google for Developers
Key Concepts
- Race Condition: A reference architecture and open-source simulation framework designed to demonstrate large-scale agentic systems.
- Agentic Systems: Software architectures where autonomous agents (powered by LLMs) use tools, instructions, and models to perform tasks.
- A2A (Agent-to-Agent) Protocol: A standard for agents to advertise skills, coordinate work, and communicate.
- Agent Registry: A system that tracks available agents and their capabilities via "Agent Cards."
- Model Context Protocol (MCP): A standard for connecting AI assistants to systems, tools, and data.
- Context Management: Techniques (like sub-agents and history compaction) used to manage token usage and costs in LLM-based systems.
- Deterministic vs. Probabilistic Agents: Using hard-coded logic for high-scale performance (e.g., runners) versus LLM-based logic for complex decision-making.
1. Project Overview: "Race Condition"
"Race Condition" is a reference architecture built for the Google Cloud Next developer keynote. It simulates a marathon in Las Vegas to showcase the Gemini Enterprise Agent platform. The project serves as a real-world demonstration of how to build, scale, and secure agentic systems using Google Cloud infrastructure.
2. Architecture and Design Patterns
The system draws heavily from game development and distributed systems:
- Game Loop Pattern: The server maintains the authoritative state of the simulation, while the client acts as a "dumb" interface that listens for state updates.
- Message Bus: The team utilized Google Cloud Pub/Sub to handle high-volume, low-latency communication between agents and the front end.
- State Management: Google Cloud Memorystore (Redis) was used for high-availability state storage.
- Infrastructure: The system runs on Google Kubernetes Engine (GKE), allowing for dynamic autoscaling of model instances based on demand.
3. Agentic Framework and Methodology
The speakers define an "agent" as a combination of three components:
- Model: An LLM (e.g., Gemini or Gemma) for text/code generation.
- Instructions: Guidelines defining the agent's role and behavior.
- Tools: Integrations that allow the agent to interact with the outside world.
Key Methodology:
- Sub-agents: To manage token costs and complexity, the system breaks tasks into smaller, specialized agents. For example, a "runner" agent only needs local environment data, not the entire marathon plan, keeping the context window small and inexpensive.
- Deterministic Scaling: To achieve the scale of thousands of runners without excessive latency or cost, the team implemented deterministic (non-LLM) runners for basic movement, while using Gemma 4 (open-weights model) for runners requiring more complex, "chaotic" decision-making.
4. Security and Governance
Addressing the risks of autonomous agents (hallucinations, prompt injection), the team implemented a "shared responsibility" security model:
- Agent Identity: Every agent is assigned a unique identity, allowing for granular access control.
- Network-Layer Security: Using the Model Context Protocol (MCP), developers can restrict an agent's access to specific tools or databases at the network level, regardless of the agent's internal instructions.
5. Notable Quotes
- "An agent at its most basic level is comprised of three components: a model, instructions, and tools." — Casey West
- "We wanted to envision what it would look like to build a large-scale architecture and what patterns would emerge when you take something like simulations... and make it agentic." — Casey West
- "The real test is whether or not the runners enjoyed themselves... I think it'd be interesting to continue to expand that to maybe model local businesses." — Tom Greenaway
6. Synthesis and Takeaways
The "Race Condition" project demonstrates that modern enterprise software is evolving toward distributed agentic systems. By combining traditional enterprise patterns (message buses, microservices, Kubernetes) with AI-specific patterns (agent registries, context management, and tool calling), developers can build complex, autonomous simulations.
Main Takeaways for Developers:
- Start with the Architecture: Use established patterns like Pub/Sub for communication and GKE for scaling.
- Optimize for Context: Use sub-agents to keep token windows small and costs manageable.
- Hybridize Logic: Don't use an LLM for every task; use deterministic code for high-frequency, low-intelligence tasks (like movement) and reserve LLMs for high-level decision-making.
- Security First: Always enforce security at the network/identity layer rather than relying solely on the agent's internal "brain."
Chat with this Video
AI-PoweredHi! I can answer questions about this video "Fireside chat on an agentic simulation: Race Condition". What would you like to know?