Leanpub Header

Skip to main content

Hands-On AI Agents with Google ADK

Build, orchestrate, and deploy production-ready multi-agent systems using Python and Google Cloud

This book is 100% completeLast updated on 2026-07-30

Build AI agents that do real work with the Google Agent Development Kit (ADK), Python, and Google Cloud. Through complete, runnable examples, you'll learn how to build, orchestrate, and deploy production-ready multi-agent systems with practical skills you can apply from day one.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
139
Pages
About

About

About the Book

This book takes you from your very first AI agent to production-grade multi-agent systems using the Google Agent Development Kit (ADK). Every chapter is a hands-on walkthrough with complete, runnable Python code. You will learn the core abstractions that power ADK, how to wire tools into agents, manage memory and context, orchestrate multi-agent workflows, stream real-time responses, integrate retrieval-augmented generation, and deploy your agents securely on Google Cloud. No filler, no quizzes, no theory without implementation. Just practical knowledge you can use from day one.

Bundle

Bundles that include this book

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 420 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

Build, orchestrate, and deploy production-ready multi-agent systems using Python and Google Cloud

Introduction

  1. What This Book Covers
  2. Who Should Read This Book
  3. How to Use This Book
  4. What You Will Be Able to Do After Reading

Chapter 1: Understanding AI Agents

  1. What Are AI Agents
  2. The Agent Architecture Pattern
  3. Why Frameworks Matter for Agents
  4. Introducing Google ADK
  5. ADK at a Glance

Chapter 2: Getting Started with Google ADK

  1. Prerequisites and Environment Setup
  2. Installing ADK and Dependencies
  3. Getting a Google API Key
  4. Your First Agent
  5. Adding a Tool
  6. Running Agents Locally
  7. Project Structure and Organization
  8. Common Pitfalls in Setup

Chapter 3: Core ADK Concepts

  1. The Agent Class
  2. The Runner
  3. Sessions and Session Services
  4. State Management
  5. Events and the Event Loop

Chapter 4: Building with Tools

  1. What Are Tools and How Agents Use Them
  2. Function Tools
  3. Tool Context
  4. Built-in Tools
  5. Custom Tool Design Patterns
  6. Toolsets: Grouping and Dynamic Provisioning
  7. Common Pitfalls with Tools

Chapter 5: Memory and Context Management

  1. Short-Term vs Long-Term Memory
  2. Memory Services
  3. Using Memory in Agents
  4. Context Caching
  5. Context Compression and Compaction
  6. Artifacts
  7. Common Pitfalls with Memory and Context

Chapter 6: Prompt Engineering for Agents

  1. The Instruction Field
  2. Referencing Tools in Instructions
  3. Handling Tool Return Values
  4. Multi-Turn Conversation Design
  5. Model Selection and Configuration
  6. Common Pitfalls with Instructions

Chapter 7: Workflows and Orchestration

  1. Template Workflows
  2. Agent Routing
  3. Graph-Based Workflows (ADK 2.0)
  4. Human-in-the-Loop Patterns
  5. Dynamic Workflows
  6. Common Pitfalls with Workflows

Chapter 8: Multi-Agent Systems

  1. Agent Team Architecture
  2. Agents as Tools
  3. Collaborative Workflows with Shared State
  4. A2A Protocol (Agent-to-Agent)
  5. Real-World Multi-Agent Patterns
  6. Common Pitfalls with Multi-Agent Systems

Chapter 9: Streaming and Asynchronous Execution

  1. Understanding Events
  2. Streaming Responses
  3. The Event Loop Deep Dive
  4. Gemini Live API Toolkit
  5. Streaming Tools
  6. Common Pitfalls with Streaming

Chapter 10: Retrieval-Augmented Generation (RAG)

  1. RAG Fundamentals for Agents
  2. Vertex AI Search Integration
  3. Building a RAG Tool from Scratch
  4. Agentic RAG Patterns
  5. Common Pitfalls with RAG

Chapter 11: MCP and External API Integration

  1. Model Context Protocol (MCP) Overview
  2. Connecting to Existing MCP Servers
  3. Building an MCP Server with ADK
  4. OpenAPI Tools
  5. Authentication for External APIs
  6. Common Pitfalls with External Integration

Chapter 12: Structured Outputs and Validation

  1. Output Schemas with Pydantic
  2. The output_key Parameter
  3. Validating LLM Outputs
  4. JSON Mode and Structured Function Returns
  5. Error Handling Patterns for Structured Data
  6. Common Pitfalls with Structured Outputs

Chapter 13: Callbacks and Plugins

  1. Callback Types
  2. Callback Patterns
  3. Plugin Architecture
  4. Callbacks vs Plugins: When to Use Each
  5. Common Pitfalls with Callbacks and Plugins

Chapter 14: Testing and Evaluation

  1. Unit Testing Agent Components
  2. Integration Testing with Runners
  3. Golden Datasets and Evaluation Frameworks
  4. Custom Evaluation Metrics
  5. User Simulation Testing
  6. Common Pitfalls with Testing

Chapter 15: Observability and Debugging

  1. Built-in Logging
  2. Distributed Tracing with OpenTelemetry
  3. Metrics Collection
  4. Third-Party Observability Platforms
  5. Debugging Common Issues
  6. Common Pitfalls with Observability

Chapter 16: Deployment

  1. Deployment Options Compared
  2. Deploying to Cloud Run
  3. Deploying to GKE
  4. Agent Runtime on Google Cloud
  5. Environment Configuration
  6. Common Pitfalls with Deployment

Chapter 17: Security and Safety

  1. Content Safety Filters
  2. Guardrails with Callbacks
  3. Authentication Patterns
  4. Prompt Injection Defense
  5. Common Pitfalls with Security

Chapter 18: Production Best Practices

  1. Performance Optimization
  2. Cost Management
  3. Error Handling and Resilience
  4. Scaling Patterns
  5. Monitoring and Alerting in Production
  6. Migration from 1.x to 2.0
  7. Common Pitfalls in Production

Conclusion

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub