LangChain4j: open-source Java library on the JVM
LangChain4j is an open-source Java library for building LLM-powered applications on the JVM; its goal is to simplify integrating LLMs into Java applications.
What it is · Main features · Getting started
What it is
LangChain4j is an open-source Java library for building LLM-powered applications on the JVM. The goal of LangChain4j is to simplify integrating LLMs into Java applications. Despite the name, LangChain4j is not a Java port of LangChain (Python); it is built for Java, not ported to it.
The API, internals, and release cycle of LangChain4j are independent of the Python LangChain project. LangChain4j is an idiomatic Java library designed from the ground up around Java conventions. These Java conventions include type safety, POJOs, annotations, interfaces, dependency injection, fluent APIs, and first-class integrations with Quarkus, Spring Boot, Helidon, and Micronaut.
LangChain4j began development in early 2023 amid the ChatGPT hype. The development team noticed a lack of Java counterparts to the numerous Python and JavaScript LLM libraries and frameworks. Since early 2023, the community has been building numerous LLM-powered applications, according to the project's own description of its background.
Core facts
Read by a script from the official API, not rewritten by a model.
- License
- Apache-2.0
- Languages
- Java
- Maintainer
- langchain4j
- Homepage
- https://docs.langchain4j.dev
- Verified
Main features
LangChain4j currently supports at least 20 popular LLM providers.
Beyond the LLM providers already mentioned, LangChain4j also currently supports at least 30 embedding stores, according to the project's own description.
The LangChain4j toolbox includes tools ranging from low-level prompt templating, chat memory management, and function calling.
For each abstraction, LangChain4j provides an interface along with multiple ready-to-use implementations based on common techniques.
Getting started
LangChain4j has documentation available.
A documentation chatbot is also available, and it is marked experimental.
A getting started guide is also available for LangChain4j.
The langchain4j-examples repo contains examples of how LangChain4j can be used.
These examples showcase how to begin creating various LLM-powered applications.
The example list includes examples in plain Java.
The example list includes an example with Spring Boot.
The Quarkus examples in the example list use the quarkus-langchain4j dependency.
In the example list, the Examples with Micronaut entry states that it uses the micronaut-langchain4j dependency.
In the example list, the Examples with Helidon entry states that it uses a Helidon integrations dependency for LangChain4j, as the list itself describes.
Useful materials are also available for LangChain4j.
Who it is for
The LangChain4j library is under active development. Some of its features are still being worked on. Contribution guidelines for the LangChain4j project can be found in the project's repository.
Sources
This page is written from the official sources below. Open them to check the original text.
- GitHub READMEhttps://github.com/langchain4j/langchain4jFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.