VOOZH about

URL: https://thenewstack.io/java-for-agentic-ai-app-development-what-you-need-to-know/

⇱ Using Java for Developing Agentic AI Apps - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-07-01 08:00:53
Using Java for Developing Agentic AI Apps
sponsor-red-hat,sponsored-post-contributed,
AI Agents / Java

Using Java for Developing Agentic AI Apps

Java is becoming an essential part of the agentic AI stack. Learn how to get started with tools like MCP, LangChain4j, Quarkus and OTel.
Jul 1st, 2025 8:00am by Daniel Oh
👁 Featued image for: Using Java for Developing Agentic AI Apps
Featured image by Wahyu Setyanto for Unsplash+.
Red Hat sponsored this post.

Over the past year, the software world has been reshaped by the rise of agentic AI — applications powered by intelligent, autonomous agents capable of decision-making, reasoning and long-running interaction loops. From Copilot to AI-native backends, this new class of software is rapidly becoming mainstream.

While much of the hype is centered around Python and JavaScript, a quiet revolution is unfolding in the Java ecosystem — one that enables Java developers to build scalable, production-grade agentic AI applications using familiar tools and powerful new libraries.

Suppose you’re a Java developer wondering how to participate in this shift without abandoning your stack. The good news is that Java is not only viable for agentic AI — it’s becoming an essential part of it.

In this article, I’ll explore:

  • Why Java is well-suited for agentic AI
  • What’s different about agentic applications
  • Key open source projects driving this transformation, including the Model Context Protocol (MCP), LangChain4j, Quarkus and OpenTelemetry (OTel)
  • A high-level view of how to get started

Why Java? Why Now?

Agentic AI apps are long-lived, stateful and often involve orchestration across APIs, large language models (LLMs), databases and user interaction. They require:

  • Strong concurrency for handling background jobs or long-running tasks
  • Robustness and observability in production
  • Security, performance and integration with enterprise systems

These are precisely the areas where Java excels. Modern Java, with its evolving JDK features (e.g., virtual threads), cloud native frameworks and mature tooling, can build fast, maintainable and secure AI-native software.

More importantly, enterprise organizations already run massive systems in Java. With agentic AI poised to augment or embed into existing platforms, staying within the Java ecosystem reduces the integration friction. Java developers don’t need to reinvent the wheel; they just need new components to plug into their established development flow.

What Makes Agentic AI Apps Different?

Before diving into tools, it’s important to understand how agentic AI apps differ from traditional web or mobile apps. Agentic AI systems distinguish themselves by being fundamentally goal-driven rather than merely responding to individual requests. They are designed to maintain an internal state and memory, allowing them to track progress and context over extended periods. Their operation is characterized by sophisticated reasoning and planning capabilities, moving beyond simple reactive logic. These systems frequently integrate language models to inform their decision-making processes, enabling more nuanced and intelligent actions.

Furthermore, their interactions unfold through multistep workflows, which often incorporate the use of various tools and the crucial element of human feedback to refine their performance. This means your app isn’t just serving content — it’s thinking, planning and interacting continuously. This shift calls for new abstractions and runtime patterns, many of which are now emerging in the Java ecosystem.

The Tech Stack: MCP, LangChain4j, Quarkus and OpenTelemtery

Several open source projects are laying the foundation for Java-based agentic AI. Here’s a look at four key players:

1. MCP: Agentic Runtime for LLM Apps

MCP is an emerging open source project from the AI-native app community, offering a runtime specifically designed for agentic computation. Its core focus is on enabling the creation of LLM applications that are persistent, composable and easily inspectable.

With MCP, developers gain the ability to build long-lived agents that come equipped with versioned memory and clearly defined goals. The project also allows for the precise definition of tools and actions using structured formats. Furthermore, MCP leverages event sourcing, which provides comprehensive traceability for application operations. Finally, it supports the deployment of these applications across various environments, ranging from local development setups to robust cloud infrastructure.

MCP complements LangChain4j by offering an opinionated execution environment, storage layer and life cycle management for agentic workloads. Think of MCP as the “operating system” for agent-based applications — useful for teams that need repeatability, observability and scale.

2. LangChain4j: Language Model Orchestration for Java

Inspired by the original LangChain project in Python, LangChain4j brings LLM orchestration primitives to Java. It abstracts over LLMs and provides essential building blocks. These building blocks facilitate agent and tool creation, enable effective memory management, offer robust prompt templating capabilities, support sophisticated chain-of-thought reasoning and allow for LLM-based document retrieval.

LangChain4j supports major LLM providers like OpenAI, Azure, Cohere and local models through Ollama or Hugging Face. It’s designed for idiomatic Java development: strong typing, annotation-driven configuration and simple integration with dependency injection (DI) frameworks like Spring and Quarkus.

