tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK Basics - Building Your First Gemini Agent

ADK Basics - Building Your First Gemini Agent

Author: Venkata Sudhakar

The Google Agent Development Kit (ADK) is an open-source Python framework for building AI agents powered by Gemini. Introduced at Google Cloud NEXT 2025, ADK powers Google Agentspace and the Google Customer Engagement Suite. It simplifies agent development by providing a clean Agent class, automatic tool schema generation from Python docstrings, built-in session management, and a browser-based development UI for testing. Unlike writing raw LLM tool loops, ADK handles the reasoning-action-observation cycle automatically while keeping you in full control of what tools the agent can call and how it behaves.

An ADK agent needs just three things: a Gemini model name, an agent name, and a list of Python functions as tools. ADK reads the docstring and type hints of each function to automatically generate the tool JSON schema - no manual schema definition needed. Run the agent locally with runner.run() for programmatic use, or launch the interactive browser UI with "adk web" to test it conversationally. The runner manages session state, conversation history, and all tool calling automatically.

The below example builds a customer service agent for an electronics retailer that can check order status, verify product availability, and estimate delivery times - all called by the agent autonomously based on what the customer asks.


Running the agent with real customer queries,


It gives the following output showing the agent calling tools autonomously,

Q1: Where is my order ORD-88421?
A:  Great news! Your Samsung 4K TV (55-inch) from order ORD-88421 is currently
    out for delivery with Delhivery and is expected to arrive today by 7pm.
    You should receive an SMS notification when it is nearby!

Q2: Do you have iPhone 15 Pro in Bangalore?
A:  Yes! The iPhone 15 Pro is well stocked in Bangalore with 15 units currently
    available. You can visit our Bangalore store or order online for same-day
    or next-day delivery within the city.

Q3: I am at pincode 400001. How long for a 15kg washing machine?
A:  For delivery to pincode 400001 (Mumbai Metro zone), your washing machine
    will arrive in 1-2 business days. As it weighs 15kg, shipping cost is
    free (free delivery for items under 20kg in metro areas). Express delivery
    is also available if you need it sooner. Shall I help you place the order?

# ADK automatically decided which tool to call for each query
# No tool routing code written - the agent reasoned from the instruction
# Session state maintained - agent remembers context within a session

The ADK dev UI provides a chat interface to test your agent interactively before deployment,

INFO: Starting ADK web server on http://localhost:8000
INFO: Agent: shopmax_support
INFO: Tools registered: get_order_status, check_product_availability, estimate_delivery

# Open http://localhost:8000 in browser
# Type any customer question and see the agent reason and call tools live
# Tool call logs appear in the right panel for debugging

ADK agent design tips: write tool docstrings as if explaining to a smart new colleague - the agent reads them to decide which tool to call and what arguments to pass. Use specific parameter names and descriptions: "order_id: The 8-character order ID starting with ORD-" is far better than "order_id: string". Keep each tool focused on one operation - tools that do too many things confuse the agent. For production, add error handling and input validation inside each tool function before returning data - the agent will handle error responses gracefully and explain them to the user. Test your agent with ambiguous queries to find gaps in tool coverage before launch.


 
  


  
bl  br