Spring AI Alibaba
当用户希望基于 Spring AI Alibaba 设计、实现、排查、重构或解释 Java AI 应用时,使用这个 skill。
这个 skill 以本地 references/ 文档集为准,目标不是只回答概念问题,而是指导实际开发落地。
适用场景
当任务涉及以下一项或多项内容时,使用这个 skill:
- 构建
Spring Boot + Spring AI Alibaba项目 - 创建
ReactAgent或智能体团队 - 为 Java 应用添加工具调用或 MCP 工具集成
- 使用
StateGraph/CompiledGraph设计图工作流 - 实现记忆、持久化、人工审批、流式输出
- 基于 Spring AI 抽象实现 RAG 检索增强应用
- 解读
java2ai-docs中的框架 API、示例和推荐模式
工作规则
- 先判断用户真正要实现的能力,再只加载最相关的参考文档。
- 优先使用框架已经提供的能力,不随意自定义编排层。
- 代码保持 Java + Spring Boot 的常见工程风格。
- 产出代码时,至少给出可运行所需的依赖、配置项、Bean 和示例类。
- 只要涉及框架行为判断,就优先根据本地
references/文档核实后再回答。 - 如果用户在 Agent Framework 与 Graph Core 之间选型,要明确给出判断,不要混用得含糊不清。
选型指南
根据任务特点选择实现方式:
- 当应用以“对话 + 工具调用”为主时,优先使用
ReactAgent。 - 当应用是多智能体协作,但整体仍然偏智能体驱动时,优先使用
SequentialAgent、ParallelAgent、LlmRoutingAgent或 agent-as-tool 组合方式。 - 当流程包含显式步骤、分支、检查点、中断恢复或长流程编排时,优先使用
StateGraph。 - 当任务依赖企业私有知识或检索增强时,优先采用 RAG 模式。
- 当任务要求跨轮次、跨会话或跨流程恢复上下文时,优先采用记忆与持久化模式。
中文索引与文档路由
按任务只读取必要文档:
入门与基础
references/overview.md:项目概览与整体架构references/quick-start.md:快速开始references/versions.md:版本说明与变更记录
智能体核心开发
references/frameworks_agent-framework_tutorials_agents.md:ReactAgent核心概念references/frameworks_agent-framework_tutorials_models.md:模型配置与接入references/frameworks_agent-framework_tutorials_messages.md:消息类型与消息组织
工具调用与 MCP
references/frameworks_agent-framework_tutorials_tools.md:工具调用、函数工具、MCP 工具references/frameworks_agent-framework_advanced_agent-tool.md:智能体作为工具的组合方式references/frameworks_graph-core_examples_mcp-node.md:Graph Core 中的 MCP 节点示例
结构化输出
references/frameworks_agent-framework_tutorials_structured-output.md:JSON / POJO 结构化输出
记忆与持久化
references/frameworks_agent-framework_tutorials_memory.md:基础记忆能力references/frameworks_agent-framework_advanced_memory.md:高级记忆与长期记忆references/frameworks_graph-core_core_memory.md:Graph Core 的记忆机制references/frameworks_graph-core_core_persistence.md:持久化与检查点references/frameworks_graph-core_examples_checkpoint-redis.md:基于 Redis 的检查点示例references/frameworks_graph-core_examples_persistence.md:持久化示例
工作流与图编排
references/frameworks_agent-framework_advanced_workflow.md:Agent Framework 工作流能力references/frameworks_graph-core_quick-start.md:Graph Core 快速开始references/frameworks_graph-core_core_core-library.md:核心图编排 APIreferences/frameworks_graph-core_core_streaming.md:流式处理references/frameworks_graph-core_examples_parallel-branch.md:并行分支示例references/frameworks_graph-core_examples_subgraph.md:子图示例references/frameworks_graph-core_examples_subgraph-as-compiledgraph.md:子图作为CompiledGraphreferences/frameworks_graph-core_examples_subgraph-as-nodeaction.md:子图作为NodeActionreferences/frameworks_graph-core_examples_subgraph-as-stategraph.md:子图作为StateGraph
多智能体
references/frameworks_agent-framework_advanced_multi-agent.md:多智能体模式references/frameworks_graph-core_examples_multi-agent-supervisor.md:监督者式多智能体示例references/frameworks_agent-framework_advanced_a2a.md:A2A 智能体通信
人工介入与中断恢复
references/frameworks_agent-framework_advanced_human-in-the-loop.md:人工介入流程references/frameworks_graph-core_examples_human-in-the-loop.md:Graph Core 人工审批示例references/frameworks_graph-core_examples_cancellation.md:取消与中断控制references/frameworks_graph-core_examples_time-travel.md:时间回溯与状态恢复references/frameworks_graph-core_examples_long-time-running-task.md:长时间运行任务
RAG 与上下文工程
references/frameworks_agent-framework_advanced_rag.md:RAG 检索增强模式references/frameworks_agent-framework_advanced_context-engineering.md:上下文工程与提示设计
Hook 与扩展能力
references/frameworks_agent-framework_tutorials_hooks.md:Hook 机制references/frameworks_agent-framework_tutorials_skills.md:Skill 组合与扩展
默认工作流
当用户要求“使用 Spring AI Alibaba 开发”时,按下面流程处理:
- 判断当前任务更适合 Agent Framework 还是 Graph Core。
- 从
references/中读取最小必要文档集合。 - 提取文档里的关键类型、Builder API 和配置模式。
- 产出最小可运行结构:
- Maven 依赖
application.yml或环境变量- Spring Bean / 配置类
- Agent 或 Graph 相关类
- Tool / Model / Memory 接线代码
- 如果用户已经有代码,优先适配现有包结构与项目风格。
- 如果存在歧义,明确写出假设,并优先选择文档中更直接、更简单的实现路径。
输出约定
对于实现类任务,优先按以下顺序输出:
- 简短说明架构选型与原因
- 必需依赖与配置
- 最小可运行代码
- 可选的下一步增强建议
对于解释或排障类任务,优先按以下顺序输出:
- 先说明该框架能力是什么
- 再指出应参考哪些文档
- 再分析可能原因或推荐修复方式
- 最后给出修正后的代码或配置示例
常用开发模板
最小智能体应用
优先参考:
references/quick-start.mdreferences/frameworks_agent-framework_tutorials_agents.mdreferences/frameworks_agent-framework_tutorials_models.mdreferences/frameworks_agent-framework_tutorials_tools.md
带工具调用的助手
优先参考:
references/frameworks_agent-framework_tutorials_tools.mdreferences/frameworks_agent-framework_tutorials_messages.mdreferences/frameworks_agent-framework_tutorials_structured-output.md
图工作流应用
优先参考:
references/frameworks_agent-framework_advanced_workflow.mdreferences/frameworks_graph-core_quick-start.mdreferences/frameworks_graph-core_core_core-library.md
多智能体监督者模式
优先参考:
references/frameworks_agent-framework_advanced_multi-agent.mdreferences/frameworks_graph-core_examples_multi-agent-supervisor.mdreferences/frameworks_agent-framework_advanced_agent-tool.md
企业级 RAG 应用
优先参考:
references/frameworks_agent-framework_advanced_rag.mdreferences/frameworks_agent-framework_advanced_memory.mdreferences/frameworks_agent-framework_advanced_context-engineering.md
补充说明
- 细节敏感的问题优先依赖本地
references/文档,而不是直接凭记忆回答。 - 如果框架已有明确类或模式,不要臆造未文档化 API。
- 如果问题与版本相关,先检查
references/versions.md。
微信扫一扫