LangChain4j
An idiomatic, open-source Java library for building LLM-powered applications on the JVM, with a unified API over more than 20 model providers and more than 30 vector stores.
LangChain4j is an open-source Java library for building applications powered by large language models on the JVM. It offers a unified API over language-model providers, such as OpenAI and Google Vertex AI, and embedding stores, such as Pinecone and Milvus, so a project can switch between them without rewriting its own code, and currently supports more than 20 LLM providers and more than 30 embedding stores.
Its toolbox covers prompt templating, chat memory management and function calling, as well as higher-level patterns for agents and retrieval-augmented generation, with an interface and several ready-to-use implementations provided for each abstraction. Despite its name, it is not a Java port of the Python LangChain project: it is designed from the ground up around Java conventions such as type safety, plain objects, annotations, interfaces, dependency injection and fluent APIs, with first-class integration into frameworks including Quarkus, Spring Boot, Helidon and Micronaut, and its API and release cycle are independent of the Python project.
It began in early 2023 to fill a gap in Java tooling for large language models, and remains under active development.