Go to file
Dmytro Liubarskyi 44db14bde7 fix: warn only about metadata values that actually differ
A shared metadata key is no longer reported as a conflict when the
document and the source hold equal values, since nothing observable is
discarded in that case. Conflicts are now collected and logged as a
single warning per document instead of one per key, which matters for
parsers that copy whole metadata dictionaries out of a file.

When two conflicting values render identically but differ in type, the
type is appended so the warning does not name two values that look the
same.
2026-07-31 11:51:28 +02:00
.devcontainer Update Dev Container support (#5489) 2026-06-19 10:14:43 +02:00
.github Update actions/checkout digest to 3d3c42e (#5854) 2026-07-30 10:37:45 +02:00
.idea FIX BUILD: Fix code coverage and some improvements (#2010) 2024-10-31 16:34:05 +01:00
.mvn chore(deps): update dependency maven to v3.9.15 (#4548) 2026-05-12 16:44:18 +02:00
code-execution-engines Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
docs Add `AnthropicBatchChatModel` for the Anthropic Message Batches API (#5875) 2026-07-30 11:47:48 +02:00
document-loaders fix: make metadata key collisions and skipped documents visible during document loading (#5542) 2026-07-31 11:06:19 +02:00
document-parsers Add Builder and configurable text extraction to DoclingDocumentParser (#5818) 2026-07-30 10:47:15 +02:00
document-transformers/langchain4j-document-transformer-jsoup Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
embedding-store-filter-parsers/langchain4j-embedding-store-filter-parser-sql Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
embeddings Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
experimental chore(deps): update dependency org.postgresql:postgresql to v42.7.12 [security] (#5833) 2026-07-23 17:40:20 +02:00
http-clients Disable Apache HttpClient's automatic retries by default in ApacheHttpClient (#5811) 2026-07-20 11:15:48 +02:00
integration-tests Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
internal fixing IT retries (because of Pinecone) 2026-07-27 10:03:52 +02:00
langchain4j fix: make metadata key collisions and skipped documents visible during document loading (#5542) 2026-07-31 11:06:19 +02:00
langchain4j-agentic Allow json deserialization of the AgenticScope only for known and registered classes (#5872) 2026-07-29 11:23:25 +02:00
langchain4j-agentic-a2a fix: Complete A2A response future when the stream ends without a result (#5850) 2026-07-27 09:37:39 +02:00
langchain4j-agentic-mcp Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-agentic-patterns Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-anthropic Add `AnthropicBatchChatModel` for the Anthropic Message Batches API (#5875) 2026-07-30 11:47:48 +02:00
langchain4j-azure-ai-search Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-azure-cosmos-mongo-vcore Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-azure-cosmos-nosql Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-azure-open-ai fix(deps): update dependency io.netty:netty-codec-http2 to v4.1.136.final [security] (#5831) 2026-07-27 10:26:27 +02:00
langchain4j-bedrock Redact sensitive AWS auth headers (Authorization, X-Amz-Security-Toke… (#5799) 2026-07-20 09:10:03 +02:00
langchain4j-bom Update milvus to V2 service & support hybrid search (#3311) 2026-07-20 18:03:29 +02:00
langchain4j-cassandra Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-chroma Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-cohere Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-coherence Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-core fix: warn only about metadata values that actually differ 2026-07-31 11:51:28 +02:00
langchain4j-couchbase Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-easy-rag Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-elasticsearch Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-github-models Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-google-ai-gemini fixing ITs 2026-07-27 09:55:47 +02:00
langchain4j-google-genai fix(google-genai): preserve declared property order in schemas (#5839) 2026-07-30 10:38:16 +02:00
langchain4j-gpu-llama3 Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-guardrails Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-hibernate fix(deps): update dependency org.postgresql:postgresql to v42.7.12 [security] (#5832) 2026-07-23 17:39:56 +02:00
langchain4j-http-client Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-hugging-face Migrate Cohere, HuggingFace, and Workers AI from Retrofit/OkHttp to the HttpClient abstraction (#5780) 2026-07-21 09:33:02 +02:00
langchain4j-infinispan Fixes Ickle injection issue (#5856) 2026-07-29 11:58:36 +02:00
langchain4j-jina Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-jlama Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-kotlin fix: make metadata key collisions and skipped documents visible during document loading (#5542) 2026-07-31 11:06:19 +02:00
langchain4j-local-ai Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-mariadb Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-mcp fix: tear down previous MCP connection on reconnect to avoid resource leak (#5757) 2026-07-21 10:26:34 +02:00
langchain4j-mcp-docker Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-micrometer-metrics Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-milvus Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-milvus-v2 Update milvus to V2 service & support hybrid search (#3311) 2026-07-20 18:03:29 +02:00
langchain4j-mistral-ai fix(mistral-ai): tolerate a plain-string "error" in batch result entries 2026-07-31 10:53:55 +02:00
langchain4j-mongodb-atlas Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-nomic Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-observation Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-ollama Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-onnx-scoring fix: support 3D logit output in OnnxScoringBertCrossEncoder (#5739) 2026-07-23 17:44:48 +02:00
langchain4j-open-ai fix: parse "reasoning" as an alias for "reasoning_content" in OpenAI chat responses (#5843) 2026-07-30 10:39:23 +02:00
langchain4j-open-ai-official Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-opensearch Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-oracle Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-ovh-ai Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-parent Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-pgvector fix(deps): update dependency org.postgresql:postgresql to v42.7.12 [security] (#5832) 2026-07-23 17:39:56 +02:00
langchain4j-pinecone Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-qdrant Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-skills fix: avoid NoSuchElementException in dynamic tool refresh on evicted user message (#5820) 2026-07-23 10:13:40 +02:00
langchain4j-tablestore test: fix swapped read/write method references in Tablestore metadata type guard message (#5611) 2026-07-23 17:43:04 +02:00
langchain4j-test Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-vertex-ai Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-vertex-ai-anthropic Handle the three distinct endpoint host formats depending on location type (#5869) 2026-07-30 10:02:54 +02:00
langchain4j-vertex-ai-gemini Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-vespa Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-voyage-ai Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-watsonx Update the watsonx.ai SDK to the latest version (#5710) 2026-07-20 09:04:53 +02:00
langchain4j-weaviate Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
langchain4j-workers-ai Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
web-search-engines Update versions to 1.19.0-SNAPSHOT and 1.19.0-beta29-SNAPSHOT 2026-07-17 13:42:56 +00:00
.editorconfig Input and output guardrails (#2571) 2025-06-17 11:49:54 +02:00
.gitattributes Added in-process embedding models (#41) 2023-07-23 19:05:13 +02:00
.gitignore feat(google-genai): introduce batch processing, grounding metadata, and image labels (#5255) 2026-06-05 16:20:37 +02:00
.prettierrc OpenAI DALL·E support (#298) 2023-12-19 11:37:11 +01:00
CODE_OF_CONDUCT.md Create a Code of Conduct (#825) 2024-04-18 14:34:30 +02:00
CONTRIBUTING.md EmbeddingModel: request/response API with per-call parameters, multimodal inputs, and observability (#5735) 2026-07-09 22:09:34 +02:00
LICENSE Initial commit 2023-06-20 17:30:29 +02:00
LOGO_LICENSE.md add logos and logo license (#3739) 2025-09-26 16:23:38 +02:00
Makefile Fix spotless plugin run on CI and in Makefile (#3127) 2025-06-03 09:36:47 +02:00
README.md doc: clarified relationship to Python LangChain 2026-04-17 10:24:57 +02:00
SECURITY.md Fix https://github.com/langchain4j/langchain4j/issues/4176 2025-12-04 12:13:51 +01:00
check-split-packages.sh Input and output guardrails (#2571) 2025-06-17 11:49:54 +02:00
detekt.yml #1897 Add Kotlin dependencies, plugins, and extensions (#2197) 2024-11-28 11:53:15 +01:00
mvnw chore(deps): update dependency maven-wrapper to v3.3.4 (#5169) 2026-05-12 12:19:20 +02:00
mvnw.cmd chore(deps): update dependency maven-wrapper to v3.3.4 (#5169) 2026-05-12 12:19:20 +02:00
pom.xml Update milvus to V2 service & support hybrid search (#3311) 2026-07-20 18:03:29 +02:00
renovate.json5 Run integration tests on PR and main only on JDK 21 (#3300) 2025-07-04 09:43:41 +02:00

README.md

LangChain4j: idiomatic, open-source Java library for building LLM-powered applications on the JVM

Build Status Nightly Build CODACY

Discord BlueSky X Maven Version

Introduction

Welcome!

The goal of LangChain4j is to simplify integrating LLMs into Java applications.

Here's how:

  1. Unified APIs: LLM providers (like OpenAI or Google Vertex AI) and embedding (vector) stores (such as Pinecone or Milvus) use proprietary APIs. LangChain4j offers a unified API to avoid the need for learning and implementing specific APIs for each of them. To experiment with different LLMs or embedding stores, you can easily switch between them without the need to rewrite your code. LangChain4j currently supports 20+ popular LLM providers and 30+ embedding stores.
  2. Comprehensive Toolbox: Since early 2023, the community has been building numerous LLM-powered applications, identifying common abstractions, patterns, and techniques. LangChain4j has refined these into practical code. Our toolbox includes tools ranging from low-level prompt templating, chat memory management, and function calling to high-level patterns like Agents and RAG. For each abstraction, we provide an interface along with multiple ready-to-use implementations based on common techniques. Whether you're building a chatbot or developing a RAG with a complete pipeline from data ingestion to retrieval, LangChain4j offers a wide variety of options.
  3. Numerous Examples: These examples showcase how to begin creating various LLM-powered applications, providing inspiration and enabling you to start building quickly.

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

Documentation can be found here.

The documentation chatbot (experimental) can be found here.

Getting Started

Getting started guide can be found here.

Code Examples

Please see examples of how LangChain4j can be used in langchain4j-examples repo:

Useful Materials

Useful materials can be found here.

Get Help

Please use Discord or GitHub discussions to get help.

Request Features

Please let us know what features you need by opening an issue.

Contribute

Contribution guidelines can be found here.