SlideShare a Scribd company logo
Java and AI with
LangChain4j
Code the future with AI
Ed Burns @edburns.bsky.social
Principal Architect
https://aka.ms/edburns/jugdarmstadt2025
Ed Burns professional biography
 Client
 NCSA Mosaic (1994)
 SGI Cosmo Web Authoring
 Sun Netscape 6 OJI
 Server
 J2EE JSF (2002)
 Oracle Java EE
 Servlet, JSF, Bean Validation, etc.
 Cloud
 Java Champion
 Microsoft Azure Cloud (2019)
 Jakarta EE 11 committer and release coordinator
 Books
Change in content from posted agenda
 Still 100% Java and AI with LangChain4j.
 Removed content:
 After a brief look at the landscape.
 How you use it to perform the most popular AI usage pattern:
Retrieval Augmented Generation (RAG).
 Added content:
 langchain4j-microprofile-jakarta.
 If you want the RAG content, I recommend Easy RAG with
LangChain4J and Docker by Julien Dubois.
JUG Tour Around JavaLand 2025
Breaking Jakarta EE news
 Jakarta EE 11 Web Profile released this past Friday.
 https://github.com/jakartaee/specifications/pull/802
 https://deploy-preview-802--jakartaee-
specifications.netlify.app/specifications/webprofile/11/
 Many EE 12 component specifications in Plan Review stage.
 MicroProfile is discussing whether and how to host MicroProfile in
Jakarta EE.
 The need for a unified Config solution for EE 12.
 Coincidentally timed soon after Evolving our middleware strategy blog post
from Red Hat.
New to AI?
Don’t panic!
Ed’s fairly
obvious
observations
 Recognize the market
forces that have always
been in play.
 Vendors want adoption.
 They’ll make it easy to
adopt.
 This is also true with AI.
James Gosling: I realized if I wanted bankers to use automatic garbage collection, I
needed to give them curly braces rather than lots of irritating silly parentheses
(LISP).
AI related career advice
Everyone I know admits: AI is moving faster than
anything that has come before
https://aka.ms/DeveloperCareerMasterplan/slides https://aka.ms/RockStarProgrammerSecrets
Scott Hanselman: Let’s all just
chill
From a trust perspective
 Very important to keep the
“intelligence” in AI in
perspective.
 LLMs cannot answer simple
questions such as “Which
episode of Gilligan’s Island was
about mind reading?”
 The question that no LLM can answer and
why it is important
https://www.mindprison.cc/p/the-question-that-no-llm-can-answer
How to chill? Building some trust helps.
https://copilot.github.trust.page/faq
I’m worried that my code is sent to Microsoft to do
the suggestions. My concerns include:
• Can someone snoop on my code using a man-in-the-middle attack?
• My code is kept by Microsoft?
• My code is being used by Microsoft to train the model?
GitHub Copilot Trust Center
Can I keep my
code private?
Copilot data flow
Java meets AI
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Tell the LangChain4j origin story
Dmytro Liubarskyi
Components of LangChain4J
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Quick look at LangChain4j examples
 https://github.com/langchain4j/langchain4j-examples
Jakarta EE meets AI
smallrye-llm
langchain4j-
microprofile
-jakarta
Microprofile config
Microprofile Fault Tolerance Microprofile
OpenTelemetry
CDI
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Set up telling the value prop. A few
slides from now
Value proposition for Langchain4j-microprofile-jakarta
 Bring the value of open standards to the rapidly evolving world of
AI.
 AI-enable everything in Jakarta EE with all the power of LangChain4j.
 Without introducing any new AI standards.
 Builds on
 Jakarta Contexts and Dependency Injection
 MicroProfile Config
 MicroProfile Fault Tolerance
 MicroProfile Telemetry
 Delivered as Build Compatible CDI extension
