Labor Day starts with $70+ in savings on Coursera Plus. Save 40% for 3 months.

How to Use Google ADK for AI Agent Development: A Beginner’s Guide

Written by Coursera Staff • Updated on

Learn how to use Google ADK for AI agent development. Gain insights into ADK’s setup, core features, benefits, limitations, and key considerations for successful implementation.

[Featured Image] A smiling developer is learning how to use Google ADK while working at their computer.

Key takeaways

  • To use Google ADK for building an AI agent, install the framework, create a new agent project, configure your API key, add tools, run your agent, and continue testing and refining it using the ADK web or command-line interface.

  • Google ADK provides an integrated framework for building, testing, debugging, deploying, and scaling AI agents and multi-agent systems.

  • Beginners can start with simple Python projects or use ADK Visual Builder's low-code interface before progressing to more advanced agent workflows.

Google ADK makes it easy for you to develop AI agents by providing a structured workflow and tools that support the entire development process, from setup to deployment. Explore the essential steps to create and optimize AI agents with Google ADK.

If you'd like to continue building your AI skills, consider the Google AI Essentials Specialization. You'll have the opportunity to use generative AI tools to help develop ideas and content, make more informed decisions, and speed up daily work tasks; learn how to use AI responsibly by identifying AI’s potential biases and avoiding harm; and develop strategies to stay up-to-date in the emerging landscape of AI.

Prerequisites for getting started with Google ADK

The Agent Development Kit (ADK) is an open source framework that helps developers build, test, and deploy reliable artificial intelligence (AI) agents. ADK supports projects of all sizes, from simple AI assistants built with a single agent and a few tools to more advanced multi-agent systems. The platform supports TypeScript, Go, and Java [1].

To use Google ADK in Python, take a few minutes to make sure you have the following prerequisites in place.

  • Make sure you have Python 3.10 or later and pip, the Python package installer, installed on your computer.

  • Get a Gemini application programming interface (API) key. If you plan to use the Gemini API with ADK, you'll need an API key from Google AI Studio before you begin.

While not mandatory, using a Python virtual environment is a best practice because it keeps your project's dependencies separate from other Python projects.

Is it easy to use Google ADK?

It is generally easy to get started with Google ADK because it provides an integrated set of tools for scaffolding, building, testing, evaluating, deploying, and scaling AI agents. It also supports complex workflows through structured, graph-based architectures that define how tasks are carried out, helping produce more predictable results. ADK conveniently integrates with existing applications, multiple AI models, and partner tools. Overall, Google ADK simplifies the end-to-end development of AI agents and multi-agent systems, giving you the flexibility and control to build production-ready applications.

How to use Google ADK: A step-by-step overview

Building an AI agent with Google ADK involves setting up your development environment, creating an agent, adding tools, running it, and refining the agent’s capabilities through testing. This process takes just about 20 minutes. The following example demonstrates ADK’s functionality using Python.

Step 1: Set up your development environment.

1. Ensure that you have installed Python 3.10 or later, along with pip for installing packages.

2. Next, install Google ADK by entering the following command in your terminal: pip install google-adk

Step 2: Create your first agent.

1. Run the following command to create a new ADK agent project: adk create my_agent

2. After you create the project, ADK generates a project folder with several starter files. The agent.py file contains the main logic for your agent, while the.env file stores configuration information such as API keys. At this point, you can define tools for your agent to use by updating the generated agent.py code.

3. Before you can run your AI agent, you'll need a Gemini API key from Google AI Studio.

  • Open the Google AI Studio API Keys page in your browser and sign in with your Google account.

  • Select Create API key.

  • If you already have a Google Cloud project, choose it and create the API key. If you don't have a project yet, create one first, then generate your API key.

4. After you've created your API key, add it to your project's.env file using the following command: echo 'GOOGLE_API_KEY="YOUR_API_KEY"' >.env

5. Replace YOUR_API_KEY with the key you generated in Google AI Studio.

Step 3: Add tools.

Tools extend an AI agent's capabilities by connecting it to external data sources, APIs, or custom Python functions. When you define a tool, include a clear docstring, which is a short description written inside the function. ADK uses the docstring to determine what the tool does, the parameters it accepts, and the information it returns. This helps the underlying language model decide when to call the tool.

Step 4: Run your agent.

1. Once you've created your agent, you can run it either from the command line or through the ADK web interface. To run your agent from the command line, enter the following command in your terminal: adk run my_agent

