One-Line Summary: Create the Python project, install Google ADK, and configure your Gemini API key.
Prerequisites: Python 3.12+ installed, a Google account
Create the Project
Open your terminal and set up the project directory:
# Create the project directory and navigate into it
mkdir research-agent
cd research-agent
# Create a virtual environment
python -m venv .venv
# Activate it (Linux/macOS)
source .venv/bin/activate
# Activate it (Windows)
# .venv\Scripts\activateInstall Google ADK
# Install the Agent Development Kit
pip install google-adkThat single package brings in everything you need:
| What You Get | Purpose |
|---|---|
google-adk | Agent framework — agents, tools, runner, sessions |
google-genai | Gemini API client (installed as a dependency) |
adk CLI | Create, run, test, and deploy agents from the terminal |
Save the dependencies:
pip freeze > requirements.txtGet Your Gemini API Key
- Go to Google AI Studio
- Click Create API Key
- Copy the key
Create a .env file in your project root:
# .env
GOOGLE_API_KEY=your-gemini-api-key-hereCost: Gemini has a generous free tier. The
gemini-2.5-flashmodel we will use is fast and affordable for development.
Create the Agent Package
ADK expects your agent to live in a Python package. Create the directory structure:
# Create the agent package directory
mkdir research_agent
# Create the required files
touch research_agent/__init__.py
touch research_agent/agent.pyAdd the package init that tells ADK where to find your agent:
# research_agent/__init__.py
# ==========================================
# Package init — ADK discovers agents through this file
# ==========================================
from . import agentVerify ADK Is Installed
Run a quick check to make sure everything is working:
# Check ADK version
adk --versionYou should see a version number like 1.x.x. If you see a command not found error, make sure your virtual environment is activated.
Verify Your API Key
Create a quick test to confirm your Gemini API key works:
# test_setup.py
# ==========================================
# Quick smoke test — verifies API key works
# ==========================================
import google.genai as genai
import os
from dotenv import load_dotenv
load_dotenv()
client = genai.Client()
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Say hello in exactly 5 words.",
)
print(response.text)
print("\nSetup verified — you're ready to build.")Run it:
python test_setup.pyIf you see a five-word greeting and the success message, your environment is configured correctly. If you get an authentication error, double-check your API key in .env.
Your Project So Far
research-agent/
├── research_agent/
│ ├── __init__.py ✅ Package init
│ └── agent.py 📝 Empty (we fill this next)
├── .env ✅ API key configured
├── requirements.txt ✅ Dependencies saved
└── test_setup.py ✅ Setup verifiedReference: ADK Python Get Started · Google AI Studio