Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Seamlessly integrate AI services and your AI ag...

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Seamlessly integrate AI services and your AI agents using LangChain4J-CDI

Java isn't familiar with AI. Even better we've seen the adoption of AI in enterprise Java. LangChain4J has established itself as more or less the industry standard for integrating with AI in Java. Over time, we've realised that there should be a better solution to seamlessly integrate LangChain4J,

So, we introduced LangChain4J-CDI, a subproject of LangChain4J, which is an enterprise CDI extension for LangChain4J that provides seamless integration between LangChain4J and CDI. In this talk we'll introduce the power of LangChain4J, with the following features:
- Declaratively create your AI service that can simply be injected to your business service.
- Expose your CDI tools and registering it to your AI service.
- Expose your CDI tools with the built-in MCP server
- Declaratively create your AI orchestration using Agentic AI services that you can inject in your business service.
- Apply resiliency and observability of your AI service and AI Agents using Microprofile Fault Tolerance and Microprofile Telemetry respectively.

LangChain4J-CDI supports all Jakarta EE applicatoin servers, including Quarkus and Helidon. Powerful feature set with the vision of bringing AI to enterprise business services with a simple @Inject, the same way you would inject JPA's EntityManager in your business application.

Avatar for Buhake Sindi

Buhake Sindi

October 20, 2026

More Decks by Buhake Sindi

Other Decks in Technology

