← all repositories
langchain4j/langchain4j

Java's LLM toolkit that isn't a Python port

LangChain4j gives JVM developers a native way to wire LLMs, vector stores, and RAG pipelines without leaving the ecosystem of POJOs and dependency injection.

langchain4j
Velocity · 7d
+8.6
★ / day
Trend
cooling
star history

What it does LangChain4j is a Java library for building LLM-powered applications on the JVM. It wraps 20+ LLM providers and 30+ vector stores behind a unified API, so swapping from OpenAI to Ollama or from Pinecone to pgvector doesn’t require rewriting integration code. The toolbox covers low-level pieces like prompt templating and chat memory up to higher-level patterns like agents and RAG pipelines.

The interesting bit The project deliberately rejects being a Java port of Python’s LangChain. It was built from scratch around Java conventions—type safety, annotations, fluent APIs, and first-class integrations with Quarkus, Spring Boot, Helidon, and Micronaut. That independence means its release cycle and internals aren’t tethered to a Python project moving at a different speed.

Key highlights

  • Supports 20+ LLM providers and 30+ embedding stores via pluggable integrations
  • Includes abstractions for tool calling with MCP support, agents, and full RAG pipelines
  • First-class integrations with major enterprise Java frameworks (Quarkus, Spring Boot, Helidon, Micronaut)
  • Active since early 2023 with a separate examples repo covering plain Java and framework-specific patterns
  • Experimental documentation chatbot at chat.langchain4j.dev

Caveats

  • Some features are still being worked on; the README notes the library is under active development
  • The documentation chatbot is marked experimental

Verdict Worth a look if you’re building LLM features in Java and want to stay idiomatic rather than bridging from Python. Less relevant if you’re already committed to Python/JS stacks or need a fully stabilized, feature-complete toolkit today.

Frequently asked

What is langchain4j/langchain4j?
LangChain4j gives JVM developers a native way to wire LLMs, vector stores, and RAG pipelines without leaving the ecosystem of POJOs and dependency injection.
Is langchain4j open source?
Yes — langchain4j/langchain4j is open source, released under the Apache-2.0 license.
What language is langchain4j written in?
langchain4j/langchain4j is primarily written in Java.
How popular is langchain4j?
langchain4j/langchain4j has 12.8k stars on GitHub and is currently cooling off.
Where can I find langchain4j?
langchain4j/langchain4j is on GitHub at https://github.com/langchain4j/langchain4j.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.