• About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
Wednesday, October 8, 2025
mGrowTech
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
No Result
View All Result
mGrowTech
No Result
View All Result
Home Google Marketing

ADK for Java opening up to third-party language models via LangChain4j integration

Josh by Josh
September 16, 2025
in Google Marketing
0
ADK for Java opening up to third-party language models via LangChain4j integration
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


adk-langchain4j-banner

The recent 0.2.0 release of Google’s Agent Development Kit (ADK) for Java adds an integration with the LangChain4j LLM framework. This integration provides developers with a wide range of Large Language Models (LLMs) supported by LangChain4j, for building AI agents.

In addition to ADK’s built-in Google Gemini and Anthropic Claude integrations, developers can now use LangChain4j to access other models from third-party providers (like OpenAI, Anthropic, GitHub, Mistral…) or local open-weight models, e.g. via Ollama or Docker Model Runner.

LangChain4j integration for a large choice of models

The LangChain4j LLM framework supports a wide variety of models. You can check the list of supported models in the LangChain4j documentation. Let’s have a look at a couple concrete examples, using Gemma with Docker Model Runner, and Ollama with Qwen.

When declaring your ADK agent with the LlmAgent builder, you specify the LLM via the model() builder method. You usually pass a string representing the name of the model, like “gemini-2.5-flash“.

It’s also possible to use an instance of a class extending the BaseLlm abstract class. This is exactly what the integration with LangChain4j does, to create a bridge between both frameworks. You have to use a new LangChain4j class that extends this BaseLlm class.

Running Gemma 3 with Docker Model Runner

After having installed and enabled Docker Model Runner on your machine, you can pull the Gemma 3 model easily via this command:

docker model pull ai/gemma3

Shell

As Docker Model Runner models exposes an OpenAI compatible API surface, you can use the LangChain4j module for OpenAI compatible models, by specifying the following dependencies in your Maven pom.xml:

<dependency>
    <groupId>com.google.adk</groupId>
    <artifactId>google-adk-contrib-langchain4j</artifactId>
    <version>0.2.0</version>
</dependency>
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-open-ai</artifactId>
    <version>1.4.0</version>
</dependency>

XML

Then, create a LangChain4j chat model, specifying the model you want to use, and the local URL and port:

OpenAiChatModel dmrChatModel = OpenAiChatModel.builder()
    .baseUrl("http://localhost:12434/engines/llama.cpp/v1")
    .modelName("ai/gemma3n")
    .build();

Java

Now, configure a chess coach agent using that model:

LlmAgent chessCoachAgent = LlmAgent.builder()
    .name("chess-coach")
    .description("Chess coach agent")
    .model(new LangChain4j(dmrChatModel))
    .instruction("""
        You are a knowledgeable chess coach
        who helps chess players train and sharpen their chess skills.
        """)
    .build();

Java

Notice how the bridge between the two frameworks is done via the model(new LangChain4j(dmrChatModel)) instruction. And here you go, your AI agent is powered by a local model!

Running Qwen 3 with Ollama

If instead you want to build a friendly science teacher agent with the Qwen 3 model running locally on your machine via Ollama, first, define our dependencies inside a Maven pom.xml build file:

<!-- the code ADK framework -->
<dependency>
    <groupId>com.google.adk</groupId>
    <artifactId>google-adk</artifactId>
    <version>0.2.0</version>
</dependency>
<!-- the LangChain4j integration -->
<dependency>
    <groupId>com.google.adk</groupId>
    <artifactId>google-adk-contrib-langchain4j</artifactId>
    <version>0.2.0</version>
</dependency>
<!-- the LangChain4j Ollama provider -->
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-ollama</artifactId>
    <version>1.4.0</version>
</dependency>

XML

Let’s assume you’ve already installed Ollama on your machine, you pulled the Qwen 3 model, and got it running on port 11434. With LangChain4j, in Java, you instantiate the Ollama model provider as follows:

OllamaChatModel ollamaChatModel = OllamaChatModel.builder()
    .modelName("qwen3:1.7b")
    .baseUrl("http://127.0.0.1:11434")
    .build();

Java

Now let’s wire this model into a simple science teacher agent:

LlmAgent scienceTeacherAgent = LlmAgent.builder()
    .name("science-app")
    .description("Science teacher agent")
    .model(new LangChain4j(ollamaChatModel))
    .instruction("""
        You are a helpful science teacher
        who explains science concepts to kids and teenagers.
        """)
    .build();

Java

If the model supports function calling, you can give your agent access to tools as well. For example, give it access to MCP servers, or your local code driven functions. You can explore the various tools at your disposal in this article diving into ADK tools, or by looking at the ADK documentation.

New Features in this Release

