DEV Community

Cover image for Getting Started with Google Agent Development Kit (ADK)
Md Enayetur Rahman
Md Enayetur Rahman

Posted on

Getting Started with Google Agent Development Kit (ADK)

My Learning Journey

I'm excited to share my journey into agent development! After attending a comprehensive 5-day Kaggle course on agent development, I've now started building agents using the Agent Development Kit (ADK) provided by Google. My approach is to start simple and gradually dive deeper into more complex implementations.

I'll be documenting my learning process so that others can benefit from my experiences. I have a dedicated GitHub repository where I'll push code related to each agent I build, making it easy to follow along and learn together.

First Agent: ADK Quickstart

My first agent is based on the official ADK quickstart guide. Here's a step-by-step breakdown of what I did:

Step 1: Setting Up the Virtual Environment

First, I created a new directory for my project and set up a Python virtual environment:

C:\Agent\1.adk-quickstart>python -m venv .venv
Enter fullscreen mode Exit fullscreen mode

This creates an isolated Python environment to keep dependencies organized and avoid conflicts with other projects.

Step 2: Activating the Virtual Environment

Next, I activated the virtual environment:

C:\Agent\1.adk-quickstart>.venv\Scripts\activate.bat
Enter fullscreen mode Exit fullscreen mode

On Windows, this activates the virtual environment. You'll notice the (.venv) prefix in your terminal prompt, indicating that the virtual environment is active.

Step 3: Installing Google ADK

With the virtual environment activated, I installed the Google ADK package:

(.venv) C:\Agent\1.adk-quickstart>pip install google-adk
Enter fullscreen mode Exit fullscreen mode

This command installs the google-adk package along with all its dependencies. The installation includes many Google Cloud libraries such as:

  • google-cloud-aiplatform - For AI Platform integration
  • google-genai - For Google's Generative AI models
  • fastapi - For building web APIs
  • pydantic - For data validation
  • And many other supporting libraries

The installation process downloaded and installed numerous packages, ensuring everything needed for agent development is ready.

Step 4: Creating My First Agent

Once the installation was complete, I used the ADK CLI to create my first agent:

(.venv) C:\Agent\1.adk-quickstart>adk create first_agent
Enter fullscreen mode Exit fullscreen mode

The CLI guided me through an interactive setup process:

  1. Model Selection: I chose gemini-2.5-flash from the available options
  2. Backend Selection: I selected "Google AI" (option 1) as my backend
  3. API Key: I entered my Google API key (obtained from AI Studio)

After completing these steps, the agent was successfully created in C:\Agent\1.adk-quickstart\first_agent with the following structure:

first_agent/
├── .env          # Contains API key and configuration
├── __init__.py   # Python package initialization
└── agent.py      # Main agent code
Enter fullscreen mode Exit fullscreen mode

Step 5: Understanding the Agent Code

Let's take a look at the generated agent.py file:

from google.adk.agents.llm_agent import Agent

root_agent = Agent(
    model='gemini-2.5-flash',
    name='root_agent',
    description='A helpful assistant for user questions.',
    instruction='Answer user questions to the best of your knowledge',
)
Enter fullscreen mode Exit fullscreen mode

This simple code creates a basic agent using Google's Gemini 2.5 Flash model. The agent is configured with:

  • Model: gemini-2.5-flash - A fast and efficient model for general-purpose tasks
  • Name: root_agent - The identifier for this agent
  • Description: A brief description of what the agent does
  • Instruction: The system instruction that guides the agent's behavior

Running the Agent

After creating the agent, you can run it using:

adk run first_agent
Enter fullscreen mode Exit fullscreen mode

This starts an interactive session where you can chat with your agent directly in the terminal.

Alternatively, you can start a web-based UI:

adk web --port 8000
Enter fullscreen mode Exit fullscreen mode

This launches a web interface at http://127.0.0.1:8000 where you can interact with your agent through a user-friendly chat interface.

What's Next?

This is just the beginning! As I continue my learning journey, I plan to:

  1. Explore Advanced Features: Learn about tools, functions, and more complex agent architectures
  2. Build Practical Agents: Create agents that solve real-world problems
  3. Share Knowledge: Document each step and share code on GitHub
  4. Connect with Community: Learn from others and contribute to the agent development community

Key Takeaways

  • Setting up Google ADK is straightforward with clear CLI tools
  • The virtual environment keeps dependencies isolated and manageable
  • The quickstart provides a solid foundation for understanding agent development
  • Google's Gemini models offer powerful capabilities right out of the box

Resources

Top comments (0)