Get started with the Live API using ADK

This tutorial shows you how to create an agent and use the Agent Development Kit(ADK) Streaming to enable voice and video communication. You install the ADK,set up a basic agent that uses Google Search, and run the agent with theadkweb tool.

Before you begin

This guide assumes you have experience using a terminal in Windows, macOS, orLinux environments.

Set up your environment and install the ADK

This section shows you how to prepare your local environment.

  1. Create and activate a virtual environment. Using a virtual environment is arecommended practice.

    # Create the environmentpython-mvenv.venv# Activate the environment in each new terminal# For macOS or Linux:source.venv/bin/activate# For Windows CMD:.venv\Scripts\activate.bat# For Windows PowerShell:.venv\Scripts\Activate.ps1
  2. Install the ADK.

    pipinstallgoogle-adk

Create the project structure

Create the necessary directories and files for your agent.

  1. Create the following folder structure with empty files:

    Diagram of project structure: adk-streaming folder contains app folder, which contains .env file and google_search_agent folder, which contains __init__.py and agent.py files.

  2. Add the following code to theapp/google_search_agent/agent.py file. Thisfile defines your agent's logic. You must define aroot_agent. In thefollowing code, update themodel field with a supported model name.

    fromgoogle.adk.agentsimportAgentfromgoogle.adk.toolsimportgoogle_search# Import the toolroot_agent=Agent(# A unique name for the agent.name="basic_search_agent",# The Large Language Model (LLM) that agent will use.# Please fill in the latest model id that supports live from# https://google.github.io/adk-docs/get-started/streaming/quickstart-streaming/#supported-modelsmodel="...",# for example: model="gemini-live-2.5-flash-preview-native-audio-09-2025"# A short description of the agent's purpose.description="Agent to answer questions using Google Search.",# Instructions to set the agent's behavior.instruction="You are an expert researcher. You always stick to the facts.",# Add google_search tool to perform grounding with Google search.tools=[google_search])
  3. Add the following code to theapp/google_search_agent/__init__.py file:

    from.importagent

Set up the platform

To run the agent, configure it to use Google Cloud Vertex AI.

  1. Open the.env file located in theapp/ directory.

  2. Add the following content to the file. ReplacePROJECT_ID with your Google Cloud project ID and replaceLOCATION with your Google Cloud location.

    GOOGLE_CLOUD_PROJECT=PROJECT_IDGOOGLE_CLOUD_LOCATION=LOCATIONGOOGLE_GENAI_USE_VERTEXAI=True

Run the agent with the dev UI

Launch the development user interface to interact with your agent.

  1. Change your current directory toapp.

    cdapp
  2. Set theSSL_CERT_FILE environment variable. This step is required forvoice and video tests.

    macOS/Linux

    exportSSL_CERT_FILE=$(python-mcertifi)

    Windows

    $env:SSL_CERT_FILE=(python-mcertifi)
  3. Run the dev UI.

    adkweb
    Note: If you use Windows and encounter aNotImplementedError, runadk web--no-reload instead.
  4. Open the URL provided in the terminal, which is typicallyhttp://localhost:8000 orhttp://127.0.0.1:8000.

  5. Selectgoogle_search_agent.

The following diagram shows how user input flows to the agent, how the agent usesthe Google Search tool, and how the agent returns a response:

Diagram showing user input going to agent, agent using Google Search tool to get information, and agent returning a response to the user.

Interact with the agent

After you launch the dev UI, you can interact with your agent by using text,voice, or video.

Use text input

Enter the following prompts in the UI to test the agent's text-based responses.The agent uses thegoogle_search tool to get the latest information to answerthese questions.

Use voice and video input

To use voice input, reload the web browser and click the microphone button. Aska question, and you hear the answer in real time.

To use video input, reload the web browser and click the camera button. Ask aquestion like "What do you see?", and the agent describes what it sees from thevideo input.

Note: Click the microphone or camera button only once to start streaming.Clicking the buttons multiple times is not supported.

Stop the dev UI

To stop theadk web tool, pressCtrl+C in the terminal where it is running.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.