# 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.

Repository: https://github.com/langchain4j/langchain4j
Canonical: https://ross.abutalabs.com/products/langchain4j
Homepage: https://docs.langchain4j.dev
Language: Java
License: Apache-2.0
License Family: permissive
Topics: huggingface, java, langchain, openai, chatgpt, gpt, llama, milvus, pinecone, onnx, embeddings, vector-database, chroma, gemini, ollama, anthropic, openai-api, pgvector, llm, llms
Last push: 2026-08-26T15:57:54+00:00
Link (homepage): https://docs.langchain4j.dev
Link (site_page): https://docs.langchain4j.dev/category/integrations
Link (site_page): https://docs.langchain4j.dev/apidocs/index.html
Link (site_page): https://chat.langchain4j.dev/

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 98, longevity 83
- inputs: {"age_days": 1170, "days_push": 7, "days_rel": 19, "gap_med": 10, "n_releases_24m": 48}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 12959, forks 2502 (observed 2026-08-28T04:11:00.257769+00:00)

## What it is
LangChain4j is an open-source Java library for building LLM-powered applications on the JVM, providing a unified API over 20+ LLM providers and 40+ embedding/vector stores. It includes a toolbox spanning prompt templating, chat memory, tool calling (with MCP support), agents, and RAG pipelines, with integrations for Spring Boot, Quarkus, and Helidon.

## Use cases
- build a chatbot in Java with OpenAI or Anthropic
- implement RAG over documents in a Spring Boot app
- call LLMs from Java with a unified API
- let LLMs call Java methods via tool calling
- build AI agents on the JVM
- swap between vector stores like Pinecone and Milvus without rewriting code
- add MCP tool support to a Java application
- integrate embeddings and retrieval into Quarkus services

## When to choose
- you are building LLM applications in Java, Kotlin, or another JVM language
- you want provider-agnostic APIs to switch between LLMs and vector stores
- you need agents, RAG, or tool calling with Spring Boot or Quarkus integration
- you want MCP support and enterprise Java framework compatibility

## When to avoid
- your stack is Python, JavaScript, or another non-JVM language
- you need a ready-made end-user application rather than a library
- you want the original LangChain Python ecosystem and its tooling

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, rag, agent-framework, mcp, prompt-engineering, chatbot, sdk, nlp
- domain: large-language-models, chatbots, developer-tools, machine-learning
- platform: jvm, cross-platform
- tags: langchain, java, llm-integrations, vector-stores, tool-calling, spring-boot, quarkus, embeddings, ai-agents, retrieval-augmented-generation, spring

## Member repositories
- langchain4j/langchain4j (main) score 95
- langchain4j/langchain4j-examples (examples) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:00.257769+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:13:39.199194+00:00, confidence not recorded.
  - readme: https://github.com/langchain4j/langchain4j (fetched 2026-08-28T04:11:00.257769+00:00, sha 6acdf3195ee0)
  - homepage: https://docs.langchain4j.dev (fetched 2026-08-29T08:09:35.014095+00:00, sha 6931d8a5f0c7)
  - site_page: https://docs.langchain4j.dev/category/integrations (fetched 2026-08-29T08:09:35.022157+00:00, sha ffa547ef86bf)
  - site_page: https://docs.langchain4j.dev/apidocs/index.html (fetched 2026-08-29T08:09:35.024176+00:00, sha a929e87be21f)
  - site_page: https://chat.langchain4j.dev/ (fetched 2026-08-29T08:09:35.026377+00:00, sha 44136fa355b3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
