Spring AI vs LangChain4j vs SAA 三框架同台对比(配套篇2)
配套文章:篇2《Spring AI vs LangChain4j vs Spring AI Alibaba:2026 终极选型指南》
一个仓库跑通三个框架的最小可运行示例,用同一套场景对比代码量、配置方式与运行表现。
Step 能力 文件 --------- 1 最小可跑 ChatClient DemoApplication.java 2 ChatMemory 多轮对话 config/ChatConfig.java 3 Function Calling tools/OrderTools.java 4 MCP Client application.yml(注释段) 5 流式输出 SSE controller/AdvancedController.java
维度 最强 说明 --------- 模型集成数量 LangChain4j 30+ 模型开箱即用 向量库支持 LangChain4j 覆盖最广,差异 <10% MCP 支持 Spring AI 2.0 @McpTool 注解 47 行暴露 10 个方法 多 Agent 编排 Spring AI Alibaba Graph + Mermaid 可视化 可观测 Spring AI / SAA Micrometer + OTel 原生集成 中文社区 SAA 官方中文文档 + 国内生态最全
1. 别追 RC 版本——锁定 GA,Milestone/RC 的 API 可能突变 2. Spring AI 2.0 强制 JDK 21 + Spring Boot 4——老项目升级前先看本仓库 spring-ai-quickstart 的 pom 3. MCP 包名迁移:io.modelcontextprotocol. → org.springframework.ai.mcp. 4. LangChain4j 中文资料滞后官方 1–2 个月——以 GitHub README + Javadoc 为准 5. 国内合规:生产环境优先通义 / DeepSeek / 豆包,开源模型走 Ollama / vLLM
- [x] v0.1 三框架 hello world + docker-compose - [x] v0.2 spring-ai-quickstart 补齐 Step 2-5(记忆/工具/SSE) - [ ] v0.3 RAG 对比(同文档、同问题、三框架召回效果) - [ ] v0.4 多 Agent 编排对比 - [ ] v1.0 基准测试报告(压测 + Token 成本)
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/java-ai-in-action--framework-compare.html)
Lightweight browser-side AI agent framework for legacy enterprise web apps—Java 8, Spring Boot 2, TypeScript, MCP/WebMCP, OpenAI-compatible LLMs, tool calling, streaming, audit, and persistence. 面向存量企
ultramancode/spring-ai-privacy-guardrailsPrivacy guardrails for Spring AI: request-scoped PII tokenization and least-privilege disclosure across model/tool calls, with Presidio and JVM-local OpenNLP.
0xwilliamortiz/openclaude-improvedruns anywhere. uses anything
SysikNagibator/AiPCGive the agent "this" and he gets a real PC.
nettanvirdev/inertiainertia-ai: a desktop workspace for AI agents. Chat, built-in tools, MCP and OpenAPI integrations, Docker/Daytona sandboxes with a live desktop, routines and memory. Bring your own model and keys.
zouyuanqing/vision-primitives-mcpVision-primitives MCP server for text-only LLMs: describe, locate (coordinates), OCR with bbox, annotate, crop, zoom, automated anomaly scanning, computer use — powered by Xiaomi MiMo V2.5. Single-fil
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.