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.
Last scanned: 8/6/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-08-06T06:30:55.544Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how ai-agent-platform compares with popular alternatives.
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 69 GitHub stars.
Yes. ai-agent-platform passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
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!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
See comparison
基于 Spring Boot 3.5 + LangChain4j 0.34 构建的 AI Agent 服务端框架,内置 ReAct 推理循环、多路召回 RAG、语义缓存与工具调用,开箱即用、可观测、可评测,适合作为企业级智能问答 / 客服系统的后端底座。
构建一个生产可用的 Agent 服务,通常会卡在几个地方:召回不准(答非所问)、成本失控(每次请求都调一次大模型)、不可观测(出了问题不知道哪一环挂了)、难以验证(上线前不知道效果到底怎么样)。本项目把这几件事做成了开箱即用的工程能力:
| 能力 | 做了什么 | 效果 |
|---|---|---|
| ReAct 推理循环 | Thought → Action → Observation → Answer,带死循环 / 超时 / 步数三重防护 | 复杂问题可拆解执行,稳定收敛 |
| Adaptive RAG | 查询路由 + 改写 + 多轮检索 + 结果自验证 | FAQ 域内 R@1 达到 98.3%(multi-gold,120 例) |
| 多路召回 | Milvus 向量 + BM25 关键词 + RRF(k=60) 融合 | 单 gold 基线 R@1 47.5% → R@5 62.5% |
| 语义缓存 | embedding 余弦相似度(0.92 阈值,24h TTL) | 相似问题命中缓存,显著降低 API 成本 |
| 证据门禁 | 回答前校验检索证据等级,证据不足转人工 | 客服场景避免模型"编造"答案 |
| 多模型路由 | DeepSeek / 通义千问 / 豆包 / Qwen3-Flash / Ollama 策略切换 | 主模型故障自动降级本地模型 |
| 工具调用 | 统一注册表:查库(白名单表)+ 外部 API(域名白名单) | Agent 具备执行动作能力 |
| 可观测 | Micrometer 自定义指标 + Prometheus + Grafana | 聊天 / 检索 / 入库延迟一目了然 |
┌─────────────────────────────────────────────────────────────────┐
│ AI Agent Platform │
│ ┌──────────────┐ ┌───────────────────┐ ┌─────────────────────┐ │
│ │ Chat API │ │ ReAct API │ │ Document API │ │
│ └──────┬───────┘ └─────────┬─────────┘ └──────────┬──────────┘ │
│ ┌──────┴───────┐ ┌─────────┴─────────┐ ┌──────────┴──────────┐ │
│ │ AiAgentSrv │ │ ReActAgent │ │ DocumentService │ │
│ └──────┬───────┘ └─────────┬─────────┘ └──────────┬──────────┘ │
│ ┌──────┴──────────────────────────────────────────┴──────────┐ │
│ │ SemanticCacheService (余弦相似度缓存) │ │
│ └──────┬──────────────────────────────────────────┬──────────┘ │
│ ┌──────┴──────┐ MultiRecallService ┌─────────────┴──────────┐ │
│ │ Vector(ML) │ + BM25 + RRF 融合 │ Adaptive RAG Router │ │
│ └──────┬──────┘ └─────────────┬──────────┘ │
│ ┌──────┴──────────────────────┐ ┌───────────────┴──────────┐ │
│ │ ToolService(注册表自动发现) │ │ LongContextManager(摘要) │ │
│ └──────┬──────────────────────┘ └───────────────┬──────────┘ │
│ ┌──────┴─────┐ ┌────────┐ ┌────────┐ ┌───────────┴────────┐ │
│ │ MySQL │ │ Redis │ │ Milvus │ │ AI Models(策略切换)│ │
│ └────────────┘ └────────┘ └────────┘ └────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
核心链路:请求进入 → 语义缓存命中直接返回(降本)→ 未命中走 ReAct / Adaptive RAG(向量 + BM25 + RRF,工具调用)→ 长会话由 LongContextManager 滑动窗口 + 摘要压缩 → 结果回写缓存并流式(SSE)返回。
完整架构设计请参阅 docs/ARCHITECTURE.md
git clone https://github.com/888newstep/ai-agent-platform.git
cd ai-agent-platform
cp .env.example .env
# 编辑 .env 填入你的 API 密钥(模型 / 嵌入 / Milvus 等)
全本地依赖(一条命令启动 MySQL + Redis + Milvus + 应用):
docker compose up -d
也支持混合拓扑:本机跑应用 + MySQL + Redis,Milvus 用云端实例(通过 MILVUS_HOST 等环境变量指定)。启动前可先跑预检脚本确认依赖可达:
.\scripts\check-infrastructure.ps1
curl http://localhost:8081/api/v1/agent/health
# 返回: {"status":"UP","service":"AI Customer Service Agent","version":"1.0.0"}
创建会话并聊天:
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"
ReAct 模式(推理 + 工具调用):
curl -X POST "http://localhost:8081/api/v1/agent/react/chat?sessionId={sessionId}&question=查询数据库中的用户数量&useRag=true"
流式聊天(SSE):
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
客服问答(强制证据门禁,需 JWT):
curl -X POST "http://localhost:8081/api/v1/customer-support/chat" \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Idempotency-Key: cs-chat-001" \
-H "Content-Type: application/json" \
-d '{"sessionId":"{sessionId}","question":"订单如何申请退款?"}'
项目内置一套可复现的 RAG 评测体系,用独立数据集量化检索与回答质量,避免"感觉还行":
详细评测方法与复现步骤见 docs/RAG_BENCHMARK.md、docs/EVIDENCE_VERIFICATION.md,运行脚本 scripts/run-rag-evaluation.ps1。
# 用最小示例集跑一次评测(topK=1,3,5)
curl -X POST \
-H "X-Admin-Api-Key: ${ADMIN_API_KEY}" \
"http://localhost:8081/api/v1/agent/evaluate/export?datasetPath=examples/evaluation-datasets/rag-sample.json&topKs=1,3,5"
正式评测请使用独立人工标注数据集(
independent-human-labeled),不要用公开样例或 smoke 数据冒充业务基线。
| 层 | 措施 |
|---|---|
| 认证 | JWT 无状态鉴权(BCrypt 存储)、X-Admin-Api-Key 管理端密钥 |
| 限流 | Redis 固定窗口限流(默认 30 req/min),按 IP 隔离 |
| 预算 | 单请求 Token 估算上限 + 每分钟预算,超限 fail-open |
| 工具安全 | 数据库白名单表、外部 API 域名白名单 + 拒绝私网地址 |
| 证据门禁 | 客服回答必须通过证据等级校验,否则转人工 |
模型切换(application.yml):
ai:
model:
provider: deepseek # 可选: deepseek, qianwen, doubao, qwen3-flash, local
embedding:
provider: siliconflow # 可选: local, local-qwen3, siliconflow
所有敏感配置通过环境变量注入(参考 .env.example)。生产环境务必设置 JWT_SECRET 和 ADMIN_API_KEY。
src/main/java/com/aiagent/
├── agent/
│ ├── api/ # Agent REST API
│ ├── application/ # 普通聊天、ReAct、Multi-Agent 编排
│ └── infrastructure/tool/ # 数据库与外部 API 工具
├── infrastructure/
│ ├── cache/ # 语义缓存与 RAG 缓存
│ ├── config/ # 模型、Milvus、安全与限流配置
│ └── metrics/ # Micrometer 业务指标
├── knowledge/
│ ├── application/ # 文档上传、解析与入库
│ └── infrastructure/ # Parser、Splitter、VectorStore
├── rag/application/ # Adaptive RAG、Multi-Recall、评测
├── chat/ # 会话与 SSE 流式响应
└── shared/ # 公共响应体与异常处理
项目内的电商客服问答演示数据来自 ModelScope 开源数据集 E_commerce_Customer_Service(Apache 2.0),清洗去重后入库 100,349 条唯一有效 QA 对(Milvus + MySQL)。版权归原提供方所有,商用请遵守 Apache 2.0 条款。
ai.chat.latency / ai.rag.search.latency 等自定义指标欢迎任何形式的贡献——提 Issue、修 Bug、补文档、加功能都行。请先阅读 CONTRIBUTING.md。
特别感谢 codeAnqiang-ma 修复了 LongContextManager 会话摘要触发逻辑并提交 PR(详见 PR #2)。
Apache License 2.0