If you want to build agents that can think, plan and interact using natural language, LangChain4j is your go-to orchestration layer.

3. Quarkus: The Cloud Native Java Runtime

Quarkus is a Kubernetes-native Java framework optimized for containers, microservices and now AI workloads. With ultra-fast startup times, low memory usage and native compilation via GraalVM, Quarkus makes Java a great fit for deploying scalable AI agents.

Recent Quarkus extensions now provide robust support for several key areas. They enable LLM integration through powerful libraries such as LangChain4j. Additionally, these extensions facilitate reactive workflows and advanced event-driven programming. Developers can also benefit from features like live reload and Dev UI, which streamline the experimentation process with AI models. Finally, the extensions offer comprehensive container-native tooling, allowing efficient deployment and execution of agents on platforms like Kubernetes, Knative or Function as a Service (FaaS) environments.

Think of Quarkus as the “platform” on which your AI agents can live, scale and connect to the outside world.

4. OpenTelemetry: The Observability Framework

OpenTelemetry (OTel) offers significant benefits for observing agentic AI applications powered by LLMs, due to the inherent complexity and nondeterministic nature of these systems. Unlike traditional applications with predictable execution paths, AI agents often involve multistep, dynamic workflows, tool usage and iterative reasoning.

OTel’s tracing capabilities are particularly advantageous here, allowing developers to visualize the entire “thought process” and execution flow of an agent, tracking interactions between different modules, LLM calls, external API usage and even human feedback loops. This end-to-end visibility is crucial for debugging unexpected behaviors, identifying bottlenecks and understanding why an agent made a specific decision or failed to achieve a goal.

Furthermore, OTel’s standardized approach to collecting metrics and logs provides critical insights into the performance and cost of LLM interactions. Developers can capture specific metrics such as token usage, latency of LLM calls, error rates and resource consumption (e.g., GPU usage), which are vital for optimizing performance and operational expenses.

The vendor-agnostic nature of OTel ensures that, regardless of the specific LLM provider or observability backend chosen, the instrumentation remains consistent. This standardization is invaluable in the rapidly evolving AI landscape, preventing vendor lock-in and fostering interoperability across diverse frameworks and tools, ultimately enabling robust, production-grade observability for complex AI systems.

How It All Comes Together

Java isn’t the sole language for building AI agents, but it emerges as a strategic choice in scenarios where there is an existing investment in Java-based systems or a critical need for production-grade observability, robust threading capabilities and high performance. This includes regulated, high-compliance environments, especially when deploying agents at scale on platforms like Kubernetes or serverless architectures.

This is precisely how it all comes together: A Java-based agentic AI stack can leverage runtimes like Quarkus for cloud native microservices; utilize LangChain4j libraries for seamless LLM orchestration, memory management and complex operation chaining; and integrate into MCP for executing external tools autonomously to build agentic AI applications.

Quarkus LangChain4j integrations (extensions) also augment existing enterprise services (e.g., REST APIs, database transactions, event streaming) by infusing AI services, which enables a smooth transition from prototype to robust production deployment within the Java ecosystem. For observing these sophisticated AI-infused applications, OTel becomes invaluable; it provides the crucial framework for tracing the multistep, dynamic workflows of agents, capturing essential metrics on LLM interactions (like token usage and latency) and consolidating logs. This architecture offers unparalleled insight into the agent’s complex reasoning, tool utilization and overall performance, which is vital for debugging and optimizing such intelligent systems.

Ultimately, since agentic AI transcends mere sophisticated prompts, fundamentally involving the orchestration of real software around intelligent decisions, Java stands out as one of the premier tools for orchestrating these intricate software systems globally, making its capabilities for production-grade observability, enhanced by OTel, indispensable.

Final Thoughts

The future of software is agentic, and that future doesn’t belong to any one language. Java, with its unparalleled ecosystem and maturing AI libraries, is uniquely positioned to power the next generation of intelligent, autonomous applications.

If you’re a Java developer, now is the time to explore this shift. You already know the hard parts — concurrency, architecture and deployment. With tools like MCP, LangChain4j, Quarkus and OTel, the AI-native stack is becoming Java-native, too.

Agentic AI isn’t just for startups or researchers. It’s for everyone. And in Java, it’s already happening.

Red Hat OpenShift is for innovation without limitation. Bring big ideas to life with the hybrid cloud platform open to any app, team, or infrastructure.
Learn More
The latest from Red Hat
TRENDING STORIES
Daniel Oh is a Java Champion and Senior Principal Developer Advocate at Red Hat, where he leads efforts to advance cloud-native innovation through open-source technologies. Renowned for his ability to bridge technical and collaborative gaps, he empowers developers and organizations...
Read more from Daniel Oh
Red Hat sponsored this post.
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: OpenAI.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.