Build, orchestrate, and deploy production-ready multi-agent systems using Python and Google Cloud
Introduction
- What This Book Covers
- Who Should Read This Book
- How to Use This Book
- What You Will Be Able to Do After Reading
Chapter 1: Understanding AI Agents
- What Are AI Agents
- The Agent Architecture Pattern
- Why Frameworks Matter for Agents
- Introducing Google ADK
- ADK at a Glance
Chapter 2: Getting Started with Google ADK
- Prerequisites and Environment Setup
- Installing ADK and Dependencies
- Getting a Google API Key
- Your First Agent
- Adding a Tool
- Running Agents Locally
- Project Structure and Organization
- Common Pitfalls in Setup
Chapter 3: Core ADK Concepts
- The Agent Class
- The Runner
- Sessions and Session Services
- State Management
- Events and the Event Loop
Chapter 4: Building with Tools
- What Are Tools and How Agents Use Them
- Function Tools
- Tool Context
- Built-in Tools
- Custom Tool Design Patterns
- Toolsets: Grouping and Dynamic Provisioning
- Common Pitfalls with Tools
Chapter 5: Memory and Context Management
- Short-Term vs Long-Term Memory
- Memory Services
- Using Memory in Agents
- Context Caching
- Context Compression and Compaction
- Artifacts
- Common Pitfalls with Memory and Context
Chapter 6: Prompt Engineering for Agents
- The Instruction Field
- Referencing Tools in Instructions
- Handling Tool Return Values
- Multi-Turn Conversation Design
- Model Selection and Configuration
- Common Pitfalls with Instructions
Chapter 7: Workflows and Orchestration
- Template Workflows
- Agent Routing
- Graph-Based Workflows (ADK 2.0)
- Human-in-the-Loop Patterns
- Dynamic Workflows
- Common Pitfalls with Workflows
Chapter 8: Multi-Agent Systems
- Agent Team Architecture
- Agents as Tools
- Collaborative Workflows with Shared State
- A2A Protocol (Agent-to-Agent)
- Real-World Multi-Agent Patterns
- Common Pitfalls with Multi-Agent Systems
Chapter 9: Streaming and Asynchronous Execution
- Understanding Events
- Streaming Responses
- The Event Loop Deep Dive
- Gemini Live API Toolkit
- Streaming Tools
- Common Pitfalls with Streaming
Chapter 10: Retrieval-Augmented Generation (RAG)
- RAG Fundamentals for Agents
- Vertex AI Search Integration
- Building a RAG Tool from Scratch
- Agentic RAG Patterns
- Common Pitfalls with RAG
Chapter 11: MCP and External API Integration
- Model Context Protocol (MCP) Overview
- Connecting to Existing MCP Servers
- Building an MCP Server with ADK
- OpenAPI Tools
- Authentication for External APIs
- Common Pitfalls with External Integration
Chapter 12: Structured Outputs and Validation
- Output Schemas with Pydantic
- The output_key Parameter
- Validating LLM Outputs
- JSON Mode and Structured Function Returns
- Error Handling Patterns for Structured Data
- Common Pitfalls with Structured Outputs
Chapter 13: Callbacks and Plugins
- Callback Types
- Callback Patterns
- Plugin Architecture
- Callbacks vs Plugins: When to Use Each
- Common Pitfalls with Callbacks and Plugins
Chapter 14: Testing and Evaluation
- Unit Testing Agent Components
- Integration Testing with Runners
- Golden Datasets and Evaluation Frameworks
- Custom Evaluation Metrics
- User Simulation Testing
- Common Pitfalls with Testing
Chapter 15: Observability and Debugging
- Built-in Logging
- Distributed Tracing with OpenTelemetry
- Metrics Collection
- Third-Party Observability Platforms
- Debugging Common Issues
- Common Pitfalls with Observability
Chapter 16: Deployment
- Deployment Options Compared
- Deploying to Cloud Run
- Deploying to GKE
- Agent Runtime on Google Cloud
- Environment Configuration
- Common Pitfalls with Deployment
Chapter 17: Security and Safety
- Content Safety Filters
- Guardrails with Callbacks
- Authentication Patterns
- Prompt Injection Defense
- Common Pitfalls with Security
Chapter 18: Production Best Practices
- Performance Optimization
- Cost Management
- Error Handling and Resilience
- Scaling Patterns
- Monitoring and Alerting in Production
- Migration from 1.x to 2.0
- Common Pitfalls in Production