{"id":141485,"date":"2026-02-27T17:04:32","date_gmt":"2026-02-27T15:04:32","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=141485"},"modified":"2026-02-27T17:04:35","modified_gmt":"2026-02-27T15:04:35","slug":"google-agent-development-kit-java-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html","title":{"rendered":"Google Agent Development Kit Java Example"},"content":{"rendered":"<p>Building intelligent, tool-enabled AI systems in Java requires more than sending prompts to a language model. A well-structured implementation must manage user sessions, maintain context, integrate external tools, and coordinate execution clearly and reliably.<\/p>\n<p>This article explains how to build a Java-based AI agent using the Google Agent Development Kit (ADK) and the Gemini API. It demonstrates how to define an agent, register function tools, create and manage user sessions, and execute conversations through an in-memory runner. The example also shows how the agent can call external functions to retrieve dynamic data, making the solution practical and extensible.<\/p>\n<h2 class=\"wp-block-heading\">1. What Is the Agent Development Kit (ADK)?<\/h2>\n<p>The <a href=\"https:\/\/google.github.io\/adk-docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Agent Development Kit<\/a> (ADK) is an open-source, code-first framework for building, testing, and deploying AI agents and multi-agent systems. It provides a structured foundation for creating agents that can reason with large language models, interact with external tools, manage session state, and coordinate complex workflows.<\/p>\n<p>ADK includes:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>LlmAgent (Agent)<\/strong>: This is the reasoning engine of the system. It uses large language models such as Gemini to interpret input, generate responses, plan actions, and decide when to call tools.<\/li>\n<li><strong>Workflow agents<\/strong>: These are deterministic controllers that manage execution flow without using a language model. Examples include SequentialAgent, ParallelAgent, and LoopAgent.<\/li>\n<li><strong>Tools<\/strong>: Tools are standardized capabilities that allow agents to interact with external systems. A tool can be a Java method, a Python function, or an API call. They enable agents to retrieve live data, perform computations, or trigger external processes<\/li>\n<li><strong>Runner<\/strong>: The Runner acts as the orchestration engine. It coordinates communication between agents, user sessions, and tools, ensuring that each request is executed within the correct context.<\/li>\n<li><strong>Session management<\/strong>: ADK maintains conversational history and working memory during a session. This allows agents to preserve context across multiple interactions and respond consistently.<\/li>\n<li><strong>Streaming Support<\/strong>: Built-in support for bidirectional streaming enables real-time and multimodal interactions, including audio and video.<\/li>\n<li><strong>Development UI<\/strong>: A browser-based interface allows developers to inspect events, monitor state changes, and debug agent behavior in real time. <\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">2. Project Setup<\/h2>\n<p>To begin, create a standard Maven-based Java project. Then add the following dependencies to your <code>pom.xml<\/code> file:<\/p>\n<pre class=\"brush:xml\">\n    &lt;dependencies&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;com.google.adk&lt;\/groupId&gt;\n            &lt;artifactId&gt;google-adk&lt;\/artifactId&gt;\n            &lt;version&gt;0.5.0&lt;\/version&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;commons-logging&lt;\/groupId&gt;\n            &lt;artifactId&gt;commons-logging&lt;\/artifactId&gt;\n            &lt;version&gt;1.3.5&lt;\/version&gt; \n        &lt;\/dependency&gt;\n    &lt;\/dependencies&gt;\n<\/pre>\n<p>The <code>google-adk<\/code> dependency provides the core classes required to build and run agents. This includes components such as <code>LlmAgent<\/code>, workflow agents, tools, session management, and the runner that orchestrates execution. It contains the runtime functionality necessary to create and operate AI agents in a Java application.<\/p>\n<p>The <code>commons-logging<\/code> dependency provides a lightweight logging abstraction used internally by the framework. It ensures that logging output is handled correctly and can integrate with different logging implementations if needed.<\/p>\n<p><strong>Configuring Access to the LLM<\/strong><\/p>\n<p>Before running the application, you must configure authentication so the agent can connect to a Gemini model. The <code>LlmAgent<\/code> communicates with Google\u2019s Generative AI service, and this requires a valid API key. <\/p>\n<p>Set the following environment variables in your system:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:bash\">\nexport GEMINI_API_KEY=\nexport GOOGLE_GENAI_USE_VERTEXAI=FALSE\n<\/pre>\n<p>You can generate an API key from the <a href=\"https:\/\/console.cloud.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Cloud Console<\/a>. After creating the key, make sure the Gemini (Generative Language) API is enabled for your project. Once these environment variables are set and your project is properly configured, the agent will be able to connect to the LLM and process user requests successfully.<\/p>\n<h2 class=\"wp-block-heading\">3. Defining the LLM Agent<\/h2>\n<p>In this section, we build a Java agent that combines:<\/p>\n<ul class=\"wp-block-list\">\n<li>A <strong>root LLM agent<\/strong><\/li>\n<li>A <strong>custom tool<\/strong> that fetches a workout plan based on a given fitness focus area<\/li>\n<\/ul>\n<p>This demonstrates how to let an agent make decisions and call external services at runtime. <\/p>\n<p><strong>Agent Configuration<\/strong><\/p>\n<p>We start by creating a Java class that configures the AI agent and defines its core behavior. This includes setting the agent\u2019s purpose, selecting the language model it will use, and registering any tools it can access. In this example, the agent is designed to provide fitness guidance and is connected to an external tool that can fetch structured workout plans when needed.<\/p>\n<pre class=\"brush:java\">\npublic class FitnessAgent {\n\n    public static BaseAgent ROOT_AGENT = initializeAgent();\n\n    public static BaseAgent initializeAgent() {\n        ArrayList&lt;BaseTool&gt; tools = configureTools();\n\n        return LlmAgent.builder()\n                .name(\"fitness-user\")\n                .description(\"An AI agent that provides fitness guidance and workout recommendations.\")\n                .model(\"gemini-2.5-flash\")\n                .instruction(\"\"\"\n                    You assist users with fitness and health goals.\n                    You suggest workouts, explain exercises clearly,\n                    and use tools when you need up-to-date workout data.\n                \"\"\")\n                .tools(tools)\n                .build();\n    }\n\n    private static ArrayList&lt;BaseTool&gt; configureTools() {\n        ArrayList&lt;BaseTool&gt; list = new ArrayList&lt;&gt;();\n        list.add(WorkoutApiTool.create());\n        return list;\n    }\n}\n<\/pre>\n<p>This configuration class defines the core agent and its behavior. The <code>initializeAgent<\/code> method sets up a Gemini-based LLM agent with instructions describing how it should respond to user queries. The <code>configureTools<\/code> method adds the custom <code>WorkoutApiTool<\/code>, allowing the agent to fetch workout recommendations dynamically.<\/p>\n<p>The agent itself is created using the <code>LlmAgent.builder()<\/code> pattern. This builder configuration defines several important properties. The <code>name<\/code> identifies the agent internally. The <code>description<\/code> provides metadata explaining the agent\u2019s purpose. The <code>model<\/code> specifies which large language model the agent will use to generate responses\u2014in this case, a Gemini model. The <code>instruction<\/code> field defines the system-level guidance that controls how the agent behaves. These instructions shape the agent\u2019s tone, responsibilities, and decision-making process, including when it should use tools.<\/p>\n<p>The <code>.tools(tools)<\/code> method attaches the configured tools to the agent, enabling it to call external functions when required. Finally, the <code>.build()<\/code> method constructs and returns the fully configured agent instance.<\/p>\n<p><strong>Interactive Session Runner<\/strong><\/p>\n<p>The next step in building the agent is to provide a way for it to interact. In this section, we use the <code>InMemoryRunner<\/code> provided by ADK to create and manage sessions while handling user input through a command-line interface. The runner acts as the execution engine of the application. It initializes the agent, creates a session for a specific user, and continuously processes user input by sending it to the agent and returning the generated responses.<\/p>\n<pre class=\"brush:java\">\npublic class FitnessAdvisorAgentRunner {\n\n    private static final String USER_IDENTIFIER = \"fitness-session\";\n    private static final String SESSION_NAME = \"fitness-user\";\n\n    public static void main(String[] args) {\n        InMemoryRunner runner = new InMemoryRunner(FitnessAgent.ROOT_AGENT);\n\n        var session = runner.sessionService()\n                .createSession(SESSION_NAME, USER_IDENTIFIER)\n                .blockingGet();\n\n        String sessionId = session.id();\n\n        try (Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8)) {\n            while (true) {\n                System.out.print(\"\\nYou &gt; \");\n                String userInput = scanner.nextLine();\n                if (\"exit\".equalsIgnoreCase(userInput)) {\n                    break;\n                }\n\n                var userContent = Content.fromParts(Part.fromText(userInput));\n                Flowable&lt;Event&gt; events = runner.runAsync(USER_IDENTIFIER, sessionId, userContent);\n\n                System.out.print(\"\\nAgent &gt; \");\n                events.blockingForEach(event\n                        -&gt; System.out.println(event.stringifyContent()));\n            }\n        }\n    }\n}\n<\/pre>\n<p>The above class provides a command-line interface for interacting with the AI agent. It initializes an <code>InMemoryRunner<\/code> with the configured agent, creates a session for a specific user, and retrieves its session ID for maintaining context. Inside a loop, it reads user input, wraps it in a <code>Content<\/code> object, and sends it asynchronously to the agent using <code>runAsync<\/code>. The resulting events are processed and printed to the console, allowing real-time responses while preserving conversation state until the user exits.<\/p>\n<h2 class=\"wp-block-heading\">4. Custom External Tool<\/h2>\n<p>Tools allow the agent to access external data. The following tool simulates fetching workout plans from an external fitness service.<\/p>\n<pre class=\"brush:java\">\npublic class WorkoutApiTool {\n\n    @Schema(\n            name = \"fetchWorkoutPlan\",\n            description = \"Fetches a workout plan based on a given fitness focus area\"\n    )\n    public static Map&lt;String, Object&gt; fetchWorkoutPlan(String focusArea) {\n        \/\/ Simulated external API response\n        return Map.of(\n                \"focusArea\", focusArea,\n                \"workout\", \"3 sets of squats, push-ups, and planks\",\n                \"duration\", \"30 minutes\"\n        );\n    }\n\n    public static FunctionTool create() {\n        return FunctionTool.create(\n                WorkoutApiTool.class,\n                \"fetchWorkoutPlan\"\n        );\n    }\n}\n<\/pre>\n<p>This tool exposes a function (<code>fetchWorkoutPlan<\/code>) that the agent can call. The <code>@Schema<\/code> annotation describes the function so the agent understands when and how to use it. In a real system, this method could call an external <a href=\"https:\/\/www.javacodegeeks.com\/restful-services-with-hateoas-rest-apis-and-hypermedia-on-jvm.html\" target=\"_blank\" rel=\"noreferrer noopener\">REST API<\/a>; here, it returns mock data for clarity.<\/p>\n<h2 class=\"wp-block-heading\">5. Running the Application<\/h2>\n<p>Once all classes are in place, you can run the application locally.<\/p>\n<p><strong>Run the agent<\/strong><\/p>\n<pre class=\"brush:bash\">\nmvn compile exec:java -Dexec.mainClass=\"com.jcg.example.FitnessAdvisorAgentRunner\"\n<\/pre>\n<p>The application starts an interactive command-line session.<\/p>\n<p><strong>Sample Output<\/strong><\/p>\n<p>Below is an example of what interacting with the agent looks like:<\/p>\n<pre class=\"brush:bash\">\nYou &gt; Can you suggest a beginner workout plan for someone new to fitness?\n\nAgent &gt; Function Call: FunctionCall{id=Optional[adk-d84ca712-7c8e-4bfa-8a88-00d7f9dd6e43], args=Optional[{arg0=beginner}], name=Optional[fetchWorkoutPlan], partialArgs=Optional.empty, willContinue=Optional.empty}\nFunction Response: FunctionResponse{willContinue=Optional.empty, scheduling=Optional.empty, parts=Optional.empty, id=Optional[adk-d84ca712-7c8e-4bfa-8a88-00d7f9dd6e43], name=Optional[fetchWorkoutPlan], response=Optional[{workout=3 sets of squats, push-ups, and planks, duration=30 minutes, focusArea=beginner}]}\nHere's a beginner-friendly workout plan for you:\n\n**Workout Plan:**\n*   **Duration:** 30 minutes\n*   **Exercises:**\n    *   Squats: 3 sets\n    *   Push-ups: 3 sets\n    *   Planks: 3 sets\n\nRemember to focus on proper form for each exercise. If you're unsure about the form, there are many excellent resources online (videos, articles) that can guide you. Start with a weight or resistance level that allows you to complete each set with good form, and gradually increase as you get stronger.\n<\/pre>\n<p>When the user asks for a workout, the agent determines that external data is useful and calls the <code>fetchWorkoutPlan<\/code> tool. The response combines the tool output with natural language guidance, creating a helpful and conversational result.<\/p>\n<h2 class=\"wp-block-heading\">6. Conclusion<\/h2>\n<p>In this article, we explored how to build a Java-based AI agent using the Google Agent Development Kit (ADK). We covered setting up the project, defining the agent\u2019s behavior, connecting external tools for dynamic data retrieval, and handling user interactions through sessions using the <code>InMemoryRunner<\/code>. By following this approach, developers can create intelligent, context-aware agents capable of responding to user queries, executing tasks, and integrating with real-world data sources. This framework provides a structured, extensible foundation for building practical AI-driven applications in Java.<\/p>\n<h2 class=\"wp-block-heading\">7. Download the Source Code<\/h2>\n<p>This article explored the Google Agent Development Kit (ADK) for Java.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2026\/02\/fitness-agent.zip\"><strong>Java Google agent development kit<\/strong><\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Building intelligent, tool-enabled AI systems in Java requires more than sending prompts to a language model. A well-structured implementation must manage user sessions, maintain context, integrate external tools, and coordinate execution clearly and reliably. This article explains how to build a Java-based AI agent using the Google Agent Development Kit (ADK) and the Gemini API. &hellip;<\/p>\n","protected":false},"author":128888,"featured_media":127,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[5110,5147,5144,5145,5148,5146],"class_list":["post-141485","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-adk","tag-ai-multi-agent-systems","tag-gemini-api","tag-google-agent-development-kit","tag-java-ai-agents","tag-large-language-models-llms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Agent Development Kit Java Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Agent Development Kit Java Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/web.facebook.com\/omos.aziegbe\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-27T15:04:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-27T15:04:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Omozegie Aziegbe\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/OAziegbe\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Omozegie Aziegbe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html\"},\"author\":{\"name\":\"Omozegie Aziegbe\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7d3eac6e45542536e961129ae0fb453e\"},\"headline\":\"Google Agent Development Kit Java Example\",\"datePublished\":\"2026-02-27T15:04:32+00:00\",\"dateModified\":\"2026-02-27T15:04:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html\"},\"wordCount\":1199,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/google-logo.jpg\",\"keywords\":[\"ADK\",\"AI Multi-Agent Systems\",\"Gemini API\",\"Google Agent Development Kit\",\"Java AI Agents\",\"Large Language Models (LLMs)\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html\",\"name\":\"Google Agent Development Kit Java Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/google-logo.jpg\",\"datePublished\":\"2026-02-27T15:04:32+00:00\",\"dateModified\":\"2026-02-27T15:04:35+00:00\",\"description\":\"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/google-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/google-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/google-agent-development-kit-java-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Google Agent Development Kit Java Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/7d3eac6e45542536e961129ae0fb453e\",\"name\":\"Omozegie Aziegbe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/cropped-jcg_profile_pic-96x96.jpg\",\"caption\":\"Omozegie Aziegbe\"},\"description\":\"Omos Aziegbe is a technical writer and web\\\/application developer with a BSc in Computer Science and Software Engineering from the University of Bedfordshire. Specializing in Java enterprise applications with the Jakarta EE framework, Omos also works with HTML5, CSS, and JavaScript for web development. As a freelance web developer, Omos combines technical expertise with research and writing on topics such as software engineering, programming, web application development, computer science, and technology.\",\"sameAs\":[\"https:\\\/\\\/web.facebook.com\\\/omos.aziegbe\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/omosaziegbe\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/OAziegbe\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/omozegie-aziegbe\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Agent Development Kit Java Example - Java Code Geeks","description":"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.","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:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html","og_locale":"en_US","og_type":"article","og_title":"Google Agent Development Kit Java Example - Java Code Geeks","og_description":"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.","og_url":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/web.facebook.com\/omos.aziegbe","article_published_time":"2026-02-27T15:04:32+00:00","article_modified_time":"2026-02-27T15:04:35+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg","type":"image\/jpeg"}],"author":"Omozegie Aziegbe","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/OAziegbe","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Omozegie Aziegbe","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html"},"author":{"name":"Omozegie Aziegbe","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7d3eac6e45542536e961129ae0fb453e"},"headline":"Google Agent Development Kit Java Example","datePublished":"2026-02-27T15:04:32+00:00","dateModified":"2026-02-27T15:04:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html"},"wordCount":1199,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg","keywords":["ADK","AI Multi-Agent Systems","Gemini API","Google Agent Development Kit","Java AI Agents","Large Language Models (LLMs)"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html","url":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html","name":"Google Agent Development Kit Java Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg","datePublished":"2026-02-27T15:04:32+00:00","dateModified":"2026-02-27T15:04:35+00:00","description":"Learn how to build intelligent AI solutions in Java using tools, personas, and memory with the Google Agent Development Kit.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/google-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/google-agent-development-kit-java-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Google Agent Development Kit Java Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/7d3eac6e45542536e961129ae0fb453e","name":"Omozegie Aziegbe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2023\/12\/cropped-jcg_profile_pic-96x96.jpg","caption":"Omozegie Aziegbe"},"description":"Omos Aziegbe is a technical writer and web\/application developer with a BSc in Computer Science and Software Engineering from the University of Bedfordshire. Specializing in Java enterprise applications with the Jakarta EE framework, Omos also works with HTML5, CSS, and JavaScript for web development. As a freelance web developer, Omos combines technical expertise with research and writing on topics such as software engineering, programming, web application development, computer science, and technology.","sameAs":["https:\/\/web.facebook.com\/omos.aziegbe","https:\/\/www.linkedin.com\/in\/omosaziegbe\/","https:\/\/x.com\/https:\/\/twitter.com\/OAziegbe"],"url":"https:\/\/www.javacodegeeks.com\/author\/omozegie-aziegbe"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/141485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/128888"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=141485"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/141485\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/127"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=141485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=141485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=141485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}