Beyond the headline LangChain4j integration, version 0.2.0 brings several other powerful enhancements to the agent development workflow:

  • Expanded Tooling Capabilities: We’ve significantly improved how you create and manage tools.
    • Instance-based FunctionTools: You can now create FunctionTools from object instances, not just static methods, offering greater flexibility in your agent’s architecture.
    • Improved Async Support: FunctionTools now support methods that return a Single. This improves asynchronous operation support and makes agents more responsive.
    • Better Loop Control: The new endInvocation field in Event Actions allows programmatic interruption or stopping of the agent loop after a tool call. This provides finer control over agent execution.
  • Advanced Agent Logic and Memory:
    • Chained Callbacks: We’ve added support for chained callbacks for before/after events on model, agent, and tool execution. This enables more complex and fine-grained logic within your agent’s lifecycle.
    • New Memory and Retrieval: This version introduces an InMemoryMemoryService for simple, fast memory management and implements VertexAiRagRetrieval using AI Platform APIs for more advanced RAG patterns.
  • Other key enhancements include a parent POM and the Maven Wrapper (./mvnw), ensuring a consistent and straightforward build process for all contributors.

Let’s put those AI agents to work

We’re thrilled to get this new version into your hands. The integration with LangChain4j marks a major step forward in making ADK for Java a more open and flexible framework for building powerful AI agents.

To learn more about this new version of ADK for Java, read the GitHub release notes. New to developing agents in Java with ADK? Check out the ADK for Java documentation, this getting started guide (and video), or fork this GitHub template project to begin quickly.

My colleague Michael Vorburger and myself have been happy to work on this LangChain4j integration, in collaboration with Dmytro Liubarskyi who created LangChain4j. So if you’re building AI agents in Java with ADK, don’t hesitate to drop us a message to @glaforge on Twitter/X or @glaforge.dev on Bluesky. We’re looking forward to hearing about your great use cases.



Source_link

READ ALSO

Big Tech is ‘donating’ to Trump’s ‘nonprofits’ 

Google AI Plus comes to 36 more countries around the world

Related Posts

Big Tech is ‘donating’ to Trump’s ‘nonprofits’ 
Google Marketing

Big Tech is ‘donating’ to Trump’s ‘nonprofits’ 

October 8, 2025
Google AI Plus comes to 36 more countries around the world
Google Marketing

Google AI Plus comes to 36 more countries around the world

October 8, 2025
Google plans to launch new smart displays
Google Marketing

Google plans to launch new smart displays

October 8, 2025
AI Mode in Google Search expands to more than 40 new areas
Google Marketing

AI Mode in Google Search expands to more than 40 new areas

October 7, 2025
The judge tasked with deciding Google’s fate would rather not
Google Marketing

The judge tasked with deciding Google’s fate would rather not

October 7, 2025
Building High-Performance Data Pipelines with Grain and ArrayRecord
Google Marketing

Building High-Performance Data Pipelines with Grain and ArrayRecord

October 7, 2025
Next Post
How It Secures Enterprise Data

How It Secures Enterprise Data

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

Communication Effectiveness Skills For Business Leaders

Communication Effectiveness Skills For Business Leaders

June 10, 2025
15 Trending Songs on TikTok in 2025 (+ How to Use Them)

15 Trending Songs on TikTok in 2025 (+ How to Use Them)

June 18, 2025
Trump ends trade talks with Canada over a digital services tax

Trump ends trade talks with Canada over a digital services tax

June 28, 2025
App Development Cost in Singapore: Pricing Breakdown & Insights

App Development Cost in Singapore: Pricing Breakdown & Insights

June 22, 2025
7 Best EOR Platforms for Software Companies in 2025

7 Best EOR Platforms for Software Companies in 2025

June 21, 2025

EDITOR'S PICK

Example – How to structure an AI for marketing governance policy

Example – How to structure an AI for marketing governance policy

September 9, 2025
Top CDC Officials Resign After Director Is Pushed Out

Top CDC Officials Resign After Director Is Pushed Out

August 28, 2025
Google’s $4.5 million commitment to LA small businesses

Google’s $4.5 million commitment to LA small businesses

August 16, 2025
Proven Tips to Grow Your Followers on Instagram Fast

Proven Tips to Grow Your Followers on Instagram Fast

June 3, 2025

About

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow us

Categories

  • Account Based Marketing
  • Ad Management
  • Al, Analytics and Automation
  • Brand Management
  • Channel Marketing
  • Digital Marketing
  • Direct Marketing
  • Event Management
  • Google Marketing
  • Marketing Attribution and Consulting
  • Marketing Automation
  • Mobile Marketing
  • PR Solutions
  • Social Media Management
  • Technology And Software
  • Uncategorized

Recent Posts

  • How To Create Engaging Content For Ski Resort Social Media Channels
  • Pinterest Board Strategy: How to Use Boards Effectively
  • The “Great Lock In” is Gen Z’s latest self-help trend
  • How Donors, Doers, Door Openers, and Dunbar’s Number Help Create Campaign Momentum
  • About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?