framework-compare
Spring AI vs LangChain4j vs SAA 三框架同台对比(配套篇2)
Install / Use
claude mcp add java-ai-in-action -- npx -y github:java-ai-in-action/framework-compareIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of framework-compare
framework-compare scores 73/100 on our quality scale, 852nd of 942 AI & Machine Learning skills we index.
Its MCP Server is 3.0 KB long, well organised into 15 sections with 6 code examples: a solid amount of guidance for an agent.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 41 days ago, so framework-compare is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
framework-compare compared with similar skills
All 4 of these similar skills score higher than framework-compare; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| framework-compare (this skill)by java-ai-in-action | 73 | 10 | 41d ago | MCP Server |
| claude-memby thedotmack | 100 | 111.7k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 108.4k | 2d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.2k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.7k | today | CLAUDE.md |
Frequently asked questions
- How do I install framework-compare?
- Run
claude mcp add java-ai-in-action -- npx -y github:java-ai-in-action/framework-compare. The install tabs above show the steps for each supported agent. - Which AI agents does framework-compare work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is framework-compare safe to use?
- It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is framework-compare still maintained?
- The repository was last updated 41 days ago, so framework-compare is actively maintained.
Skill content
View source on GitHubframework-compare · 三大 Java AI 框架同台对比
配套文章:篇2《Spring AI vs LangChain4j vs Spring AI Alibaba:2026 终极选型指南》
一个仓库跑通三个框架的最小可运行示例,用同一套场景对比代码量、配置方式与运行表现。
📦 包含什么
framework-compare/
├── spring-ai-quickstart/ # Spring AI 2.0:Step 1-5 完整实现(10 行 Demo → 记忆 → 工具 → MCP → SSE)
├── langchain4j-quickstart/ # LangChain4j 1.20 最小可跑(AiService + @V 模板变量)
├── saa-quickstart/ # Spring AI Alibaba 1.0 最小可跑(百炼 starter)
├── benchmarks/ # 6 维度实测脚本(模型集成/向量库/MCP/Agent/可观测/社区)
└── docker-compose.yml # 一键起 pgvector + Qdrant + Redis 8
📄 spring-ai-quickstart 的 Step 对照(配套篇3)
| 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 |
细节见 spring-ai-quickstart/README.md。
🚀 快速开始
0. 起基础设施
docker-compose up -d
# 起 pgvector:5432 / qdrant:6333 / redis:6379
1. 配置模型 API Key(任选其一)
export OPENAI_API_KEY=sk-xxx # OpenAI 协议兼容(DeepSeek/通义均可)
export DEEPSEEK_API_KEY=sk-xxx # DeepSeek
export DASHSCOPE_API_KEY=sk-xxx # 阿里云百炼
2. 跑 Spring AI 2.0
cd spring-ai-quickstart
mvn spring-boot:run
curl "http://localhost:8080/chat?q=用一句话介绍Spring AI"
curl "http://localhost:8080/api/chat/tools?q=订单A12345到哪了" # Function Calling
curl -N "http://localhost:8080/api/chat/stream?q=写一首关于咖啡的四行诗" # SSE
3. 跑 LangChain4j 1.20
cd langchain4j-quickstart
mvn spring-boot:run
curl "http://localhost:8081/chat?q=用一句话介绍LangChain4j"
4. 跑 Spring AI Alibaba
cd saa-quickstart
mvn spring-boot:run
curl "http://localhost:8082/chat?q=用一句话介绍SAA"
📊 6 维度实测结论速览
| 维度 | 最强 | 说明 |
|---|---|---|
| 模型集成数量 | LangChain4j | 30+ 模型开箱即用 |
| 向量库支持 | LangChain4j | 覆盖最广,差异 <10% |
| MCP 支持 | Spring AI 2.0 | @McpTool 注解 47 行暴露 10 个方法 |
| 多 Agent 编排 | Spring AI Alibaba | Graph + Mermaid 可视化 |
| 可观测 | Spring AI / SAA | Micrometer + OTel 原生集成 |
| 中文社区 | SAA | 官方中文文档 + 国内生态最全 |
详细数据见 benchmarks/ 与文章。
⚠️ Known Pitfalls(踩坑清单)
- 别追 RC 版本——锁定 GA,Milestone/RC 的 API 可能突变
- Spring AI 2.0 强制 JDK 21 + Spring Boot 4——老项目升级前先看本仓库
spring-ai-quickstart的 pom - MCP 包名迁移:
io.modelcontextprotocol.*→org.springframework.ai.mcp.* - LangChain4j 中文资料滞后官方 1–2 个月——以 GitHub README + Javadoc 为准
- 国内合规:生产环境优先通义 / DeepSeek / 豆包,开源模型走 Ollama / vLLM
🗺️ Roadmap
- [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 成本)
License
MIT
📮 关注公众号「Java程序员面试宝典」
<img src="docs/wechat-qrcode.png" width="720" alt="扫码关注公众号:Java程序员面试宝典" />微信搜一搜「Java程序员面试宝典」,或直接扫码关注。
- 📖 「Java AI 实战派」系列 10 篇长文 —— 公众号首发,不定时更新
- 🧰 每篇都配可运行的开源仓库(这套系列一共 8 个仓库)
- 🕳️ 只讲踩过的坑,不讲空概念
这个仓库帮到你了吗?点个 ⭐ Star 支持一下,再去公众号坐坐 👆
Related Skills
claude-mem
111.7kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
108.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
90.2kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.7kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
