Examples
Sample applications demonstrating LangChain4j CDI with various Jakarta EE runtimes.
Examples
Articles and Presentations
| Resource | Description |
|---|---|
| WildFly AI Chat Bot Guide | Step-by-step guide for building an AI chat bot with WildFly and LangChain4j CDI |
| LangChain4j CDI Presentation (Fujitsu) | Presentation on LangChain4j and LangChain4j CDI by Fujitsu |
| Fujitsu LangChain4j CDI Samples | Sample applications demonstrating LangChain4j CDI usage by Fujitsu |
Workshops
Hands-on workshops to learn LangChain4j CDI step by step:
| Workshop | Description |
|---|---|
| Liberty LangChain4j Workshop | Open Liberty workshop for building AI-powered applications with LangChain4j |
| LangChain4j CDI Lab 2026 | Practical lab exercises covering LangChain4j CDI integration |
| LangChain4j CDI Lab 2026 (JCON Slovenia) | Practical lab exercises covering LangChain4j CDI integration (for JCON Slovenia 2026) |
Sample Applications
All examples demonstrate a car booking application with chat, fraud detection, and function calling.
Recommended: Quarkus
The fastest way to get started:
cd examples/quarkus-car-booking
mvn quarkus:dev
Startup time is around 10 seconds with live reload support.
Available Examples
| Example | Runtime | Extension Type |
|---|---|---|
quarkus-car-booking |
Quarkus | Build-compatible |
helidon-car-booking |
Helidon | Build-compatible |
helidon-car-booking-portable-ext |
Helidon | Portable |
wildfly-car-booking |
WildFly | Portable |
glassfish-car-booking |
GlassFish | Portable |
liberty-car-booking |
Open Liberty | Portable |
liberty-car-booking-mcp |
Open Liberty | Portable + MCP |
car-booking-mcp |
- | MCP server demo |
Running an Example
- Install all core modules first:
mvn clean install -DskipTests -pl '!examples/payara-car-booking'
- Navigate to the example directory and run:
cd examples/quarkus-car-booking
mvn quarkus:dev
-
Without an LLM provider (Ollama), endpoints return connection errors (expected behavior).
-
With Ollama, use the provided setup scripts in the examples directory.
MCP Server Example
The car-booking-mcp example demonstrates how to expose car booking operations as MCP tools:
cd examples/car-booking-mcp
mvn quarkus:dev
The MCP server is available at http://localhost:8080/mcp.
Liberty MCP Example
The liberty-car-booking-mcp example demonstrates MCP server integration with Open Liberty:
cd examples/liberty-car-booking-mcp
mvn liberty:dev