Transcript

  1. IO.println(“I’m Buhake Sindi”); • Enterprise solutions architect, consultant. • 20

    years of solid Java / Enterprise Java development experience. • Founded Devoxx4Kids South Africa (NPO) – introducing kids to coding, robotics, AI, etc., in a fun way. • Jozi JUG Organiser (monthly Java User Group Meetup in Johannesburg) • JakartaEE / Microprofile Working Group member. • Jakarta EE Ambassador. • Member of the JCP • Tech speaker • Blogger / Content writer • Langchain4J CDI committer. F ou n de r o f S i nd i T ec h no l og i es (P t y) Lt d & D e vo x x4 K id s S o ut h A fr i ca Monday, October 19, 2026 Who am I? 3
  2. Where to find me? X: @EliteGentleman Other socials: @buhake.sindi :

    [email protected] https://linktr.ee/theEliteGentleman F ou n de r o f S i nd i T ec h no l og i es (P t y) Lt d & D e vo x x4 K id s S o ut h A fr i ca Monday, October 19, 2026 Say hi! 4
  3. Since AI became mainstream • Generative AI (November 2022) •

    A model that generates content (text, audio, images, code, etc.) in response to a human prompt or question (prompt engineering) • AI agent (March 2023) • An automated model that uses memory and tool calling in order perform actions and generate responses based on user input. • Agentic AI workflows (December 2024) • An orchestrated system where one or more AI agents plan, remember context, make decisions and collaborates to autonomously execute complex, multiple-step goals. • Decision model (September 2026) • Monday, October 19, 2026 A lightweight, typesafe model that evaluates state against a predefined set of choices, score, yes/no options and returns a structured probabilities rather than generating texts. Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 5
  4. Java AI integration with LangChain4J • Generative AI • A

    unified API for LLM integration. Using AiServices factory, developers can create AI services and define its behaviour using Java interface. • AI agent • With comprehensive toolbox such as RAG, tool integration, memory, etc., an AI service is endowed with autonomy, reasoning, and toolaccess capabilities. • Agentic AI workflows • • Using langchain4j-agentic developers can orchestrate and build multi-agent workflows. Sequential, parallel, loop and conditional workflow. • Decision model • • Monday, October 19, 2026 A specialised model interface, DecisionModel, that evaluates an input against named, typed questions and returns structured answers with probabilities instead of free-form generated text. Decision Services provide a high-level, declarative, interface-driven wrapper around Decision Models. , specifically optimised for classification, gating, routing, and grading tasks. Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 6
  5. Example: Generative AI Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 7
  6. Example: AI Agent Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 8
  7. Example: AI Agent Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 9
  8. Example: Agentic AI Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 10
  9. LangChain4J Agentic • LangChain4J Agentic, a module for developers to

    build and orchestrate mult-agent AI systems. • Provides a set of abstractions and utilities to help you build agentic workflows and pure agentic AI applications, culminating in GOAP (Goal Oriented Action Planning) agentic system. • Features:  AgenticScope, a shared memory and context page where AI agents can write outputs, read required information and track invocation logs.  Support for agentic workflow patterns: sequential, parallel, loops, conditional  Agentic and non-AI patterns: Supervisor, Human-In-The-Loop • Docs: https://docs.langchain4j.dev/tutorials/agents/ Monday, 19 October 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 11
  10. Example: Agentic AI Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 12
  11. Example: Decision Model Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 13
  12. Example: Decision Model Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 14
  13. Question! How can we simplify integration of AI services for

    ease of reuse in your existing Java application? Can we make AI (agent) services injectable? Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 15
  14. @Inject AI Agents the Jakarta EE way - LangChain4J-CDI Monday,

    October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 16
  15. What is LangChain4J CDI? • A Jakarta EE with AI

    starter project. Initally called SmallRye-LLM.  Donated to LangChain4J and renamed as LangChain4J CDI. • CDI at its core. LangChain4J CDI was built with CDI registration and injection from the very start. • @Inject AI services or AI agents as beans. – The Jakarta EE way. • Various CDI stereotypes annotations are provided to register LangChain4J AI interfaces declaretively. • Use the standard @Inject annotation to bring your AI services & agents into your REST resource or other CDI beans. • Requirements: • Jakarta EE 10, and higher • JDK 17, and higher • Tested: Helidon, Quarkus, WildFly, Payara, OpenLiberty, GlassFish • GitHub: https://github.com/langchain4j/langchain4j-cdi Monday, 19 October 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 17
  16. Declarative Generative AI… Monday, October 19, 2026 Seamlessly integrate AI

    services and your AI agents using LangChain4J-CDI 18
  17. Configuration: Microprofile Config • No code – Just properties. •

    It’s 2026! Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 19
  18. AI agent with memory @MemoryId → one memory per session

    / user Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 20
  19. LangChain4J CDI Agentic • Langchain4J Agentic, with the power of

    CDI. • Declarative over imperative: compose multi-agents systems with annotation on interfaces instead of hand-written builder/orchestration code. • Portable across runtimes  Tested across the same application servers. Monday, 19 October 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 22
  20. One annotation per agentic topology SIMPLE SEQUENCE PARALLEL PARALLEL_MAPPER @RegisterSimpleAgent

    @RegisterSequenceAgent @RegisterParallelAgent @RegisterParallelMapperAgen t CONDITIONAL LOOP SUPERVISOR PLANNER @RegisterConditionalAgent @RegisterLoopAgent @RegisterSupervisorAgent @RegisterPlannerAgent HUMAN IN THE LOOP A2A MCP CLIENT 11 topologies total @RegisterHumanInTheLoopAgen t @RegisterA2AAgent @RegisterMcpClientAgent Simple → Sequence → Parallel → Conditional → Loop → Supervisor → Planner → HITL → A2A → MCP Each agentic topology has a dedicated CDI stereotype annotation - pick the pattern, annotate the interface, and LangChain4j CDI generates the implementation. Monday, 19 October 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 23
  21. More enterprise features please! - What about resiliency? - Can

    we add observability to our AI agent? Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 25
  22. Presentation Monday, 26 19 October Title 2026 Resiliency with MicroProfile

    Fault Tolerance • Apply any MP Fault Tolerance interceptor annotations (e.g., @Retry, @Fallback, @Timeout, etc.), the same way you would to existing CDI bean.
  23. Bring AI19 Monday, 27 and October build 2026 AI agents

    into your Jakarta EE application with LangChain4J CDI. Applying Observability with MicroProfile Telemetry • Can register either Span, Metrics, or both. • Each *ModelListener can be assigned via MP Config. • “lookup:@all” allows CDI to seek all Telemetry beans and register it to the *Model. • Alternatively, specify the full-qualified classname of either GenAISpan*ModelListener, GenAIMetrics*ModelListener, separated by a comma. • OpenTelemetry Semantic Convention for Generative AI Spans. • OpenTelemetry Semantic Convention for Generative AI Metrics.
  24. And many more! Now, includes MCP Server declaration. AI Agent

    with @RegisterAIService + McpToolProvider @RegisterA2AAgent, for Agent2Agent agent discovery. Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 28
  25. Getting started • Prod ready version: 1.5.1 • From Maven

    Central: • • Either langchain4j-cdi-portable-ext or langchain4j-cdi-build-compatible-ext • MicroProfile integrated modules: • • • • Monday, 19 October 2026 GroupId: dev.langchain4j.cdi GroupId: dev.langchain4j.cdi.mp Configurability: langchain4j-cdiconfig Resiliency: langchain4j-cdi-faulttolerance Observability: langchain4j-cditelemetry Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 29
  26. Finally… • Jakarta Agentic Artificial Intelligence: • Still under development,

    under the Eclipse Foundation. • The project provides a set of vendor-neutral APIs that make it easy, consistent, and reliable to build, deploy, and run AI agents on Jakarta EE runtimes. • Anybody can contribute to the development of the Jakara Agentic AI specifications. • More info: https://jakarta.ee/specifications/agenticai/ Monday, 19 October 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 30
  27. Resources Monday, 19 October 2026 • LangChain4J-CDI: • Official documentation:

    https://langchain4j.github.io/langchain4j-cdi/ • GitHub: https://github.com/langchain4j/langchain4j-cdi • Example: https://github.com/langchain4j/langchain4j-cdi/tree/main/examples • LangChain4J: • URL: https://docs.langchain4j.dev/ • GitHub: https://github.com/langchain4j/langchain4j • https://github.com/langchain4j/langchain4j • Liberty LangChain4J Workshop: https://openliberty.io/blog/2026/07/10/libertylangchain4j-workshop.html • Article: Build AI Apps and Agents in Java: Hands-on with LangChain4J (by Lize Raes): https://javapro.io/2025/04/23/build-ai-apps-and-agents-in-java-hands-onwith-langchain4j/ • Article: Bring AI into your Jakarta EE apps with LangChain4J -CDI (formerly SmallRye-LLMM): JavaPRO Magazine, 04-2025, Java 25 – Special Edition. Page, 96 (by Buhake Sindi). https://javapro.io/2025/10/28/04-2025-java-25-special-edition/ Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 31
  28. Questions? "Will AI replace Java developers?" No, but a Java

    developer with AI Will replace the one without. And with CDI, AI is just another @Inject. Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 33
  29. THANK YOU Any Questions? Buhake Sindi x: @EliteGentleman Other socials:

    @buhake.sindi https://linktr.ee/theEliteGentleman Monday, October 19, 2026 Seamlessly integrate AI services and your AI agents using LangChain4J-CDI 34