2. To launch the ADK web interface, run the following command from the parent directory that contains your my_agent folder: adk web --port 8000

This command starts a local web server with a chat interface for your agent. Open http://localhost: 8000 in your browser, select your agent, and enter a prompt to begin testing.

Make sure you run the command from the parent directory that contains your my_agent folder. For example, if your project is located in agents/my_agent/, run the command from the agents/ directory.

Step 5: Test, refine, and extend.

Use the ADK web interface or command-line interface to test your agent by entering prompts and reviewing its responses. As you become more familiar with Google ADK, you can extend your agent by adding tools, workflows, or integrations.

Google ADK example: Building a simple AI agent

After learning the basics of Google ADK, it is helpful to see how the framework applies to a real-world project. The following example is based on an official Google ADK sample and demonstrates how developers can use ADK to build an AI-powered research assistant.

Example use case: Research assistant

Google's official Academic Research sample demonstrates one way to build an AI-powered research assistant with ADK. This agent uses a research paper as input and analyzes its content. It then uses Google Search and specialized agent tools to identify recent academic publications that cite the original paper. Finally, the agent synthesizes its analysis with the newer research and proposes potential future research ideas. According to the sample's documentation, this workflow helps researchers explore the impact of foundational research and identify opportunities for further investigation [2].

Basic agent setup overview

Although Google ADK includes many examples, the basic idea is straightforward. You use the LlmAgent class to define an agent's identity by specifying a language model, a unique name, and a description of its purpose. You can then add instructions that guide the agent's behavior and tools that allow it to interact with external services or perform specific tasks. The following example from the Google ADK documentation illustrates the basic structure of an agent [3]:

<python>

from google.adk.agents import LlmAgent

capital_agent = LlmAgent(

model="gemini-flash-latest",

name="capital_agent",

description="Answers user questions about the capital city of a given country."

)

This simplified example shows the basic information needed to define an ADK agent before adding instructions or tools.

Read more: What Are Large Language Models (LLMs)?

How tools are used in this example

Tools extend an agent's capabilities beyond the language model's built-in knowledge. They allow an ADK agent to interact with external systems, perform calculations, retrieve real-time information, or complete specific tasks. As a developer, you can provide a list of available tools when defining the agent, and the model decides which tool to use based on the user's request and the agent's instructions.

<python>

tools=[get_capital_city]

In this example, the get_capital_city tool enables the agent to retrieve the capital city for a given country before generating a response.

What happens when the agent runs?

The agent uses a language model to reason, understand natural language, make decisions, generate responses, and interact with tools. Because the agent dynamically decides how to proceed, it can determine whether to use an available tool before producing an output.

Can beginners use Google ADK without coding experience?

Yes, although some coding knowledge can be helpful. Even if you're completely new to Google ADK, tutorials walk you through each step. You can learn Google ADK by starting with simple projects that cover installation, creating a basic AI agent, and running it before moving on to more advanced features. In addition to building agents with Python, Google ADK includes Visual Builder, which provides a low-code approach to creating AI agents.

Best practices and common pitfalls of using Google ADK

Ambiguous instructions and adversarial prompt injections can cause agents to behave unpredictably, causing risks such as data exfiltration. Using built-in Gemini Safety features and following a few best practices can help you build Google ADK agents that produce more reliable, consistent results. Keep these tips in mind as you create and refine your agents.

  • Write clear and specific instructions: Avoid ambiguity by clearly defining your agent's task, expected behavior, and desired output.

  • Use markdown to organize complex instructions: Headings, lists, and formatting can make longer prompts easier for both you and the model to follow.

  • Include examples for complex tasks: Providing examples of the desired output can help improve consistency.

  • Clearly describe when your agent should use each available tool: This helps the agent choose the right tool for the task instead of relying only on the language model.

Explore our free resources for AI professionals

Subscribe to Career Chat, our weekly LinkedIn newsletter for career advice. You can also continue to learn more about AI and AI agent development with free resources like the following:

With Coursera Plus, you can learn and earn credentials at your own pace from over 350 leading companies and universities. With a monthly or annual subscription, you’ll gain access to over 10,000 programs. Check the course page to confirm your selection is included.

Article sources

1

GoogleCloud. “Agent Development Kit, https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/adk/.” Accessed July 13, 2026.

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.