LangChain4jLangChain4j
LangChain4j 是 Java 生态的 LLM 应用框架:统一模型与向量库接口,支持工具调用与 MCP, 可嵌进 Quarkus、Spring Boot、Helidon 服务。
跨大类对照:vLLM。
A Java LLM application framework: unified model and vector-store interfaces, tool calling and MCP, embeddable in Quarkus, Spring Boot or Helidon services.
适合与不适合When to use it, when not to
适合:Java/Kotlin 团队、已有 Spring/Quarkus 服务、要把 LLM 与检索接进业务代码。 不适合:Python/TS 团队、要成品 agent、要可视化编排。
Fits Java/Kotlin teams with existing Spring/Quarkus services who want LLMs and vector retrieval inside business code. Does not fit Python/TS teams, turnkey agents, or visual orchestration.
中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-11-03
- 出品属地Origin
- 国外出品foreign-made LangChain4j 社区(开源)。LangChain4j community (open source).
- 国内使用Direct access
- 大陆可直连direct OK docs.langchain4j.dev 大陆直连未核验;Maven Central 可经镜像获取。Direct reachability from mainland not verified; Maven Central is available through mirrors.
- 备案状态CAC filing
- 未见于备案名单not in filing list:未见于网信办公示名单(2026-11-03 检索);开源库未面向大陆公众提供服务,备案不适用。Not in the CAC public registry (searched 2026-11-03); the open-source library does not serve the mainland public, so filing does not apply.
备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.
固定坐标系Fixed coordinate system
8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.
- 模型与开放条件Model & openness
Java 侧统一接口接多家 LLM 与向量库;官方文档列出主流商业与开源模型。 具体当前支持列表以官方文档为准,本站未逐条清点。
A unified Java interface over multiple LLMs and vector stores; the official docs list major commercial and open-source models. The current supported list follows official docs and is not enumerated here.
- 运行位置Where it runs
运行在你的 JVM 应用里;官方提供 Quarkus、Spring Boot 与 Helidon 集成, 可把 LLM 调用嵌进既有 Java 服务。
Runs inside your JVM application; the official docs offer Quarkus, Spring Boot and Helidon integrations so LLM calls sit inside existing Java services.
- 本地文件Local files
文件与向量库由应用侧管理;框架本身不托管数据,索引落盘位置由所选向量库决定, 检索链路不内置。
Files and vector stores are managed by the application; the framework hosts no data itself.
- 关机后的任务Tasks after shutdown
库形态,不内建任务队列;长任务由应用自己的线程池或消息队列实现, 中断后的恢复语义也由应用负责。
A library with no built-in task queue; long-running work uses the application's own threads or message queue.
- 工具与扩展Tools & extensions
支持工具调用(让 LLM 调 Java 方法)与 MCP 接入;细节以官方文档为准。
Supports tool calling (letting the LLM call Java methods) and MCP integration; details follow official docs.
- 上下文与记忆Context & memory
对话记忆与上下文由应用配置;框架提供 memory 抽象,持久化需自己接存储。
Conversation memory and context are configured by the application; the framework offers memory abstractions while persistence is yours to attach.
- 权限与限制Permissions & limits
JVM 进程内运行,权限由应用与部署环境决定;无内置多租户隔离, 鉴权、配额与数据访问边界需应用层自己实现。
Runs in-process on the JVM; permissions come from the application and deployment environment, with no built-in multi-tenant isolation.
- 适合什么任务Best for
适合:Java/Kotlin 团队、已有 Spring/Quarkus 服务、要把 LLM 与向量检索接进业务代码。 不适合:Python/TS 团队、要成品 agent、要开箱可视化编排。
Fits Java/Kotlin teams with existing Spring/Quarkus services who want LLMs and vector retrieval inside business code. Does not fit Python/TS teams, turnkey agents, or visual orchestration.
头号误解Top misconception
- 把 LangChain4j 当成 Python LangChain 的端口——它是 Java 生态的独立实现Treating LangChain4j as a port of Python LangChain — it is an independent Java implementation
- 以为框架自带向量库——向量库是独立依赖,要自己选Assuming the framework ships a vector store — vector stores are separate dependencies you choose
- 忽略 JVM 内存与线程模型——本地大模型不适合塞进同一个 JVMIgnoring JVM memory and threading — a local large model does not belong in the same JVM
未知项清单Known unknowns
- 当前支持的模型与向量库完整清单(未逐条清点)
- MCP 接入的官方支持细节
- 各版本与 Spring Boot/Quarkus 的兼容矩阵
- Full current list of supported models and vector stores (not enumerated here)
- Official details of MCP integration
- Compatibility matrix with Spring Boot/Quarkus per release
证据来源Evidence sources
判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-11-03,内容更新日content updated on 2026-11-03。
| 类型Type | 名称Name | 链接Link |
|---|---|---|
| docs | LangChain4j · 官方文档(Java 集成、Quarkus/Spring Boot/Helidon;2026-11-03 复核官方页)LangChain4j · official docs (Java integration, Quarkus/Spring Boot/Helidon) | https://docs.langchain4j.dev/ |
| repo | LangChain4j · GitHub 仓库LangChain4j · GitHub repository | https://github.com/langchain4j/langchain4j |
| changelog | LangChain4j · Releases(官方 changelog)LangChain4j · Releases (official changelog) | https://github.com/langchain4j/langchain4j/releases |
实测记录Measured runs
本档未跑集成与性能实测;结论只覆盖 API 与官方文档披露的能力面。
This site has not completed integration or performance tests; the conclusions cover the API and capabilities disclosed in official docs only.
相关条目Related entries
- Spring AISpring AISpring 官方路线,与 LangChain4j 的框架路线对照The Spring-official route, contrasting with LangChain4j's framework approach.
- LangChainLangChainPython 侧同类框架,接口与抽象不同A Python-side counterpart with different interfaces and abstractions.
- vLLMvLLM另一层 · 本地模型运行器Other layer · Local model runners
本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0).
方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.