Components of SmallRye LLM/LangChain4J Jakarta
1. AI Service Interface Processing:
o Detects interfaces annotated with @RegisterAIService
o Generates proxy implementations using LangChain4J
o Makes them available as CDI beans
2. Plugin Bean Creation:
o Reads configuration from properties with smallrye.llm.plugin.* prefix
o Creates beans for LangChain4J components (models, embedding stores)
o Makes these components available for injection
3. MicroProfile Config Integration:
o Translates properties to LangChain4J configuration
o Handles environment variable substitution (e.g., ${azure.openai.api.key})
4. Fault Tolerance:
o Provides integration with MicroProfile Fault Tolerance
o Adds resilience to AI service calls
5. Telemetry:
o Provides observability for AI service calls
o Integrates with OpenTelemetry
Some Code
CDI Injection
Injection.java
@Inject
@Named(value = "ollama")
ChatLanguageModel chatModel;
@Inject
@Named(value = "embedding-store-retriever")
ContentRetriever retriever;
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
AI Service
SimpleAIService.java
@RegisterAIService(chatLanguageModelName = "ollama", tools =
{org.wildfly.ai.websocket.Weather.class,org.wildfly.ai.websocket.Cal
culator.class}, scope = SessionScoped.class)
public interface SimpleAIService {
@SystemMessage("""
You are an AI named Bob answering general question.
Your response must be polite, use the same language
as the question, and be relevant to the question.""")
String chat(@UserMessage String question);
}
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
TokenStream instead of String
Demo
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Another approach, with MCP
But what is MCP?
But what is MCP?
https://modelcontextprotocol.io/
But what is MCP?
 https://github.com/modelcontextprotocol/servers
