LangChain4j is an idiomatic, open-source Java library for building LLM-powered applications on the JVM. It offers a unified API over popular LLM providers and v
LangChain4j is an idiomatic, open-source Java library for building LLM-powered applications on the JVM. It offers a unified API over popular LLM providers and v
Welcome!
The goal of LangChain4j is to simplify integrating LLMs into Java applications.
Here's how:
LangChain4j began development in early 2023 amid the ChatGPT hype. We noticed a lack of Java counterparts to the numerous Python and JavaScript LLM libraries and frameworks, and we had to fix that!
Despite the name, LangChain4j is not a Java port of LangChain (Python) — it is built for Java, not ported to it. It is an idiomatic Java library designed from the ground up around Java conventions: type safety, POJOs, annotations, interfaces, dependency injection, fluent APIs, and first-class integrations with Quarkus, Spring Boot, Helidon, and Micronaut. Its API, internals, and release cycle are independent of the Python LangChain project.
We actively monitor community developments, aiming to quickly incorporate new techniques and integrations, ensuring you stay up-to-date. The library is under active development. While some features are still being worked on, the core functionality is in place, allowing you to start building LLM-powered apps now!
Documentation can be found here.
The documentation chatbot (experimental) can be found here.
Getting started guide can be found here.
Please see examples of how LangChain4j can be used in langchain4j-examples repo:
Useful materials can be found here.
Please use Discord or GitHub discussions to get help.
Please let us know what features you need by opening an issue.
Contribution guidelines can be found here.
[FEATURE] Update Apache Tika to version 4.0
[BUG] HierarchicalDocumentSplitter throws or emits an empty segment on a whitespace-only buffer
Dependency Dashboard
[BUG] `StreamableHttpMcpTransport` registers the client's reply to a server ping as a pending operation
[BUG] SupervisorPlanner NPE when the planning reply has no agentName
[FEATURE] ReRankingContentAggregator: add minResults to guarantee a minimum number of results when minScore filters out everything
[BUG] HierarchicalDocumentSplitter emits empty segments for whitespace-only buffers
[FEATURE] langchain cache feature
WatsonxChatModel: thinking() returns null with openai/gpt-oss-120b
Proposal: StructuredDecisionModel, an experimental abstraction for typed batch decisions