by 888newstep
企业级 AI Agent 平台 | Spring Boot 3 + LangChain4j | ReAct 推理 + 多路召回 RAG + 语义缓存 + 多智能体协作
# Add to your Claude Code skills
git clone https://github.com/888newstep/ai-agent-platformGuides for using ai agents skills like ai-agent-platform.
ai-agent-platform is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by 888newstep. 企业级 AI Agent 平台 | Spring Boot 3 + LangChain4j | ReAct 推理 + 多路召回 RAG + 语义缓存 + 多智能体协作. It has 54 GitHub stars.
ai-agent-platform's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/888newstep/ai-agent-platform" and add it to your Claude Code skills directory (see the Installation section above).
ai-agent-platform is primarily written in Java. It is open-source under 888newstep on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-agent-platform against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
基于 Spring Boot 3 + LangChain4j 构建的企业级 AI Agent 平台,集成 ReAct 推理循环、多路召回 RAG、语义缓存和工具调用框架。
mvn test / mvn verifytarget/site/jacoco/index.html/actuator/health, /actuator/metrics, /actuator/prometheusdocker compose up -d app prometheus grafanadocs/observability.md🎯 适用人群
- 正在准备大厂 Java / AI 岗位面试的求职者(覆盖高频面试考点)
- 需要快速搭建 AI 客服系统的中小企业或独立开发者
- 想学习 RAG + Agent 完整落地实践的技术爱好者
- 需要可扩展 AI Agent 框架的产品开发者
| 层级 | 技术 |
|---|---|
| 框架 | Spring Boot 3.5, LangChain4j 0.34 |
| 语言 | Java 17 |
| 数据库 | MySQL 8.0, Redis 7, Milvus 2.4 |
| AI 模型 | DeepSeek, 通义千问, 豆包, Qwen3-Flash, Ollama |
| 嵌入模型 | BGE-M3 (SiliconFlow API) |
| 部署 | Docker, Docker Compose |
| CI/CD | GitHub Actions |
git clone https://github.com/888newstep/ai-agent-platform.git
cd ai-agent-platform
cp .env.example .env
# 编辑 .env 填入你的 API 密钥
docker compose up -d
curl http://localhost:8081/api/v1/agent/health
# 返回: {"status":"UP","mode":"react"}
curl -X POST http://localhost:8081/api/v1/agent/session
curl -X POST "http://localhost:8081/api/v1/agent/chat?sessionId={sessionId}&question=你好&useRag=true"
curl -X POST "http://localhost:8081/api/v1/agent/react/chat?sessionId={sessionId}&question=查询数据库中的用户数量&useRag=true"
curl -N "http://localhost:8081/api/v1/agent/chat/stream?sessionId={sessionId}&question=请详细介绍RAG技术"
curl -X POST -F "file=@文档.pdf" http://localhost:8081/api/v1/agent/document/upload
┌─────────────────────────────────────────────────────────────┐
│ AI Agent Platform │
├─────────────────────────────────────────────────────────────┤
│ Controller Layer │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Chat API │ │ ReAct API │ │ Document API │ │
│ └──────┬───────┘ └──────┬───────┘ └────────┬─────────┘ │
├─────────┼────────────────┼──────────────────┼───────────────┤
│ Service Layer │ │ │
│ ┌──────┴────────┐ ┌─────┴──────┐ ┌────────┴──────────┐ │
│ │ AiAgentService│ │ ReActAgent │ │ DocumentService │ │
│ └──────┬────────┘ └─────┬──────┘ └────────┬──────────┘ │
│ │ │ │ │
│ ┌──────┴────────────────┴──────────────────┴──────────┐ │
│ │ SemanticCacheService │ │
│ └──────────────────────┬──────────────────────────────┘ │
├─────────────────────────┼──────────────────────────────────┤
│ Retrieval Layer │ │
│ ┌──────────────────────┴──────────────────────────────┐ │
│ │ MultiRecallService │ │
│ │ ┌────────────────┐ ┌──────────────────────────┐ │ │
│ │ │ Vector Search │ │ BM25 Keyword Search │ │ │
│ │ │ (Milvus) │ │ (Bm25Search) │ │ │
│ │ └────────┬───────┘ └──────────┬───────────────┘ │ │
│ │ └──────────┬──────────┘ │ │
│ │ RRF Fusion │ │
│ └──────────────────────────────────────────────────────┘ │
├──────────────────────────────────────────────────────────────┤
│ Tool Layer │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ ToolService (query_database / call_external_api) │ │
│ └──────────────────────────────────────────────────────┘ │
├──────────────────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ MySQL │ │ Redis │ │ Milvus │ │ AI Models │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │
└──────────────────────────────────────────────────────────────┘
详细架构设计请参阅 docs/ARCHITECTURE.md
Thought: 分析问题,决定下一步行动
↓
Action: 选择工具(query_database / call_external_api)
↓
Action Input: 工具参数
↓
Observation: 工具执行结果
↓
(重复以上步骤,直到得到足够信息)
↓
Final Answer: 给出最终回答
| 机制 | 说明 |
|---|---|
| 最大迭代步数 | 默认 10 步,防止无限循环 |
| 超时控制 | 整体任务 3 分钟超时 |
| 死循环检测 | 相同 Observation 连续出现 3 次则终止 |
| 异常捕获 | LLM 调用或工具执行失败时优雅降级 |
score(d) = Σ 1/(k + rank_i(d))
其中 k=60,rank_i(d) 是文档 d 在第 i 路检索中的排名。
src/main/java/com/aiagent/
├── agent/
│ ├── AiAgentService.java # AI 聊天服务(集成长上下文管理 + ReAct + 语义缓存)
│ ├── ReActAgent.java # ReAct 推理循环
│ └── MultiAgentService.java # 多智能体协作(Supervisor + Worker)
├── cache/
│ └── SemanticCacheService.java # 语义缓存(降低 API 成本)
├── config/
│ ├── AiModelConfig.java # 多模型配置(策略模式)
│ ├── AiProperties.java # 配置属性绑定
│ └── MilvusInitConfig.java # Milvus 初始化
├── controller/
│ └── AiAgentController.java # REST API 控制器
├── document/
│ ├── DocumentService.java # 文档上传与检索
│ └── parser/ # 多格式文档解析器
├── evaluation/
│ └── RagEvaluationService.java # RAG 效果评估(召回率/准确率/延迟)
├── memory/
│ └── LongContextManager.java # 长上下文管理(滑动窗口 + 摘要压缩 + 历史检索)
├── retrieval/
│ ├── MultiRecallService.java # 多路召回 + RRF 融合
│ └── Bm25Search.java # BM25 关键词检索
├── tool/
│ └── ToolService.java # 工具调用框架
└── vectorstore/
└── MilvusVectorStoreService.java # Milvus 向量存储
在 application.yml 中修改 ai.model.provider:
ai:
model:
provider: deepseek # 可选: deepseek, qianwen, doubao, qwen3-flash, local
ai:
embedding:
provider: siliconflow # 可选: local, local-qwen3, siliconflow
参考 .env.example 文件,所有敏感配置通过环境变量注入。
该项目适用于以下面试场景:
| 知识点 | 项目体现 |
|---|---|
| Spring Boot 启动流程 | AiModelConfig 自动配置、@ConditionalOnProperty |
| 策略模式 | 多模型动态切换 |
| Redis 缓存 | 会话管理、语义缓存 |
| 数据库优化 | JPA + 连接池配置 |
| Docker 部署 | 4 服务编排、健康检查 |
| 知识点 | 项目体现 |
|---|---|
| ReAct Agent | 完整推理循环、死循环防护、超时控制 |
| 长上下文管理 (Q174) | 滑动窗口 + 摘要压缩 + 历史检索 |
| RAG 效果评估 (Q173) | 召回率/准确率/F1/延迟量化评估 |
| RAG 优化 | 多路召回 + RRF 融合 |
| 成本控制 | 语义缓存、本地模型降级 |
| Embedding | SiliconFlow BGE-M3 接入 |
| 向量数据库 | Milvus 集合创建、索引构建 |
| 多智能体 (Q147) | Supervisor + Worker 协作模式 |
| SSE 流式输出 (Q151-153) | 心跳机制 + 虚拟线程管理 |
Apache License 2.0