Coding with ADK to beat a text adventure game

By Google Cloud Tech

Share:

Key Concepts

  • ADK (Agent Development Kit): A framework for building, testing, and deploying AI agents.
  • Gemini: Google’s large language model (LLM) used as the "brain" for the agents.
  • Vertex AI (Enterprise Agent Platform): The Google Cloud infrastructure used to host and manage AI agents.
  • Agentic AI: Systems that use LLMs to perform tasks, make decisions, and interact with external tools autonomously.
  • OpenAPI Specification: A standard format used by ADK to allow agents to understand and interact with external APIs.
  • Cloud Shell: A browser-based, pre-configured development environment provided by Google Cloud.
  • UV: A high-performance Python package manager written in Rust.

1. Main Topics and Key Points

The video demonstrates how to build an AI agent to play a text-based adventure game called "Garden of Forgotten Props." The goal is to teach developers how to use the Agent Development Kit (ADK) to create autonomous agents that can interact with APIs.

  • The Game: Inspired by 1990s classics like Zork, the game requires players to navigate rooms, manage an inventory, and solve puzzles.
  • The Agent: An agent is defined as a piece of code that connects an LLM (Gemini) with specific tools (APIs) to perform tasks.
  • Development Workflow:
    1. Initialize a project using UV.
    2. Install google-adk.
    3. Use adk create to generate boilerplate code.
    4. Configure the agent with a model (Gemini 2.5 Flash) and authentication credentials.
    5. Integrate an OpenAPI spec so the agent understands how to play the game.

2. Real-World Applications

  • Automation: Beyond games, agents are used for automating administrative tasks like travel booking (flights/hotels), expense reporting, and social media management.
  • Coding Assistance: Agents can be used to write, debug, and manage codebases.
  • Multi-Agent Systems: The ADK allows for "swarms" of agents, where multiple specialized agents work together to solve complex problems.

3. Step-by-Step Methodology

  1. Setup: Use Google Cloud Shell for a pre-configured environment.
  2. Initialization: Run uv init and uv add google-adk.
  3. Agent Creation: Run adk create [name] and select the model (Gemini) and access method (Vertex AI or AI Studio).
  4. Tool Integration: Feed the game’s OpenAPI specification into the agent so it can interpret game commands (e.g., look, take, move).
  5. Debugging: Use adk web to launch a local UI for testing, monitoring tool invocations, and debugging agent logic.
  6. Deployment: Use adk deploy to push the agent to Google Cloud Run or the Enterprise Agent Platform.

4. Key Arguments and Perspectives

  • Curiosity-Driven Development: The presenters argue that building "fun" projects like games is the best way to learn complex technical frameworks.
  • Model Agnosticism: While ADK is optimized for Gemini, it is designed to be model-agnostic, allowing developers to swap in other LLMs.
  • Human-in-the-loop: For critical tasks (like travel booking), the presenters emphasize that agents should act as assistants that propose actions for human approval rather than acting entirely without oversight.

5. Notable Quotes

  • "An agent is essentially a piece of code that talks to a large language model... it's tools that allow the agent to be more clever or more intelligent or more autonomous." — Abdal
  • "Authentication is the hardest problem in computer science." — Tilda
  • "Do not just wait to find an opportunity to do something. Just pick any random idea that you have... and just build an agent for it." — Abdal

6. Logical Connections

The presentation moves from manual gameplay (to understand the game's logic) to automated gameplay (to demonstrate the agent's capability). It highlights that the agent uses the same API endpoints as a human player, but with the added intelligence of an LLM to decide which commands to execute based on the game's state.

7. Data and Research Findings

  • Scoring System: The game includes a 5% bonus for using ADK/Google Cloud tools and a "Treasure Hunter" bonus that rewards agents for exploring more of the game world rather than just finding the shortest path.
  • Performance: The agent demonstrated the ability to parse game states and execute sequences of commands (e.g., use spark lighter on lit flare) significantly faster than a human.

8. Synthesis/Conclusion

The session successfully demonstrated that building AI agents is accessible through the Agent Development Kit. By combining LLMs with OpenAPI-defined tools, developers can create agents capable of complex, multi-step reasoning. The main takeaway is to avoid "analysis paralysis"—start by building small, experimental projects to gain proficiency with agentic workflows before moving to production-grade automation.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video