docs/docs/intro.md
Welcome!
The goal of LangChain4j is to simplify integrating LLMs into Java applications.
Here's how:
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!
:::note Not a port of LangChain (Python) 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!
For easier integration, LangChain4j also includes integration with Quarkus, Spring Boot, Helidon and Micronaut
LangChain4j operates on two levels of abstraction:
UserMessage, AiMessage, EmbeddingStore, Embedding, etc.
These are the "primitives" of your LLM-powered application.
You have complete control over how to combine them, but you will need to write more glue code.LangChain4j features a modular design, comprising:
langchain4j-core module, which defines core abstractions (such as ChatModel and EmbeddingStore) and their APIs.langchain4j module, containing useful tools like document loaders, chat memory implementations as well as a high-level features like AI Services.langchain4j-{integration} modules, each providing integration with various LLM providers and embedding stores into LangChain4j.
You can use the langchain4j-{integration} modules independently. For additional features, simply import the main langchain4j dependency.You might ask why would I need all of this? Here are some examples:
LangChain4j maintains some integrations in community repo.
They support the same functionality as integrations in the main repository.
The only difference between them is that community has different artifact and package name from the main repo (i.e. the community prefix in artifact and package name).
The community was created to separate the maintenance of some integrations, thus making it easier to maintain the main repository.