Demo
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
MCP
Server
MCP tools workflow
MCP
Server
Web
Application
LLM
MCP
Server
1
2 3
4
MCP
Server
5
6
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
MCP
Server
Database
Filesystem
Message queue
JavaFX
AI Service with MCP Tools
SimpleAIService.java
@RegisterAIService(streamingChatLanguageModelName= "streaming-
ollama", toolProviderName = "mcp")
public interface ChatAiService {
@SystemMessage("""
You are an AI named Bob answering general question.
Your response must be polite, use the same language
as the question, and be relevant to the question.""")
TokenStream streamingChat(@UserMessage String question);
}
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Demo
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Conclusion
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
What we saw
External configuration instead of code
CDI Injection
AI Service support
Cross-vendors: Micronaute, OpenLiberty, Quarkus, WildFly
Enterprise ready : OpenTelemetry / Fault Tolerance / MCP
Makes LangChain4J even easier to use !
Content from Emmanuel Hugonnet http://www.ehsavoie.com/
Resources
• LangChain4J:
o https://docs.langchain4j.dev/
• Model Context Protocol:
o https://spec.modelcontextprotocol.io/
• smallrye-llm: a cross vendor LangChain4J -CDI integration library
o https://github.com/smallrye/smallrye-llm
• WildFly AI Feature Pack:
o https://github.com/wildfly-extras/wildfly-ai-feature-pack
• WildFly MCP: to interact with WildFly servers through MCP
o https://github.com/wildfly-extras/wildfly-mcp
• Admin your WildFly with LLM and MCP
o https://www.youtube.com/watch?v=wg1hAdOoe2w
• Making WildFly Glow with Intelligence:
o https://www.wildfly.org/news/2025/02/10/Glowing-with-AI/
• Playing with Generative AI with WildFly:
o https://www.wildfly.org/news/2024/11/04/WildFly-playing-with-generative-ai/
Thank you
Ed Burns
@edburns on most of the things
• Please fill out this survey
• 5 winners will be chosen to win a $100 digital gift card
• https://aka.ms/edburns/survey2025
1.What is your key decision making process when it comes to app
modernization?
2.What’s your key challenge when modernizing your Java workload?
3.Are you a Java only shop or multiple language shop?
4.What is the tech stack/framework for your Java apps?
5.When migrating, what is your primary destination on cloud? What
platform are you choosing? VM? PaaS? Containers? Why?
6.How did you or your team make the above decisions?

More Related Content

PDF
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
 
PDF
Adobe Photoshop 2025 Free crack Download
toomjerry493
 
PDF
Java and AI with LangChain4j: Jakarta EE and SmallRye LLM
Edward Burns
 
PDF
Java and AI with LangChain4j: Integrating Jakarta EE and LLMs
Edward Burns
 
PDF
Building AI agents with Java and LangChain4j
Julien Dubois
 
PDF
Jakarta meets AI (JakartaEE One Livestream presentation)
Buhake Sindi
 
PDF
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
PDF
When GenAI meets with Java with Quarkus and langchain4j
Jean-Francois James
 
Java and AI with LangChain4j: Jakarta EE and AI
Edward Burns
 
Adobe Photoshop 2025 Free crack Download
toomjerry493
 
Java and AI with LangChain4j: Jakarta EE and SmallRye LLM
Edward Burns
 
Java and AI with LangChain4j: Integrating Jakarta EE and LLMs
Edward Burns
 
Building AI agents with Java and LangChain4j
Julien Dubois
 
Jakarta meets AI (JakartaEE One Livestream presentation)
Buhake Sindi
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
When GenAI meets with Java with Quarkus and langchain4j
Jean-Francois James
 

Similar to Java and AI with LangChain4j: Jakarta EE gets AI (20)

PDF
Reactive robotics io_t_2017
Trayan Iliev
 
PDF
Java Developers - What Lies Ahead in the AI era
Emily Jiang
 
PDF
Java Forum Nord - Hannover - The Trinity in GenAI - Spring AI, LangChain4J a...
Juarez Junior
 
PDF
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Trayan Iliev
 
PDF
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
PDF
Stream Processing with CompletableFuture and Flow in Java 9
Trayan Iliev
 
PPTX
Be faster then rabbits
Vladislav Bauer
 
PDF
Reactive Java Robotics IoT - jPrime 2016
Trayan Iliev
 
PDF
Hpc lunch and learn
John D Almon
 
PDF
Reactive Java Robotics & IoT with Spring Reactor
Trayan Iliev
 
PDF
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
JAXLondon2014
 
PDF
Real-Time AI Streaming - AI Max Princeton
Timothy Spann
 
PPTX
Architectures, Frameworks and Infrastructure
harendra_pathak
 
PPTX
REST::Neo4p - Talk @ DC Perl Mongers
Mark Jensen
 
PDF
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Arun Gupta
 
PPT
Open Programmable Architecture for Java-enabled Network Devices
Tal Lavian Ph.D.
 
PPT
Open programmable architecture for java enabled network devices
Tal Lavian Ph.D.
 
PPTX
Understanding Microservices
vguhesan
 
PDF
What need to be mastered as AI-Powered Java Developers
EmilyJiang23
 
PDF
Reactive Java Robotics and IoT 2016
ilievt
 
Reactive robotics io_t_2017
Trayan Iliev
 
Java Developers - What Lies Ahead in the AI era
Emily Jiang
 
Java Forum Nord - Hannover - The Trinity in GenAI - Spring AI, LangChain4J a...
Juarez Junior
 
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Trayan Iliev
 
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
Stream Processing with CompletableFuture and Flow in Java 9
Trayan Iliev
 
Be faster then rabbits
Vladislav Bauer
 
Reactive Java Robotics IoT - jPrime 2016
Trayan Iliev
 
Hpc lunch and learn
John D Almon
 
Reactive Java Robotics & IoT with Spring Reactor
Trayan Iliev
 
The Lazy Developer's Guide to Cloud Foundry - Holly Cummins
JAXLondon2014
 
Real-Time AI Streaming - AI Max Princeton
Timothy Spann
 
Architectures, Frameworks and Infrastructure
harendra_pathak
 
REST::Neo4p - Talk @ DC Perl Mongers
Mark Jensen
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Arun Gupta
 
Open Programmable Architecture for Java-enabled Network Devices
Tal Lavian Ph.D.
 
Open programmable architecture for java enabled network devices
Tal Lavian Ph.D.
 
Understanding Microservices
vguhesan
 
What need to be mastered as AI-Powered Java Developers
EmilyJiang23
 
Reactive Java Robotics and IoT 2016
ilievt
 
Ad

More from Edward Burns (20)

PDF
20250403-trusted-ai-favorite-ide-javaland.pdf
Edward Burns
 
PDF
A survey of cloud readiness for Jakarta EE 11
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PDF
How to get trusted AI in your favorite IDE
Edward Burns
 
PPTX
2024-09-10 Jacksonville JUG Java on Azure with AI
Edward Burns
 
PPTX
Deliver AI infused app innovation with Open Liberty on AKS
Edward Burns
 
PPTX
DevTalks Romania: Prepare for Jakarta EE 11
Edward Burns
 
PDF
Developer Career Masterplan
Edward Burns
 
PPTX
Jakarta EE 11 Status Update​
Edward Burns
 
PDF
Sponsored Session: Please touch that dial!
Edward Burns
 
PDF
How modernizing enterprise applications gives you a competitive advantage
Edward Burns
 
PDF
Wie Azure Jakarta EE Nutzt
Edward Burns
 
PDF
Practical lessons from customers performing digital transformation with Azure
Edward Burns
 
PDF
wls-azure-devnexus-2022.pdf
Edward Burns
 
PDF
Jakarta EE und Microprofile sind bei Azure zu Hause
Edward Burns
 
PDF
Java on Your Terms with Azure
Edward Burns
 
PDF
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
Edward Burns
 
PDF
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
Edward Burns
 
20250403-trusted-ai-favorite-ide-javaland.pdf
Edward Burns
 
A survey of cloud readiness for Jakarta EE 11
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
How to get trusted AI in your favorite IDE
Edward Burns
 
2024-09-10 Jacksonville JUG Java on Azure with AI
Edward Burns
 
Deliver AI infused app innovation with Open Liberty on AKS
Edward Burns
 
DevTalks Romania: Prepare for Jakarta EE 11
Edward Burns
 
Developer Career Masterplan
Edward Burns
 
Jakarta EE 11 Status Update​
Edward Burns
 
Sponsored Session: Please touch that dial!
Edward Burns
 
How modernizing enterprise applications gives you a competitive advantage
Edward Burns
 
Wie Azure Jakarta EE Nutzt
Edward Burns
 
Practical lessons from customers performing digital transformation with Azure
Edward Burns
 
wls-azure-devnexus-2022.pdf
Edward Burns
 
Jakarta EE und Microprofile sind bei Azure zu Hause
Edward Burns
 
Java on Your Terms with Azure
Edward Burns
 
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
Edward Burns
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
Edward Burns
 
Ad

Recently uploaded (20)

PPTX
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Become an Agentblazer Champion Challenge
Dele Amefo
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Presentation about variables and constant.pptx
kr2589474
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 

Java and AI with LangChain4j: Jakarta EE gets AI

  • 1. Java and AI with LangChain4j Code the future with AI Ed Burns @edburns.bsky.social Principal Architect https://aka.ms/edburns/jugdarmstadt2025
  • 2. Ed Burns professional biography  Client  NCSA Mosaic (1994)  SGI Cosmo Web Authoring  Sun Netscape 6 OJI  Server  J2EE JSF (2002)  Oracle Java EE  Servlet, JSF, Bean Validation, etc.  Cloud  Java Champion  Microsoft Azure Cloud (2019)  Jakarta EE 11 committer and release coordinator  Books
  • 3. Change in content from posted agenda  Still 100% Java and AI with LangChain4j.  Removed content:  After a brief look at the landscape.  How you use it to perform the most popular AI usage pattern: Retrieval Augmented Generation (RAG).  Added content:  langchain4j-microprofile-jakarta.  If you want the RAG content, I recommend Easy RAG with LangChain4J and Docker by Julien Dubois.
  • 4. JUG Tour Around JavaLand 2025
  • 5. Breaking Jakarta EE news  Jakarta EE 11 Web Profile released this past Friday.  https://github.com/jakartaee/specifications/pull/802  https://deploy-preview-802--jakartaee- specifications.netlify.app/specifications/webprofile/11/  Many EE 12 component specifications in Plan Review stage.  MicroProfile is discussing whether and how to host MicroProfile in Jakarta EE.  The need for a unified Config solution for EE 12.  Coincidentally timed soon after Evolving our middleware strategy blog post from Red Hat.
  • 8. Ed’s fairly obvious observations  Recognize the market forces that have always been in play.  Vendors want adoption.  They’ll make it easy to adopt.  This is also true with AI.
  • 9. James Gosling: I realized if I wanted bankers to use automatic garbage collection, I needed to give them curly braces rather than lots of irritating silly parentheses (LISP).
  • 11. Everyone I know admits: AI is moving faster than anything that has come before https://aka.ms/DeveloperCareerMasterplan/slides https://aka.ms/RockStarProgrammerSecrets
  • 12. Scott Hanselman: Let’s all just chill From a trust perspective  Very important to keep the “intelligence” in AI in perspective.  LLMs cannot answer simple questions such as “Which episode of Gilligan’s Island was about mind reading?”  The question that no LLM can answer and why it is important https://www.mindprison.cc/p/the-question-that-no-llm-can-answer
  • 13. How to chill? Building some trust helps.
  • 14. https://copilot.github.trust.page/faq I’m worried that my code is sent to Microsoft to do the suggestions. My concerns include: • Can someone snoop on my code using a man-in-the-middle attack? • My code is kept by Microsoft? • My code is being used by Microsoft to train the model? GitHub Copilot Trust Center Can I keep my code private?
  • 16. Java meets AI Content from Emmanuel Hugonnet http://www.ehsavoie.com/ Tell the LangChain4j origin story Dmytro Liubarskyi
  • 17. Components of LangChain4J Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 18. Quick look at LangChain4j examples  https://github.com/langchain4j/langchain4j-examples
  • 19. Jakarta EE meets AI smallrye-llm langchain4j- microprofile -jakarta Microprofile config Microprofile Fault Tolerance Microprofile OpenTelemetry CDI Content from Emmanuel Hugonnet http://www.ehsavoie.com/ Set up telling the value prop. A few slides from now
  • 20. Value proposition for Langchain4j-microprofile-jakarta  Bring the value of open standards to the rapidly evolving world of AI.  AI-enable everything in Jakarta EE with all the power of LangChain4j.  Without introducing any new AI standards.  Builds on  Jakarta Contexts and Dependency Injection  MicroProfile Config  MicroProfile Fault Tolerance  MicroProfile Telemetry  Delivered as Build Compatible CDI extension
  • 21. Components of SmallRye LLM/LangChain4J Jakarta 1. AI Service Interface Processing: o Detects interfaces annotated with @RegisterAIService o Generates proxy implementations using LangChain4J o Makes them available as CDI beans 2. Plugin Bean Creation: o Reads configuration from properties with smallrye.llm.plugin.* prefix o Creates beans for LangChain4J components (models, embedding stores) o Makes these components available for injection 3. MicroProfile Config Integration: o Translates properties to LangChain4J configuration o Handles environment variable substitution (e.g., ${azure.openai.api.key}) 4. Fault Tolerance: o Provides integration with MicroProfile Fault Tolerance o Adds resilience to AI service calls 5. Telemetry: o Provides observability for AI service calls o Integrates with OpenTelemetry
  • 23. CDI Injection Injection.java @Inject @Named(value = "ollama") ChatLanguageModel chatModel; @Inject @Named(value = "embedding-store-retriever") ContentRetriever retriever; Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 24. AI Service SimpleAIService.java @RegisterAIService(chatLanguageModelName = "ollama", tools = {org.wildfly.ai.websocket.Weather.class,org.wildfly.ai.websocket.Cal culator.class}, scope = SessionScoped.class) public interface SimpleAIService { @SystemMessage(""" You are an AI named Bob answering general question. Your response must be polite, use the same language as the question, and be relevant to the question.""") String chat(@UserMessage String question); } Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 26. Demo Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 28. But what is MCP?
  • 29. But what is MCP? https://modelcontextprotocol.io/
  • 30. But what is MCP?  https://github.com/modelcontextprotocol/servers
  • 31. Demo Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 32. MCP Server MCP tools workflow MCP Server Web Application LLM MCP Server 1 2 3 4 MCP Server 5 6 Content from Emmanuel Hugonnet http://www.ehsavoie.com/ MCP Server Database Filesystem Message queue JavaFX
  • 33. AI Service with MCP Tools SimpleAIService.java @RegisterAIService(streamingChatLanguageModelName= "streaming- ollama", toolProviderName = "mcp") public interface ChatAiService { @SystemMessage(""" You are an AI named Bob answering general question. Your response must be polite, use the same language as the question, and be relevant to the question.""") TokenStream streamingChat(@UserMessage String question); } Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 34. Demo Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 35. Conclusion Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 36. What we saw External configuration instead of code CDI Injection AI Service support Cross-vendors: Micronaute, OpenLiberty, Quarkus, WildFly Enterprise ready : OpenTelemetry / Fault Tolerance / MCP Makes LangChain4J even easier to use ! Content from Emmanuel Hugonnet http://www.ehsavoie.com/
  • 37. Resources • LangChain4J: o https://docs.langchain4j.dev/ • Model Context Protocol: o https://spec.modelcontextprotocol.io/ • smallrye-llm: a cross vendor LangChain4J -CDI integration library o https://github.com/smallrye/smallrye-llm • WildFly AI Feature Pack: o https://github.com/wildfly-extras/wildfly-ai-feature-pack • WildFly MCP: to interact with WildFly servers through MCP o https://github.com/wildfly-extras/wildfly-mcp • Admin your WildFly with LLM and MCP o https://www.youtube.com/watch?v=wg1hAdOoe2w • Making WildFly Glow with Intelligence: o https://www.wildfly.org/news/2025/02/10/Glowing-with-AI/ • Playing with Generative AI with WildFly: o https://www.wildfly.org/news/2024/11/04/WildFly-playing-with-generative-ai/
  • 38. Thank you Ed Burns @edburns on most of the things • Please fill out this survey • 5 winners will be chosen to win a $100 digital gift card • https://aka.ms/edburns/survey2025
  • 39. 1.What is your key decision making process when it comes to app modernization? 2.What’s your key challenge when modernizing your Java workload? 3.Are you a Java only shop or multiple language shop? 4.What is the tech stack/framework for your Java apps? 5.When migrating, what is your primary destination on cloud? What platform are you choosing? VM? PaaS? Containers? Why? 6.How did you or your team make the above decisions?