需先自行申请 DashScope 等模型提供商的 API-KEY,否则示例无法启动;示例默认占用 8080 端口,访问路径为 /chatui/index.html;使用 OpenAI 或 DeepSeek 需替换 starter 依赖,README 未给出具体坐标
spring-ai-alibaba
alibabaApache-2.0活跃维护面向 Java 开发者的智能体 AI 框架,基于 Spring AI 构建,支持 ReAct 智能体、多智能体协作和基于图的工作流编排。
Agentic AI Framework for Java Developers
git clone --depth=1 https://github.com/alibaba/spring-ai-alibaba.git
cd spring-ai-alibaba
export AI_DASHSCOPE_API_KEY=your-api-key
./mvnw -pl examples/chatbot spring-boot:runREADME 未说明显存或 GPU 要求,仅要求 JDK 17+,并需自选 LLM 提供商并获取 API-KEY
面向 Java 开发者的生产级 Agentic AI 框架,用 Spring 生态快速搭建智能体与多智能体工作流
面向 Java 开发者的智能体 AI 框架,基于 Spring AI 构建,支持 ReAct 智能体、多智能体协作和基于图的工作流编排。
核心能力
- 内置 SequentialAgent、ParallelAgent、RoutingAgent、LoopAgent 多智能体编排模式
- 提供 Context Engineering 策略,含 human-in-the-loop、上下文压缩与工具重试
- 基于 Graph 的工作流运行时,支持条件路由、嵌套图、并行执行与状态管理
- 支持 DashScope、OpenAI 等多家模型及工具调用与 MCP 协议
- 提供可视化 Admin 平台与 Studio 调试界面,支持 A2A 与 Nacos 集成
容易踩的坑
- v2.0.0-M1.1pre-release2026-06-25 · 2026-06-25 05:46 UTC
查看更新说明
Highlights
Milestone release upgrading to Spring AI 2.0.0-M1 and Spring Boot 4.0.0.
Dependency Upgrade
- Spring AI: 1.1.2 → 2.0.0-M1
- Spring AI Alibaba Extensions → 2.0.0-M1.1
- Spring Boot: 3.5.8 → 4.0.0
- Redisson: 3.22.0 → 3.52.0
- Removed explicit driver dependency versions for MySQL, PostgreSQL, and Oracle (now managed by Spring Boot BOM)
- v1.1.2.2最新正式版2026-03-10 · 2026-03-10 09:32 UTC
AgentScope Integration
AgentScope Java is an agent-oriented programming framework for building LLM-powered applications.
- AgentScope – AgentScopeAgent wraps AgentScope ReActAgent as a BaseAgent for use in graph workflows.
# Add the following dependency to ochestrate AgentScope using SAA Graph <dependency> <groupId>com.alibaba.cloud.ai</groupId> <artifactId>spring-ai-alibaba-starter-agentscope</artifactId> <version>1.1.2.2</version> </dependency>Multiagent Patterns
- Subagent – Main orchestrator delegates tasks to specialized sub-agents (codebase explorer, web researcher, etc.) via Task/TaskOutput tools; supports both Markdown and API-defined sub-agents.
- Supervisor – Central supervisor agent wraps calendar and email agents as tools (AgentTool), invokes them on demand, and synthesizes results.
- Skills – Single agent uses
read_skillto load skill content on demand; system prompt shows only skill descriptions for progressive disclosure and smaller context. - Routing
- Routing (simple) – LlmRoutingAgent classifies the user query, invokes specialist agents (GitHub, Notion, Slack) in parallel, then synthesizes a single answer.
- Routing (graph) – LlmRoutingAgent as a StateGraph node with preprocess/postprocess and an internal merge node for routing and result synthesis.
- Handoffs
- Handoffs (single-agent) – One ReactAgent advances steps via state (e.g.
current_step); a ModelInterceptor injects step-specific system prompt and tools per turn. - Handoffs (multi-agent) – Sales and support agents as graph nodes; handoff tools update
active_agentand conditional edges route between agents.
- Handoffs (single-agent) – One ReactAgent advances steps via state (e.g.
- Workflow – Custom workflow examples: RAG (rewrite → retrieve → prepare → agent) and SQL agent (list_tables → get_schema → run_query) as graph-based flows.
Multimodal & Voice Agent
- Voice Agent – Sandwich architecture (STT → ReactAgent → TTS): WebSocket-based real-time voice with DashScope ASR and CosyVoice TTS, plus text input; agent uses sandwich-order tools and streams events (stt_chunk, agent_chunk, tts_chunk).
- Multimodal – Vision (image in/out) and TTS: DashScope vision models for image understanding and ReactAgent with media input; image generation via tools (Wanx), TTS via DashScopeAudioSpeechModel; ToolMultimodalResult for structured tool responses (url/base64).
- v1.1.2.12026-03-09 · 2026-03-09 01:42 UTC
查看更新说明
Please use
1.1.2.2instead.1.1.2.1was reported with several bugs that have been fixed in1.1.2.2. - v1.1.2.02026-02-02 · 2026-02-02 04:24 UTC
查看更新说明
Summary
This release upgrades Spring AI to 1.1.2, adds Agent Skills support for Agent Framework, adds parallel sub-agent execution for workflow agents (LlmRouting, Supervisor), extends the graph with parallel conditional edges, parallel aggregation strategy (allOf and anyOf), async tool execution, and tool returnDirect. It also includes serialization and MergeStrategy fixes, admin/UI fixes, and documentation updates.
Please see the documentation for more details.
Features
Agent
- Agent Skills in ReactAgent (#3975) — Integrated skills capabilities in ReactAgent, supports skill and too progressive disclosure.
- Built-in multi-agent pattern support — Supports routing, supervisor, supervisor(agent as tool), handoffs, skills, etc., multi-agent patterns; added parallel execution support for routing and supervisor patterns.
- Flow agent hook support (#3983) — All flow agent (routing, supervisor, loop, sequential, etc) supports customized Hooks.
- New Agent API (#4031) — New
streamMessagesAPI for simplified message streaming; New overloadinvokeandcallmethods for extra inputs. - Async and parallel tool execution (#4037) — Support tool execution in parallelization and asynchronous tool execution .
- Tool returnDirect (#4139) — Support for tool
returnDirectbehavior. - ToolContextHelper (#4163) — Helper class for metadata access in tool context (fixes #3110).
Graph
- Parallel conditional edges (#4027) — Conditional edges support parallel execution (fixes #3917).
- Aggregation strategy for parallel branches (#4028) — New aggregation strategy (AllOf and AnyOf) for parallel branches.
- Batch addEdge for parallel branches (#3938) — Convenient batch
addEdgemethods for parallel branch definition inStateGraph. - interruptAfter hook (#3864) —
InterruptableActionsupportsinterruptAfterhook (fixes #3447, #3904). - Async tool execution for AgentToolNode (#4037 / #3988) — Async tool execution support for
AgentToolNode. - Full output for streaming node (#3941) — Streaming nodes now emit full output including
_FINISHEDOutputType.
Sandbox & Studio
- SAA Sandbox (#4069) — New SAA Sandbox module that provides safe and isolated tool execution.
- Built-in RenderTemplate (#3935) — Built-in customized
RenderTemplateimplementation. - Studio CORS optional (#4154) — CORS configuration is now optional in Studio.
Fixes
DashScopeChatModel
- Connection reset reported in #3942 (spring-ai-alibaba/spring-ai-extensions#140) — Set default HTTP client for
DashScopeApito better manage connections, avoid Connection Reset issue when the connection is closed by model server.
Graph
- Serialization (#3969) — Fixed
classbug in serialization (fixes #3895, #3931).. - MergeStrategy (#4129) — Corrected
Optionalhandling and enforced strict type checks inMergeStrategy(fixes #3909).
Agent
- Instruction (#3974) — Added instruction handling; fixed CI and tests.
- AgentLlmNode model options (#3986) — Prevent AgentLlmNode from overriding default model options; ensure
internalToolExecution(false)is set for ChatOptions (fixes #3903). - selectorModel (#4045) — Added
selectorModelsupport (fixes #4026). - systemPrompt (#4067) — Fixed system prompt handling.
- ParallelAgent maxConcurrency (#4053) — Ensured
maxConcurrencyfunction of ParallelAgent is implemented. - jumpTo (#4081) — Ensured
jumpTooperates correctly. - ModelRequest builder systemMessage (#4138) — ModelRequest builder no longer loses
systemMessage. - NacosReactAgentBuilder (#4093) — Fixed NacosReactAgentBuilder to properly merge local tools.
- AgentLlmNode tool callbacks (#4112) — Corrected tool callbacks filte
- v1.1.0.02025-12-30 · 2025-12-30 10:02 UTC
查看更新说明
The official Spring AI Alibaba release that built on Spring AI 1.1.0 and Spring AI Alibaba Extensions 1.1.0.0.
Please check the documentation on our website for usage and upgrade guide.
Please submit issues and follow the updates on the official website. We will try our best to keep the documentation up to date in the next few weeks.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Spring AI Alibaba
Architecture
Spring AI Alibaba Admin is a one-stop Agent platform that supports visualized Agent development, observability, evaluation, and MCP management, etc. It also integrates with open-source low-code platforms like Dify, enabling rapid migration from DSL to Spring AI Alibaba project.
Spring AI Alibaba Agent Framework is an agent development framework that can quickly develop agents with built-in Context Engineering and Human In The Loop support. For scenarios requiring more complex process control, Agent Framework offers built-in workflows like SequentialAgent, ParallelAgent, RoutingAgent, LoopAgent.
Spring AI Alibaba Graph serves as the underlying runtime of the Agent Framework, providing essential capabilities such as persistence, workflow orchestration, and streaming required for long-running stateful agents. Compared to the Agent Framework, users can build more flexible multi-agent workflows based on the Graph API.
Core Features
-
Multi-Agent Orchestration: Compose multiple agents with built-in patterns including
SequentialAgent,ParallelAgent,RoutingAgent, andLoopAgentfor complex task execution. -
Multimodal Support: ReactAgent with text and media input (image understanding). ReactAgent with tool based image or audio generation.
-
Voice Agent: WebSocket-based real-time voice agent that supports streaming audio or text input and responds with generated audio.
-
Context Engineering: Built-in best practices for context engineering policies to improve agent reliability and performance, including human-in-the-loop, context compaction, context editing, model & tool call limit, tool retry, planning, dynamic tool selection.
-
Graph-based Workflow: Graph based workflow runtime and api for conditional routing, nested graphs, parallel execution, and state management. Export workflows to PlantUML and Mermaid formats.
-
A2A Support: Agent-to-Agent communication support with Nacos integration, enabling distributed agent coordination and collaboration across services.
-
Rich Model, Tool and MCP Support: Leveraging core concepts of Spring AI, supports multiple LLM providers (DashScope, OpenAI, etc.), tool calling, and Model Context Protocol (MCP).
-
One-stop Agent Platform: Build agent in a visualized way, deploy agent without code or export as a standalone java project.
Getting Started
Prerequisites
- Requires JDK 17+.
- Choose your LLM provider and get the API-KEY.
Quickly Run a ChatBot
There's a ChatBot example provided by the community at examples/chatbot.
-
Download the code.
git clone --depth=1 https://github.com/alibaba/spring-ai-alibaba.git cd spring-ai-alibaba -
Start the ChatBot.
Before starting, set API-KEY first (visit Aliyun Bailian to get API-KEY):
# this example uses 'spring-ai-alibaba-starter-dashscope', visit https://java2ai.com to learn how to use OpenAI/DeepSeek. export AI_DASHSCOPE_API_KEY=your-api-key# Maven installation is optional when using mvnw. ./mvnw -pl examples/chatbot spring-boot:run -
Chat with ChatBot.
Open the browser and visit http://localhost:8080/chatui/index.html to chat with the ChatBot.
Chatbot Code Explained
-
Add dependencies
<dependencies> <dependency> <groupId>com.alibaba.cloud.ai</groupId> <artifactId>spring-ai-alibaba-agent-framework</artifactId> <version>1.1.2.0</version> </dependency> <!-- Assume you are going to use DashScope Model. Refer to docs for how to choose model.--> <dependency> <groupId>com.alibaba.cloud.ai</groupId> <artifactId>spring-ai-alibaba-starter-dashscope</artifactId> <version>1.1.2.1</version> </dependency> </dependencies> -
Define Chatbot
For more details of how to write a Chatbot, please check the Quick Start on our official website.
📚 Documentation
- Overview - High level overview of the framework
- Quick Start - Get started with a simple agent
- Agent Framework Tutorials - Step by step tutorials
- Use Graph API to Build Complex Workflows - In-depth user guide for building multi-agent and workflows
- Spring AI Basics - Ai Application basic concepts, including ChatModel, MCP, Tool, Messages, etc.
- Chat Memory - Spring AI reference for chat memory repositories and usage
Project Structure
This project consists of several core components:
- spring-ai-alibaba-agent-framework: A multi-agent framework designed for building intelligent agents with built-in context engineering best practices.
- spring-ai-alibaba-graph: The underlying runtime for Agent Framework. We recommend developers to use Agent Framework but it's totally fine to use the Graph API directly.
- spring-ai-alibaba-admin: A one-stop Agent platform that supports visualized Agent development, observability, evaluation, and MCP management, etc.
- spring-ai-alibaba-studio: The embedded ui for quickly debugging agent in a visualized way.
- spring-boot-starters: Starters integrating Agent Framework with Nacos to provide A2A and dynamic config features.
Spring AI Alibaba Ecosystem
| Repository | Description | ⭐ |
|---|---|---|
| Spring AI Alibaba Graph | A low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents. | |
| Spring AI Alibaba Admin | Local visualization toolkit for the development of agent applications, supporting project management, runtime visualization, tracing, and agent evaluation. | |
| Spring AI Extensions | Extended implementations for Spring AI core concepts, including DashScopeChatModel, MCP registry, etc. | |
| Spring AI Alibaba Examples | Spring AI Alibaba Examples. | |
| JManus | A Java implementation of Manus built with Spring AI Alibaba, currently used in many applications within Alibaba Group. | |
| DataAgent | A natural language to SQL project based on Spring AI Alibaba, enabling you to query databases directly with natural language without writing complex SQL. | |
| DeepResearch | Deep Research implemented based on spring-ai-alibaba-graph. |
Contact Us
- Dingtalk Group (钉钉群), search
182255021470and join.
- WeChat Group (微信公众号), scan the QR code below and follow us.
Resources
- AI-Native Application Architecture White Paper: Co-authored by 40 frontline engineers and endorsed by 15 industry experts, this 200,000+ word white paper is the first comprehensive guide dedicated to the full DevOps lifecycle of AI-native applications. It systematically breaks down core concepts and key challenges, offering practical problem-solving approaches and architectural insights.