项目文件夹
## Issue Follow-up to #4426. Aligns the Azure DocumentDB documentation with the Spring Boot starters in langchain4j/langchain4j-spring#218. ## Change Documentation only (`docs/docs/integrations/embedding-stores/azure-documentdb.md`): - **Spring Boot client selection:** when `langchain4j.azure.documentdb.connection-string` is set, the store creates and owns its own client, even if a `MongoClient` bean exists. Otherwise it uses your `MongoClient` bean. The default client auto-configured by Spring Boot is never used. - **Spring Boot 3 default client:** Spring Boot 3 also creates an unused `localhost:27017` client because the MongoDB driver is on the classpath. The page shows how to exclude `MongoAutoConfiguration` when the application does not use MongoDB otherwise. - **Release state:** removed the "starters are not available yet, build snapshots locally" note and similar wording. - **Migration from the vCore starter:** - the legacy starter defaulted `kind` to `vector-ivf`, so users who never set it should set `kind=vector-ivf` to keep using their existing index; - the legacy default of 1536 dimensions no longer applies; - remove the legacy starter, otherwise two embedding store beans are registered. - **Similarity:** the store assumes an index created with cosine similarity; an existing index with another metric gives incorrect scores. - **Timeouts:** a client created from a connection string has no read timeout by default; the page shows adding `socketTimeoutMS` and `serverSelectionTimeoutMS` to the connection string. ## General checklist - [X] There are no breaking changes (API, behaviour) - [ ] I have added unit and/or integration tests for my change - [ ] The tests cover both positive and negative cases - [ ] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green - [ ] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green - [X] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs) - [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features) - [X] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable): langchain4j/langchain4j-spring#218
LangChain4j: idiomatic, open-source Java library for building LLM-powered applications on the JVM
Introduction
Welcome!
The goal of LangChain4j is to simplify integrating LLMs into Java applications.
Here's how:
- 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.
- 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.
- 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:
- Examples in plain Java
- Examples with Quarkus (uses quarkus-langchain4j dependency)
- Example with Spring Boot
- Examples with Helidon (uses io.helidon.integrations.langchain4j dependency)
- Examples with Micronaut (uses micronaut-langchain4j dependency)
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.