Section 2: Build Your First ADK Agent
It's time to get hands-on. In this section, we set up your development environment across macOS, Windows, and Ubuntu, and run your first "Hello World" agent using Google's Agent Development Kit (ADK). We will build a Website Builder Agent capable of generating full-fledged, responsive HTML landing pages from a single natural language prompt.
This documentation serves as the comprehensive written companion to the Master Google ADK video course. While these guides provide the technical reference and code snippets, the video course provides the deep-dive reasoning and live debugging sessions.

Master Google ADK - Agent Development Kit
Build Multi Agent Systems | Mac, Windows, Ubuntu | Deploy to Google Cloud | Free Gemini Key
The Project: Website Builder Agentβ
Before we dive into the installation, let's understand what we are building. The Website Builder Agent demonstrates the core power of LLM Orchestration.
With a single promptβ"Build a landing page for a Website that teaches about AI..."βthe agent autonomously:
- Reasons: Analyzes the request to determine the necessary HTML structure, CSS styling, and content.
- Generates: Produces high-quality, responsive code.
- Executes: Uses a local File Writer Tool to save the code to your disk with a timestamped filename.
The result is a self-contained HTML file with modern styling (gradients, hover effects) that you can open immediately in your browser.
Architecture Breakdownβ
To achieve this, we use the following ADK components:
LlmAgent: The brain of the operation, powered by Gemini 2.0 Flash for high speed and low latency.- System Instructions: A text file (
instructions.txt) that defines the agent's persona ("You are an expert AI web developer"). - Tooling: A Python function
write_to_fileregistered as a tool. The ADK converts this Python function into a schema the LLM can understand, enabling Function Calling.
Environment Setupβ
We will use Python 3.11+ and UV, a modern, lightning-fast package manager that replaces standard pip for robust dependency resolution.
Select your operating system below for specific installation steps.
- macOS
- Windows
- Ubuntu
1. Install Python Check your current version:
python3 --version
If you do not have Python 3.11 or newer, download the installer from python.org.
2. Install UV (Package Manager)
We use uv for managing virtual environments. It is significantly faster than pip and handles dependency locking automatically.
pip3 install uv
# Verify installation
uv --version
If uv is not found after installation, restart your terminal to refresh your system PATH.
3. Install VS Code & Extensions
- Download Visual Studio Code from code.visualstudio.com.
- Install the official Python extension by Microsoft.
- Pro Tip: Install the HTML Preview extension (by George Oliveira) to view your agent's generated pages directly inside VS Code.
4. Install Git
git --version
If Git is missing, macOS will prompt you to install the Command Line Developer Tools. Click "Install".
1. Install Python
- Download the installer from python.org.
- :::danger Critical Step During installation, you MUST check the box "Add python.exe to PATH". This ensures you can run Python commands from PowerShell. :::
- Verify in PowerShell:
python --version
2. Install UV Open PowerShell and run the official install script:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Alternatively, if you have pip installed:
pip install uv
Restart PowerShell after installation.
3. Install VS Code Download and run the installer from code.visualstudio.com.
- Recommendation: Check "Add 'Open with Code' action to Windows Explorer context menu" during setup for easier workflow.
- Extensions: Install the Python extension and the HTML Preview extension inside VS Code.
4. Install Git Download Git for Windows from git-scm.com.
- During setup, select "Override the default branch name" and set it to
main.
1. System Update & Python
sudo apt update
sudo apt install python3 python3-pip python3-venv curl
python3 --version
2. Install UV Use the official installation script:
curl -LsSf https://astral.sh/uv/install.sh | sh
Restart your terminal to load uv into your PATH.
3. Install VS Code
- Download the
.debpackage from code.visualstudio.com. - Install via apt:
cd ~/Downloadssudo apt install ./code_*.deb
- Install the Python and HTML Preview extensions.
4. Install Git
sudo apt install git
git --version
Project Directory Structureβ
We will organize our work to match the course repository structure. Open your terminal/PowerShell and run:
mkdir -p ~/development/adk
cd ~/development/adk
Clone the course repository or unzip the provided source code here. Your structure should look like this:
development/
βββ adk/
βββ adk_samples/
βββ version_1_website_builder_simple/
βββ agents/
βββ tools/
βββ utils/
βββ .env
βββ pyproject.toml
Building and Running the Agentβ
1. Initialize Virtual Environmentβ
Navigate to the project folder and use uv to create a fast, isolated environment.
cd ~/development/adk/adk_samples/version_1_website_builder_simple
uv venv
2. Activate Environmentβ
- macOS / Linux
- Windows
source .venv/bin/activate
.venv\Scripts\activate
You should see (version_1_website_builder_simple) in your terminal prompt.
3. Install Dependenciesβ
This project uses pyproject.toml to define dependencies (specifically google-adk). Using uv sync ensures you get the exact versions required.
uv sync --all-groups
4. Configure API Keysβ
The ADK needs access to Google's generative models.
-
Go to Google AI Studio and click Get API key.
-
Create a key in a Google Cloud project (e.g., "Gemini API").
-
In VS Code, create a file named
.envin theversion_1_website_builder_simpledirectory. -
Add the following configuration:
GOOGLE_API_KEY=your_api_key_starts_with_AIza...GOOGLE_GENAI_USE_VERTEXAI=FALSE
The .env file contains sensitive keys. Ensure your .gitignore file includes .env to prevent accidental commits to public repositories.
5. Run the Agentβ
Use the ADK CLI to launch the development server. We point it to the agents directory where our python agent code resides.
adk web ./agents
You should see output indicating the server has started. Open your browser to:
http://localhost:8000
In the ADK Playground, select website_builder_simple from the left sidebar and type a prompt:
"Build me a resume website for a software engineer. Make it professional."
Code Walkthroughβ
Let's understand the magic behind the scenes.
1. The Configuration (pyproject.toml)β
Instead of a requirements.txt, we use pyproject.toml. This modern standard defines metadata and dependencies (google-adk) allowing uv to manage the environment deterministically.
2. The Tool (tools/file_writer_tool.py)β
This file defines the capability we give to the agent.
def write_to_file(content: str) -> dict:
"""Writes the given HTML content to a timestamped HTML file."""
# Logic to generate filename using datetime...
# Logic to write content with utf-8 encoding...
return {"status": "success", "filename": filename}
Why this matters: The ADK inspects the type hint content: str and the docstring to automatically generate a JSON schema for the LLM. The model knows how to use this tool without us writing any parsing logic.
3. The Agent (agents/website_builder_simple/agent.py)β
This is the "Brain".
from google.adk.agents import LlmAgent
from tools.file_writer_tool import write_to_file
from utils.file_loader import load_instructions_file
root_agent = LlmAgent(
name="website_builder_simple",
model="gemini-2.0-flash-001", # Fast, low-latency model
instruction=load_instructions_file("agents/.../instructions.txt"),
tools=[write_to_file]
)
- Model Selection: We use
gemini-2.0-flash-001because it is cost-effective and fast for interactive tasks. - Instruction Loading: We load instructions from a text file (
instructions.txt). This separates our "Prompt Engineering" from our "Python Engineering," keeping the codebase clean. - Tool Registration: Passing
[write_to_file]allows the agent to decide when to save the file based on the conversation flow.
What's Next?β
You have successfully set up a professional AI engineering environment and deployed your first tool-using agent.
In Section 3, we will move from single agents to Sequential Workflows. You will learn how to chain multiple agents togetherβone for research, one for coding, and one for reviewβto solve complex tasks.

Master Google ADK - Agent Development Kit
Build Multi Agent Systems | Mac, Windows, Ubuntu | Deploy to Google Cloud | Free Gemini Key