This guide provides a high-level overview of the Agent Development Kit (ADK) Crash Course repository. It's intended for developers who are new to this project but have general programming experience, to help them understand its structure, setup, and core concepts.
This repository is structured as a collection of educational examples designed to teach Google's Agent Development Kit (ADK). It does not represent a single, monolithic application but rather a series of small, focused projects, each demonstrating a specific feature or capability of the ADK framework.
Each numbered directory (e.g., 1-basic-agent, 2-tool-agent) is a self-contained example. The primary architectural pattern is Agent-based, where each example showcases how to build LLM-powered agents for various tasks.
There is no overarching complex architecture like MVC or Microservices spanning the entire repository; instead, focus is on individual agent implementations.
The main directories and their purposes are as follows:
/(Root Directory):1-basic-agent/,2-tool-agent/, ...12-loop-agent/: Individual example projects. Each contains its ownREADME.mdand a subdirectory with the agent's Python code (e.g.,1-basic-agent/greeting_agent/)..venv/: (Created by user) Python virtual environment for project dependencies..git/: Git version control files..gitignore: Specifies intentionally untracked files that Git should ignore.README.md: Main project overview, setup instructions, and example descriptions.GEMINI_MODELS.md: Information about supported Gemini models, their capabilities, and pricing.requirements.txt: A list of Python dependencies for the project.agent-development-kit-crash-course.code-workspace: VS Code workspace configuration file.
/<example-name>/<agent-module-name>/(e.g.,1-basic-agent/greeting_agent/):agent.py: Contains the core logic and implementation for the specific example agent..env.example: Template for environment variables (primarilyGOOGLE_API_KEY).__init__.py: Makes the directory a Python package.README.md: (Inside/<example-name>/) Provides specific details about that example.
The core logic resides within each individual example project. The most critical files are generally:
/<example-name>/<agent-module-name>/agent.py: This file is the heart of each example, containing the agent's definition, tool integrations (if any), and interaction logic. For instance, in1-basic-agent/greeting_agent/agent.py, you'll find the simplest form of an ADK agent.
The README.md in the root directory provides a good summary of what each example (1-basic-agent through 12-loop-agent) demonstrates.
Given the nature of the repository (a collection of examples), data flow is specific to each agent example. However, a general conceptual flow for most agents is:
- User Input: The user provides a query or command to the agent (typically via a command-line interface when running the
agent.pyscript). - Agent Processing: The ADK framework, along with the custom logic in
agent.py, processes this input. - LLM Interaction: The agent interacts with a Google Gemini Large Language Model (LLM), sending the processed input (and potentially previous conversation context or tool outputs).
- LLM Response: The LLM generates a response.
- Agent Output: The agent processes the LLM's response and presents it to the user.
For tool-using agents (e.g., 2-tool-agent), the flow might involve the LLM requesting the use of a tool, the agent executing the tool, and the tool's output being fed back to the LLM for further processing before a final response is generated.
The project relies on the following major external libraries (as defined in requirements.txt):
google-adk[database]==0.3.0: The core Google Agent Development Kit framework. The[database]extra suggests capabilities for persistent storage.yfinance==0.2.56: Yahoo Finance API; likely used in an example agent that requires financial data.psutil==5.9.5: A cross-platform library for retrieving information on running processes and system utilization; its specific use case within an example agent would need further investigation.litellm==1.66.3: A library to simplify interactions with various LLM providers, allowing for easier switching between models.google-generativeai==0.8.5: The Google Generative AI SDK, used for direct interaction with Gemini models.python-dotenv==1.1.0: Used for managing environment variables by loading them from.envfiles.
Follow these steps to set up the development environment and run the examples:
uv init
uv venv
source .venv/bin/activate-
Create Virtual Environment (in the root directory of the repository):
python -m venv .venv
-
Activate Virtual Environment:
-
macOS/Linux:
source .venv/bin/activate -
Windows CMD:
.venv\Scripts\activate.bat
-
Windows PowerShell:
.venv\Scripts\Activate.ps1
-
-
Install Dependencies:
pip install -r requirements.txt
-
Obtain a
GOOGLE_API_KEYfrom Google AI Studio by creating a project and enabling the API. -
Navigate to the specific agent's directory within an example folder (e.g.,
cd 1-basic-agent/greeting_agent/). -
Rename the
.env.examplefile in that directory to.env. -
Open the
.envfile and replace the placeholder with your actual API key:GOOGLE_API_KEY=your_api_key_here
-
Ensure your virtual environment is active and the API key is set up for the desired example.
-
Navigate to the example's agent directory (e.g.,
cd 1-basic-agent/greeting_agent/). -
Run the agent script:
python agent.py
(Or
python main.pyif the entry point is namedmain.pyin some examples. Based on current findings,agent.pyis common.)
No dedicated test files (e.g., *_test.py, *.spec.js) or specific test directories (e.g., /tests) were found in the repository at the time of this analysis.
Testing appears to be primarily manual, by running the individual agent examples and observing their behavior. There is no evidence of a formal unit, integration, or end-to-end testing framework being used across the examples.
- Modular Examples: The codebase is organized into distinct, numbered example directories, each focusing on a specific ADK feature.
- Environment Variables for Configuration: API keys and other sensitive configurations are managed using
.envfiles, with.env.examplefiles serving as templates. This is a common pattern for security and configurability. agent.pyas Entry Point: Within each example's specific module directory,agent.pytypically serves as the main script or defines the core agent logic.- READMEs per Example: Each numbered example folder contains its own
README.mdproviding context for that specific example, supplementing the main projectREADME.md.
The repository contains the following key documentation files:
README.md(Root Directory):- Purpose: Provides a general introduction to the ADK Crash Course, lists all the examples with brief descriptions, and gives detailed instructions for setting up the Python virtual environment and installing dependencies.
- Key Points: Crucial for initial setup, understanding the project's goal, and navigating the different examples.
GEMINI_MODELS.md(Root Directory):- Purpose: Offers an overview of the various Google Gemini models compatible with ADK.
- Key Points: Details model capabilities (input types, best use cases), pricing per million tokens (input/output), token information, and guidelines for selecting the appropriate model based on needs like budget, performance, or task complexity. It also links to the official Gemini API documentation for the most current information.
/<example-name>/README.md(e.g.,1-basic-agent/README.md):- Purpose: Provides specific information, context, and potentially more detailed running instructions for the individual example it resides in.
No specific IDE or coding system rule files (e.g., .cursorrules, .windsurfrules, .roomodes, linters configurations beyond standard Python practices) were identified in the repository. Development likely follows general Python conventions.
No MCP integration files (e.g., mcp.json in .cursor, .vscode, or .windsurf directories) were found. This project does not appear to use MCP integrations as per the file structure.
The primary environment variable required by the examples is:
GOOGLE_API_KEY:- Purpose: This key is essential for authenticating requests to Google's Generative AI services, which power the Gemini models used by the ADK agents.
- Location: Each example's specific agent directory (e.g.,
1-basic-agent/greeting_agent/) contains a.env.examplefile. You need to copy this to.envand fill in your key.
It's possible that specific examples might introduce other environment variables, which would be documented in their respective README.md or .env.example files.
This guide was generated based on a static analysis of the repository. Some dynamic behaviors or configurations might require runtime inspection.