langchain4j
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
What is langchain4j?
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 vector stores, and makes implementing tool calling (including MCP support), agents and RAG easy. It integrates seamlessly with enterprise Java frameworks like Quarkus and Spring Boot.
Overview of langchain4j
What it is
LangChain4j is an idiomatic, open-source Java library for building LLM-powered applications on the JVM. It provides a unified API over popular LLM providers and embedding (vector) stores, and supports tool calling (including MCP), agents, and RAG. The library integrates seamlessly with enterprise Java frameworks such as Quarkus, Spring Boot, Helidon, and Micronaut. It is not a port of the Python LangChain; it is designed from the ground up for Java with type safety, POJOs, annotations, interfaces, dependency injection, and fluent APIs.
Key features
- Unified API over 20+ LLM providers and 30+ embedding stores, enabling easy switching between them - Toolbox includes prompt templating, chat memory management, function calling, agents, and RAG - Supports tool calling including MCP (Model Context Protocol)
- Seamless integration with Quarkus, Spring Boot, Helidon, and Micronaut - Idiomatic Java design: type safety, POJOs, annotations, interfaces, dependency injection, fluent APIs - Numerous examples in plain Java, Quarkus, Spring Boot, Helidon, and Micronaut
Use cases
- Building LLM-powered applications on the JVM - Developing chatbots with chat memory and tool calling - Implementing RAG (Retrieval-Augmented Generation) pipelines from data ingestion to retrieval - Creating agents that use function calling and MCP - Experimenting with different LLM providers and embedding stores without rewriting code
Getting started
See the repository README for installation and quick-start instructions.
License and pricing
Licensed under Apache-2.0. The library is open source and free to use.
Based on the project's public README and repository metadata.