{"id":202043,"date":"2025-04-24T05:04:46","date_gmt":"2025-04-24T05:04:46","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/how-to-use-google-adk-for-building-agents\/"},"modified":"2025-04-24T05:04:46","modified_gmt":"2025-04-24T05:04:46","slug":"how-to-use-google-adk-for-building-agents","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=202043","title":{"rendered":"How to Use Google ADK for Building Agents?"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>Looking to build intelligent agents with real-world capabilities? Use Google ADK for building agents that can reason, delegate, and respond dynamically. This Google ADK tutorial walks you through the steps to build conversational agents with Google ADK across different language models like <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/12\/what-is-google-gemini-features-usage-and-limitations\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gemini<\/a> and <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/04\/what-is-gpt-you-wont-believe-whats-inside\/\" target=\"_blank\" rel=\"noreferrer noopener\">GPT<\/a>. Whether you\u2019re exploring Google ADK for AI agents or curious about how to create <a href=\"https:\/\/www.analyticsvidhya.com\/articles\/what-are-ai-agents\/\" target=\"_blank\" rel=\"noreferrer noopener\">AI agents<\/a> using Google ADK, this hands-on guide will help you kickstart your journey into agentic development with ease and clarity.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-the-agent-development-kit\">What is the Agent Development Kit?<\/h2>\n<p>Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents. It can be used with popular LLMs and open-source generative AI tools and is designed to integrate tightly with the Google ecosystem and Gemini models. ADK makes it easy to get started with simple agents powered by Gemini models and Google AI tools while providing the control and structure needed for more complex agent architectures and orchestration.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-features-of-google-s-agent-development-kit\">Features of Google\u2019s Agent Development Kit<\/h4>\n<ol class=\"wp-block-list\">\n<li><b>Multi-Agent Architecture:<\/b> Compose agents in parallel, sequential, or hierarchical workflows.<\/li>\n<li><b>Flexible Orchestration:<\/b> Route tasks dynamically using LLM-powered workflows.<\/li>\n<li><b>Rich Tool Ecosystem:<\/b> Use built-in, custom, and third-party tools seamlessly.<\/li>\n<li><b>Model-Agnostic:<\/b> Supports Gemini, GPT-4o, Claude, Mistral, and more.<\/li>\n<li><b>Streaming Capabilities:<\/b> Real-time streaming for text, audio, and video.<\/li>\n<li><b>Dev-Friendly Tooling:<\/b> CLI, web UI, visual debugging, and evaluation tools.<\/li>\n<li><b>Memory &amp; State Management:<\/b> Built-in handling for session and long-term memory.<\/li>\n<li><b>Artifact Handling:<\/b> Manage files, outputs, and binary data effortlessly.<\/li>\n<li><b>Smart Execution:<\/b> Agents can execute code and handle multi-step planning.<\/li>\n<li><b>Versatile Deployment:<\/b> Run locally, on Google Cloud (Vertex AI, Cloud Run), or via Docker.<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\" id=\"h-problem-statement\"><b>Problem Statement<\/b><\/h2>\n<p>As AI systems evolve from single-purpose tools to collaborative, multi-agent ecosystems, developers need practical guidance on building and orchestrating intelligent agents that can communicate, delegate, and adapt. To bridge this gap, we\u2019ll build a <b>Weather Bot Team<\/b>, a multi-agent system capable of answering weather-related queries while also handling user interactions like greetings, farewells, and safe responses.<\/p>\n<p>This hands-on project aims to demonstrate how to:<\/p>\n<ul class=\"wp-block-list\">\n<li>Design a modular multi-agent system using Google\u2019s Agent Development Kit (ADK).<\/li>\n<li>Integrate multiple language models (e.g., Gemini, GPT, <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/02\/claude-3-7-sonnet-for-coding\/\">Claude<\/a>) for task specialization.<\/li>\n<li>Implement intelligent task delegation across agents.<\/li>\n<li>Manage session memory for contextual continuity.<\/li>\n<li>Apply safety mechanisms through structured callbacks.<\/li>\n<\/ul>\n<p>By solving this problem, you\u2019ll gain practical experience with ADK\u2019s architecture, orchestration, memory management, and safety best practices, laying the groundwork for more complex, real-world agentic applications.<\/p>\n<p>You can refer to the provided <a href=\"https:\/\/colab.research.google.com\/drive\/13YxFLoTdMpfK9AK_JxjollnRiH1_Fkb_?usp=sharing\">Colab notebook<\/a> to guide you through the hands-on implementation.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-proposed-workflow\">Proposed Workflow<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1118\" height=\"582\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp\" alt=\"Building Agents UML Diagram\" class=\"wp-image-231987\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp 1118w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai-300x156.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai-768x400.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai-150x78.webp 150w\" sizes=\"(max-width: 1118px) 100vw, 1118px\"\/><\/a><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2>\n<p>Before diving into the code, make sure you\u2019ve completed the following setup steps:<\/p>\n<p><strong>1. Set-up your Environment &amp; Install ADK<\/strong><\/p>\n<p>Start by creating and activating a virtual environment to isolate your project dependencies:<\/p>\n<pre class=\"wp-block-code\"><code># Create a virtual environment\n\npython -m venv .venv<\/code><\/pre>\n<p>Now that the environment has been created, we can active it using the following commands:<\/p>\n<pre class=\"wp-block-code\"><code># Activate the environment\n\n# macOS\/Linux:\n\nsource .venv\/bin\/activate\n\n# Windows CMD:\n\n.venv\\Scripts\\activate.bat\n\n# Windows PowerShell:\n\n.venv\\Scripts\\Activate.ps1<\/code><\/pre>\n<p>\u00a0Once your environment is activated, install the <b>Google AI Development Kit (ADK)<\/b>:<\/p>\n<pre class=\"wp-block-code\"><code>pip install google-adk<\/code><\/pre>\n<p><strong>2. Obtain your API Keys<\/strong><\/p>\n<p>You\u2019ll need API keys to interact with different AI models. Grab them from the following sources:<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-steps-to-build-your-weather-app\">Steps to Build Your Weather App<\/h2>\n<h3 class=\"wp-block-heading\" id=\"h-step-1-setup-and-installation\">Step 1: Setup and Installation<\/h3>\n<p>Install the required libraries for the project:<\/p>\n<pre class=\"wp-block-code\"><code># Install Google ADK and LiteLLM\n!pip install google-adk -q\n!pip install litellm -q<\/code><\/pre>\n<p>Import libraries:<\/p>\n<pre class=\"wp-block-code\"><code>import os\n\nimport asyncio\n\nfrom google.adk.agents import Agent\n\nfrom google.adk.models.lite_llm import LiteLlm # For multi-model support\n\nfrom google.adk.sessions import InMemorySessionService\n\nfrom google.adk.runners import Runner\n\nfrom google.genai import types # For creating message Content\/Parts\n\nimport warnings\n\n# Ignore all warnings\n\nwarnings.filterwarnings(\"ignore\")\n\nimport logging\n\nlogging.basicConfig(level=logging.ERROR)<\/code><\/pre>\n<p>Set up API Keys:<\/p>\n<pre class=\"wp-block-code\"><code># Gemini API Key\n\nos.environ[\"GOOGLE_API_KEY\"] = \"YOUR_GOOGLE_API_KEY\"\n\n# OpenAI API Key\n\nos.environ['OPENAI_API_KEY'] = \u201cYOUR_OPENAI_API_KEY\u201d\n\n# Anthropic API Key\n\nos.environ['ANTHROPIC_API_KEY'] = \u201cYOUR_ANTHROPIC_API_KEY\u201d\n\nprint(\"API Keys Set:\")\n\nprint(f\"Google API Key set: {'Yes' if os.environ.get('GOOGLE_API_KEY') and os.environ['GOOGLE_API_KEY'] != 'YOUR_GOOGLE_API_KEY' else 'No (REPLACE PLACEHOLDER!)'}\")\n\nprint(f\"OpenAI API Key set: {'Yes' if os.environ.get('OPENAI_API_KEY') and os.environ['OPENAI_API_KEY'] != 'YOUR_OPENAI_API_KEY' else 'No (REPLACE PLACEHOLDER!)'}\")\n\nprint(f\"Anthropic API Key set: {'Yes' if os.environ.get('ANTHROPIC_API_KEY') and os.environ['ANTHROPIC_API_KEY'] != 'YOUR_ANTHROPIC_API_KEY' else 'No (REPLACE PLACEHOLDER!)'}\")\n\n# Configure ADK to use API keys directly (not Vertex AI for this multi-model setup)\n\nos.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"False\"<\/code><\/pre>\n<p>Define Model Constants for easier use:<\/p>\n<pre class=\"wp-block-code\"><code>MODEL_GEMINI_2_0_FLASH = \"gemini-2.0-flash\".\n\nMODEL_GPT_4O = \"openai\/gpt-4o\"\n\nMODEL_CLAUDE_SONNET = \"anthropic\/claude-3-sonnet-20240229\"\n\nprint(\"\\nEnvironment configured.\")<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-2-define-tools\">Step 2: Define Tools<\/h3>\n<p>In ADK, Tools are the functional building blocks that allow agents to go beyond just generating text. They\u2019re typically simple Python functions that can perform real actions, like fetching weather data, querying a database, or running calculations.<\/p>\n<p>To start, we\u2019ll create a mock weather tool to simulate weather lookups. This helps us focus on the agent\u2019s structure without needing external APIs. Later, we can easily swap it for a real weather service.<\/p>\n<p><b>Code:<\/b><\/p>\n<pre class=\"wp-block-code\"><code>def get_weather(city: str) -&gt; dict:\n   \"\"\"Retrieves the current weather report for a specified city.\n\n\n   Args:\n       city (str): The name of the city (e.g., \"Mumbai\",\"Chennai\",\"Delhi\").\n\n\n   Returns:\n       dict: A dictionary containing the weather information.\n             Includes a 'status' key ('success' or 'error').\n             If 'success', includes a 'report' key with weather details.\n             If 'error', includes an 'error_message' key.\n   \"\"\"\n   # Best Practice: Log tool execution for easier debugging\n   print(f\"--- Tool: get_weather called for city: {city} ---\")\n\n\n   city_normalized = city.lower().replace(\" \", \"\")  # Basic input normalization\n\n\n   mock_weather_db = {\n       \"delhi\": {\"status\": \"success\", \"report\": \"The weather in Delhi is sunny with a temperature of 35\u00b0C.\"},\n       \"mumbai\": {\"status\": \"success\", \"report\": \"It's humid in Mumbai with a temperature of 30\u00b0C.\"},\n       \"bangalore\": {\"status\": \"success\", \"report\": \"Bangalore is experiencing light showers and a temperature of 22\u00b0C.\"},\n       \"kolkata\": {\"status\": \"success\", \"report\": \"Kolkata is partly cloudy with a temperature of 29\u00b0C.\"},\n       \"chennai\": {\"status\": \"success\", \"report\": \"It's hot and humid in Chennai with a temperature of 33\u00b0C.\"},\n   }\n\n\n   if city_normalized in mock_weather_db:\n       return mock_weather_db[city_normalized]\n   else:\n       return {\"status\": \"error\", \"error_message\": f\"Sorry, I don't have weather information for '{city}'.\"}\n\n\n# Example usage\nprint(get_weather(\"Mumbai\"))<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-3-defining-the-agent\">Step 3: Defining the Agent<\/h3>\n<p>In ADK, an Agent is the core component that manages the conversation flow, connecting the user, the LLM, and the tools it can use.<\/p>\n<p>To define an agent, you\u2019ll configure a few essential parameters:\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li><i>name<\/i>: A unique identifier for the agent (e.g., \u201cweather_agent_v1\u201d).<\/li>\n<li><i>model<\/i>: The LLM the agent will use (e.g., MODEL_GEMINI_2_5_PRO).<\/li>\n<li><i>description<\/i>: A short summary of what the agent does \u2013 crucial for collaboration and delegation in multi-agent systems.<\/li>\n<li><i>instruction<\/i>: Detailed behavior guidelines for the LLM, defining its persona, goals, how to use tools, and how to handle edge cases.<\/li>\n<li><i>tools<\/i>: A list of tool functions (like [get_weather]) the agent can invoke.<\/li>\n<\/ul>\n<p>\u00a0<b>Code<\/b>:<\/p>\n<pre class=\"wp-block-code\"><code>AGENT_MODEL=model\nweather_agent=Agent(\n   name=\"weather_agent_v1\",\n   model=AGENT_MODEL,\n   description=\"Provides weather information for specific cities.\",\n   instruction=\"You are a helpful weather assistant. Your primary goal is to provide current weather reports. \"\n               \"When the user asks for the weather in a specific city, \"\n               \"you MUST use the 'get_weather' tool to find the information. \"\n               \"Analyze the tool's response: if the status is 'error', inform the user politely about the error message. \"\n               \"If the status is 'success', present the weather 'report' clearly and concisely to the user. \"\n               \"Only use the tool when a city is mentioned for a weather request.\",\n   tools=[get_weather],\n\n\n)\n\nprint(f\"Agent '{weather_agent.name}' created using model '{AGENT_MODEL}'.\")<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-4-set-up-runner-and-session-service\">Step 4: Set up Runner and Session Service<\/h3>\n<p>To handle conversations and run the agent effectively, we need two key components:<\/p>\n<p><b>SessionService<\/b>: This component keeps track of each user\u2019s conversation history and session state. A basic version called <i>InMemorySessionService<\/i> stores all data in memory, making it ideal for testing or lightweight apps. It logs every message exchanged in a session. We\u2019ll dive into saving session data permanently.<\/p>\n<p><b>Runner<\/b>: This acts as the brain of the system. It manages the entire interaction flow, taking in user input, passing it to the right agent, calling the LLM and any necessary tools, updating session data through the <i>SessionService<\/i>, and producing a stream of events that show what\u2019s happening during the interaction.<\/p>\n<p>\u00a0<b>Code:<\/b>\u00a0<\/p>\n<pre class=\"wp-block-code\"><code># @title Setup Session Service and Runner\n# ---Session Management ---\n# Key Concept: SessionService stores conversation history &amp; state.\n# InMemorySessionService is a simple, non-persistent storage for this tutorial.\n\n\nsession_service=InMemorySessionService()\n\n\n# Define constants for identifying the interaction context\nAPP_NAME=\"weathertutorial_app\"\nUSER_ID=\"user_1\"\nSESSION_ID=\"session_001\"\n\n\n# Create the specific session where the conversation will happen\nsession=session_service.create_session(\n   app_name=APP_NAME,\n   user_id=USER_ID,\n   session_id=SESSION_ID,\n)\n\n\nprint(f\"Session created: App='{APP_NAME}', User=\"{USER_ID}\", Session='{SESSION_ID}'\")\n\n\n# ---Runner ---\n# Key Concept: Runner orchestrates the agent execution loop.\n\n\nrunner=Runner(\n   agent=weather_agent,\n   app_name=APP_NAME,\n   session_service=session_service\n)\n\n\nprint(f\"Runner created for agent '{runner.agent.name}'.\")\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-5-interact-with-the-agent\">Step 5: Interact with the Agent<\/h3>\n<p>We\u2019ll use ADK\u2019s asynchronous Runner to talk to our agent and get its response. Since <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/03\/an-introduction-to-large-language-models-llms\/\">LLM<\/a> and tool calls can take time, handling them asynchronously ensures a smooth, non-blocking experience.<\/p>\n<p>We\u2019ll create a helper function called <i>call_agent_async<\/i> that does the following:<\/p>\n<ul class=\"wp-block-list\">\n<li>Accepts a user query as input<\/li>\n<li>Wraps it in ADK\u2019s required Content format<\/li>\n<li>Calls <i>runner.run_async()<\/i> with the session and message<\/li>\n<li>Iterates through the <i>Event stream<\/i> ADK returns these events and tracks each step (tool call, response, etc.).<\/li>\n<li>Detects and prints the final response using <i>event.is_final_response()<\/i><\/li>\n<\/ul>\n<p>\u00a0<b>Code:<\/b><\/p>\n<pre class=\"wp-block-code\"><code># @title Define Agent Interaction Function\nimport asyncio\nfrom google.genai import types # For creating message Content\/Parts\n\n\nasync def call_agent_async(query: str):\n \"\"\"Sends a query to the agent and prints the final response.\"\"\"\n print(f\"\\n&gt;&gt;&gt; User Query: {query}\")\n\n\n # Prepare the user's message in ADK format\n content = types.Content(role=\"user\", parts=[types.Part(text=query)])\n\n\n final_response_text = \"Agent did not produce a final response.\" # Default\n\n\n # Key Concept: run_async executes the agent logic and yields Events.\n # We iterate through events to find the final answer.\n async for event in runner.run_async(user_id=USER_ID, session_id=SESSION_ID, new_message=content):\n     # You can uncomment the line below to see *all* events during execution\n     # print(f\"  [Event] Author: {event.author}, Type: {type(event).__name__}, Final: {event.is_final_response()}, Content: {event.content}\")\n\n\n     # Key Concept: is_final_response() marks the concluding message for the turn.\n     if event.is_final_response():\n         if event.content and event.content.parts:\n            # Assuming text response in the first part\n            final_response_text = event.content.parts[0].text\n         elif event.actions and event.actions.escalate: # Handle potential errors\/escalations\n            final_response_text = f\"Agent escalated: {event.error_message or 'No specific message.'}\"\n         # Add more checks here if needed (e.g., specific error codes)\n         break # Stop processing events once the final response is found\n\n\n print(f\"<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-6-run-the-conversation\">Step 6: Run the Conversation<\/h3>\n<p>Now that everything\u2019s set up, it\u2019s time to put our agent to the test by sending a few sample queries.<\/p>\n<p>We\u2019ll:<\/p>\n<ul class=\"wp-block-list\">\n<li>Wrap the <i>async<\/i> calls inside a <i>main()<\/i> coroutine<\/li>\n<li>Use <i>await<\/i> to run the function.<\/li>\n<\/ul>\n<p>What to Expect:<\/p>\n<ul class=\"wp-block-list\">\n<li>The user queries will be printed<\/li>\n<li>When the agent uses a tool (like get_weather), you\u2019ll see logs like:<br \/><i>\u2014 Tool: get_weather called\u2026 \u2014<\/i><\/li>\n<li>The agent will return a final response, even gracefully handling cases where data isn\u2019t available (e.g., for \u201cParis\u201d)<\/li>\n<\/ul>\n<p><b>Code:<\/b><\/p>\n<pre class=\"wp-block-code\"><code># @title Run the Initial Conversation\n\n\n# # We need an async function to await our interaction helper\n# async def run_conversation():\n#     await call_agent_async(\"What is the weather like in Mumbai\")\n#     await call_agent_async(\"How about Delhi?\") # Expecting the tool's error message\n#     await call_agent_async(\"Tell me the weather in CHennai\")\n\n\n# Execute the conversation using await in an async context (like Colab\/Jupyter)\nawait run_conversation()<\/code><\/pre>\n<p>\u00a0<b>Output:<\/b><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"297\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/ss.webp\" alt=\"Building Agents Output\" class=\"wp-image-232045\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/ss.webp 830w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/ss-300x107.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/ss-768x275.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/04\/ss-150x54.webp 150w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\"\/><\/figure>\n<\/div>\n<p>Also Read: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/open-ai-responses-api\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Use OpenAI\u2019s Responses API &amp; Agent SDK?<\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><b>Conclusion<\/b><\/h2>\n<p>Google\u2019s Agent Development Kit (ADK) allows developers to create intelligent, multi-agent systems that go beyond simple text generation. By building a weather bot, we learned key ADK concepts such as tool integration, agent orchestration, and session management, all while leveraging the power of Google\u2019s Gemini. From defining clear, descriptive docstrings for tools to orchestrating interactions through the Runner and SessionService, ADK provides the flexibility to build production-ready agents that can interact, learn, and adapt. Whether you\u2019re building chatbots, virtual assistants, or multi-agent ecosystems, ADK offers the tools to bring your vision to life.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"schema-faq wp-block-yoast-faq-block\">\n<div class=\"schema-faq-section\" id=\"faq-question-1745387581749\"><strong class=\"schema-faq-question\">Q1. What is Google\u2019s Agent Development Kit (ADK)?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Google ADK is an open-source, modular framework for building, orchestrating, and deploying AI-powered agents, including both simple bots and complex multi-agent systems. It is designed for flexibility, scalability, and integration with major LLMs and Google\u2019s AI ecosystem.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1745387590831\"><strong class=\"schema-faq-question\">\u00a0Q2. What makes ADK different from other agent frameworks?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. ADK is multi-agent by design, allowing you to compose agents in parallel, sequential, or hierarchical workflows. It\u2019s model-agnostic, supports real-time streaming (text, audio, video), and comes with built-in tools for debugging, evaluation, and deployment across environments.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1745387599177\"><strong class=\"schema-faq-question\">Q3. Which AI models does ADK support?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. While optimized for Google\u2019s Gemini models, ADK is model-flexible and can work with other popular LLMs such as GPT-4o, Claude, Mistral, and more, via integrations like LiteLLM.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1745387608893\"><strong class=\"schema-faq-question\">Q4. Can I use ADK for both conversational and non-conversational agents?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Yes, ADK is suitable for building both conversational agents (like chatbots) and non-conversational agents that handle complex workflows or automation tasks.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1745387616626\"><strong class=\"schema-faq-question\">Q5. How do I get started with ADK?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. You can install ADK using pip (pip install google-adk), set up your Google Cloud project (if needed), and quickly build your first agent using Python. ADK provides a CLI and a web UI for local development, testing, and debugging.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/jsoumil03267854504\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_reG34wL.webp\" width=\"48\" height=\"48\" alt=\"Soumil Jain\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Data Scientist | AWS Certified Solutions Architect | AI &amp; ML Innovator<\/p>\n<p>As a Data Scientist at Analytics Vidhya, I specialize in Machine Learning, Deep Learning, and AI-driven solutions, leveraging NLP, computer vision, and cloud technologies to build scalable applications.<\/p>\n<p>With a B.Tech in Computer Science (Data Science) from VIT and certifications like AWS Certified Solutions Architect and TensorFlow, my work spans Generative AI, Anomaly Detection, Fake News Detection, and Emotion Recognition. Passionate about innovation, I strive to develop intelligent systems that shape the future of AI.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Looking to build intelligent agents with real-world capabilities? Use Google ADK for building agents that can reason, delegate, and respond dynamically. This Google ADK tutorial walks you through the steps to build conversational agents with Google ADK across different language models like Gemini and GPT. Whether you\u2019re exploring Google ADK for AI agents or curious [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":202044,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[77537,11530,2539,1531],"dealstore":[],"offerexpiration":[],"class_list":["post-202043","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-adk","tag-agents","tag-building","tag-google"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Google ADK for Building Agents? - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=202043\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Google ADK for Building Agents? - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Looking to build intelligent agents with real-world capabilities? Use Google ADK for building agents that can reason, delegate, and respond dynamically. This Google ADK tutorial walks you through the steps to build conversational agents with Google ADK across different language models like Gemini and GPT. Whether you\u2019re exploring Google ADK for AI agents or curious [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=202043\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-24T05:04:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1118\" \/>\n\t<meta property=\"og:image:height\" content=\"582\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=202043#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"How to Use Google ADK for Building Agents?\",\"datePublished\":\"2025-04-24T05:04:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043\"},\"wordCount\":1475,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp\",\"keywords\":[\"ADK\",\"agents\",\"Building\",\"Google\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=202043#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=202043\",\"url\":\"https:\/\/fivemor.com\/?p=202043\",\"name\":\"How to Use Google ADK for Building Agents? - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp\",\"datePublished\":\"2025-04-24T05:04:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=202043#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=202043\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=202043#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp\",\"width\":1118,\"height\":582},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=202043#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Google ADK for Building Agents?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Google ADK for Building Agents? - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=202043","og_locale":"en_US","og_type":"article","og_title":"How to Use Google ADK for Building Agents? - Som2ny Network","og_description":"Looking to build intelligent agents with real-world capabilities? Use Google ADK for building agents that can reason, delegate, and respond dynamically. This Google ADK tutorial walks you through the steps to build conversational agents with Google ADK across different language models like Gemini and GPT. Whether you\u2019re exploring Google ADK for AI agents or curious [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=202043","og_site_name":"Som2ny Network","article_published_time":"2025-04-24T05:04:46+00:00","og_image":[{"width":1118,"height":582,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=202043#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=202043"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"How to Use Google ADK for Building Agents?","datePublished":"2025-04-24T05:04:46+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=202043"},"wordCount":1475,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=202043#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp","keywords":["ADK","agents","Building","Google"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=202043#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=202043","url":"https:\/\/fivemor.com\/?p=202043","name":"How to Use Google ADK for Building Agents? - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=202043#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=202043#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp","datePublished":"2025-04-24T05:04:46+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=202043#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=202043"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=202043#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/04\/Soumil-Galat-hai.webp.webp","width":1118,"height":582},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=202043#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"How to Use Google ADK for Building Agents?"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/202043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202043"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/202043\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/202044"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202043"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=202043"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=202043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}