This repository contains a comprehensive tutorial for the Google Agent Development Kit (ADK) for Python, a framework for building and running AI Agents. The tutorial is structured as a series of chapters that guide you through the core concepts and components of the ADK.
The adk-python
project provides a framework for building and running Agents.
Think of an Agent as a specialized assistant that can perform tasks,
optionally using a Large Language Model (LLM) to reason and decide actions.
A Runner executes these Agents, managing the conversation Session and user
interaction. Agents can use Tools (like calculators, search engines, or even
other Agents) to gain new capabilities.
flowchart TD
A0["Agent"]
A1["Runner"]
A2["Session"]
A3["Tool"]
A4["Invocation Context"]
A5["LLM Interaction"]
A6["Event"]
A7["LLM Flow"]
A8["Artifact Service"]
A9["Authentication"]
A10["Code Executor"]
A11["Evaluation"]
A1 -- "Executes" --> A0
A1 -- "Manages" --> A2
A1 -- "Creates for Run" --> A4
A0 -- "Uses" --> A3
A0 -- "Uses Logic" --> A7
A0 -- "Uses" --> A10
A2 -- "Stores Sequence Of" --> A6
A3 -- "Receives Context Via" --> A4
A3 -- "Uses For Access" --> A9
A4 -- "Holds Current" --> A0
A4 -- "References" --> A2
A4 -- "Provides Access To" --> A8
A7 -- "Uses For Model Comm" --> A5
A11 -- "Tests Performance Of" --> A0
-
Agent - Your Specialized AI Worker
- Introduction to the fundamental building block of the ADK
- Creating your first LLM-powered Agent
-
Runner - The Agent's Manager
- How to execute Agents and manage interactions
- Using InMemoryRunner to test your Agents
-
Session - The Conversation Memory
- Managing conversation history and state
- Working with different session types
-
Tool - Extending Agent Capabilities
- Adding specialized functions to your Agents
- Creating and registering custom tools
-
LLM Flow - Controlling Agent Logic
- Understanding the flow of LLM-based decision making
- Customizing how your Agent processes information
-
LLM Interaction - Talking to Language Models
- How Agents communicate with LLMs
- Configuring model parameters and handling responses
-
Invocation Context - The Agent's Environment
- Understanding the runtime context for Agent execution
- Accessing resources and services during execution
-
Event - Tracking What Happens
- How the ADK records Agent actions and responses
- Working with different event types
-
Code Executor - Running Code Safely
- Enabling Agents to execute code
- Managing security and sandboxing
-
Artifact Service - Working with Files
- How Agents can read and write files
- Managing file artifacts in your applications
-
Authentication - Secure Access to Services
- Providing Agents with secure access to external services
- Managing credentials and authentication
-
Evaluation - Checking Your Agent's Homework
- Testing and evaluating Agent performance
- Creating test cases and measuring results
To get started with the tutorial:
- Clone the adk-python repository
- These are documents only, no environment needed.
- Start with Chapter 1: Agent and work through the chapters sequentially
- Python 3.10 or higher
- Basic understanding of Python programming
- Google Cloud account (for using Vertex AI and Gemini models)
This tutorial was created using AI Codebase Knowledge Builder, an AI-powered tool that analyzes GitHub repositories and transforms complex code into beginner-friendly tutorials with clear visualizations. The tool crawls codebases to identify core abstractions and how they interact, making it easier to understand the architecture and functionality of complex software projects.
The AI Codebase Knowledge Builder was developed using Pocket Flow, a minimalist 100-line LLM framework that enables the creation of powerful AI agents and workflows. Pocket Flow follows the principles of Agentic Coding, where humans design and AI agents implement, resulting in a 10x productivity boost for developers.
-
AI Codebase Knowledge Builder: Automatically generates comprehensive tutorials from code repositories, creating structured learning paths with visualizations and explanations.
-
Pocket Flow: A lightweight (100 lines), zero-dependency LLM framework that is a MUST for proving code based structure to your vibe coding!!
All credit for these amazing tools goes to Zachary Huang:
- Twitter: x.com/ZacharyHuang12
- GitHub: github.com/zachary62