Spring AI Alibaba

Framework · Last verified 2026-09-30

TL;DR

Spring AI Alibaba is Alibaba's Apache-2.0 Java framework on top of Spring AI for ReactAgent-based agents, sequential, parallel, routing and loop multi-agent flows, and a graph runtime with checkpoints, human approval hooks and A2A over Nacos. It suits Spring Boot teams on JDK 17+. Its overview says ReactAgent now mainly gets fixes, pointing to AgentScope instead.

Key facts

Spring AI Alibaba key facts. Data as of 2026-09-30.
Type Framework
Languages / SDKs Java
License Apache-2.0
Pricing model Open source, free
Orchestration pattern Graph
GitHub stars 10,948 (as of 2026-09-30)
GitHub forks 2,434
Last push 2026-09-16
Latest release v1.1.2.2
Repository alibaba/spring-ai-alibaba
Website java2ai.com
Documentation java2ai.com
Last verified 2026-09-30

Key features

  • ReactAgent builder that takes a Spring AI ChatModel, an instruction, tools, hooks and interceptors, and runs with call() or invoke(). (source)
  • Flow agents such as SequentialAgent, ParallelAgent and LlmRoutingAgent compose sub-agents that pass results through outputKey values and {placeholder} references. (source)
  • Graph runtime (StateGraph) with conditional routing, nested graphs, parallel branches and export of workflows to PlantUML or Mermaid. (source)
  • Checkpoint savers for memory, file, H2, JDBC, MySQL, PostgreSQL, Oracle, MongoDB and Redis. (source)
  • HumanInTheLoopHook pauses chosen tool calls for an approve, edit or reject decision, using checkpoints to resume. (source)
  • Hooks for context engineering such as context compaction, model and tool call limits, tool retry, planning and dynamic tool selection. (source)
  • A2A server for exposing a ReactAgent, A2aRemoteAgent for calling remote agents, and Nacos as agent registry and discovery. (source)
  • Spring AI Alibaba Admin for visual agent building, tracing, evaluation and MCP management, plus an embedded Studio UI for debugging. (source)

Architecture and orchestration pattern

Pattern: Graph

The project has three layers. At the bottom, Spring AI supplies model, tool, MCP, message and vector-store abstractions. Above it, Spring AI Alibaba Graph is a state-graph runtime with nodes, conditional edges, subgraphs and parallel branches, plus persistence and streaming. The Agent Framework sits on top: a ReactAgent runs a model-and-tool loop, and flow agents compose several agents.

Multi-agent setups come in two styles. SequentialAgent, ParallelAgent, RoutingAgent / LlmRoutingAgent and LoopAgent run sub-agents in a fixed or model-chosen order, passing data through shared state: each agent writes to an outputKey, and later instructions reference it with placeholders such as {article}. The docs also describe agents used as tools by a supervisor, and handoffs where the active agent changes. For full control, developers can build the flow directly with the Graph API.

State is an OverAllState map persisted by checkpoint savers, from in-memory to Redis, MongoDB or relational databases. Checkpoints make human-in-the-loop pauses and long-running tasks resumable. Conversation memory follows Spring AI's chat memory repositories, and the A2A starter integrates with Nacos so agents in different services can find and call each other.

Human in the loop

Human review is a hook. A HumanInTheLoopHook is configured with approvalOn(toolName, ToolConfig) for each tool that needs oversight and added to the agent's hooks. When the model proposes one of those calls, the hook raises an interrupt, the graph state is saved by the checkpoint saver (for example MemorySaver), and execution stops. A person then approves the call as is, edits its arguments before it runs, or rejects it with an explanation that is added to the conversation. When several calls pause together, each gets its own decision. The Graph Core docs also include human-in-the-loop, cancellation and time-travel examples at the graph level.

Protocols

MCP, A2A and AG-UI support for Spring AI Alibaba. See the full matrix.
ProtocolSupportNote
MCP Yes evidence
checked 2026-09-30
Client: the tools tutorial (Chinese-language page) shows a ReactAgent using remote MCP tools over streamable HTTP and SSE through Spring AI's spring-ai-starter-mcp-client; MCP support comes from the underlying Spring AI project.
A2A Yes evidence
checked 2026-09-30
Both directions: the A2A page (Chinese-language) shows an A2A server exposing a local ReactAgent, A2aRemoteAgent for calling remote agents, and Nacos-based AgentCard registry and discovery via spring-ai-alibaba-starter-a2a-nacos.
AG-UI Unknown
checked 2026-09-30
No AG-UI page in the docs sitemap or README; the only hit is a UI description string in the Admin frontend calling its debug chat 'compatible with the AG-UI spec', with no documented implementation.

Best for

  • Spring Boot applications that want agents on top of Spring AI's model and tool abstractions
  • Tool calls that need an approve, edit or reject decision before they run
  • Self-hosted deployments that keep checkpoints in MySQL, PostgreSQL, Redis or MongoDB
  • Microservice setups where agents register in Nacos and call each other over A2A

Not for

  • Python or TypeScript stacks
  • Readers who need English documentation; most docs pages are in Chinese, even under the /en/ path
  • Projects that need a stable release on Spring Boot 4 and Spring AI 2, which so far only has a milestone

Quickstart

<dependency>
  <groupId>com.alibaba.cloud.ai</groupId>
  <artifactId>spring-ai-alibaba-agent-framework</artifactId>
  <version>1.1.2.0</version>
</dependency>

Install not yet verified by this site. What this means

import com.alibaba.cloud.ai.graph.OverAllState;
import com.alibaba.cloud.ai.graph.agent.ReactAgent;
import com.alibaba.cloud.ai.graph.agent.flow.agent.SequentialAgent;
import java.util.List;
import java.util.Optional;

// chatModel: any Spring AI ChatModel bean, e.g. from the DashScope or OpenAI starter
ReactAgent writer = ReactAgent.builder().name("writer").model(chatModel)
    .instruction("Write a 100-word product note about: {input}").outputKey("draft").build();
ReactAgent editor = ReactAgent.builder().name("editor").model(chatModel)
    .instruction("Tighten this note and return only the text: {draft}").outputKey("final").build();

SequentialAgent pipeline = SequentialAgent.builder()
    .name("note_pipeline").subAgents(List.of(writer, editor)).build();

Optional<OverAllState> result = pipeline.invoke("a reusable water bottle");
result.flatMap(s -> s.value("final")).ifPresent(System.out::println);

Common pitfalls

  • Requires JDK 17+ (and Maven 3.8+ per the quick start).
  • A model starter is separate: the docs use spring-ai-alibaba-starter-dashscope with AI_DASHSCOPE_API_KEY; other providers need the matching Spring AI starter.
  • The quick start pins spring-ai-alibaba-agent-framework 1.1.2.0, while GitHub's latest stable release is v1.1.2.2 (2026-03-10).
  • v2.0.0-M1.1 (2026-06-25) is a pre-release milestone that moves to Spring AI 2.0.0-M1 and Spring Boot 4.0.0.
  • Human-in-the-loop needs a checkpoint saver configured on the agent; MemorySaver does not survive restarts.

Official quickstart

Pros

  • Fits Spring Boot apps directly and inherits Spring AI's support for providers such as DashScope and OpenAI. (source)
  • A2A works in both directions and can use Nacos for AgentCard registration, discovery and load balancing. (source)
  • The approval hook supports approve, edit and reject per tool, not just a yes/no gate. (source)
  • Checkpoints can be stored in many backends already used in Java shops, from JDBC databases to Redis and MongoDB. (source)
  • Release v1.1.2.2 added worked examples for subagent, supervisor, routing, handoff and workflow patterns. (source)

Cons

  • The overview says the ReactAgent part will only keep receiving bug fixes and security patches, and points to AgentScope for a more advanced ReactAgent. (source)
  • Most documentation is written in Chinese; the /en/ pages for topics such as A2A still show Chinese text. (source)
  • The latest stable release, v1.1.2.2, dates from March 2026; the Spring Boot 4 line is only available as milestone v2.0.0-M1.1. (source)
  • The README chatbot and quick start default to Alibaba Cloud's DashScope models; other providers need a different starter and configuration. (source)

Alternatives

FAQ

Does Spring AI Alibaba support MCP?

Yes, through Spring AI. The docs show a ReactAgent using remote MCP tools via spring-ai-starter-mcp-client over streamable HTTP or SSE, and the Admin platform includes MCP management.

Does Spring AI Alibaba support A2A?

Yes. It can expose a ReactAgent as an A2A server and call remote agents with A2aRemoteAgent, with Nacos as an optional registry for agent cards.

Is Spring AI Alibaba free?

Yes. It is Apache-2.0 licensed; model usage is billed by whichever provider you configure, such as DashScope or OpenAI.

Which Java and Spring versions does it need?

JDK 17 or newer. The stable 1.1.x line builds on Spring AI 1.1 and Spring Boot 3.5; the 2.0 milestone moves to Spring AI 2.0.0-M1 and Spring Boot 4.

Is Spring AI Alibaba still actively developed?

The repository was pushed on 2026-09-16. The overview says ReactAgent will get fixes and security patches while the team focuses on Spring AI integration and multi-agent work, pointing to AgentScope for a more advanced ReactAgent.

Sources

Unknown fields: protocols.agui: searched the README, the java2ai.com sitemap, the AG-UI README integration list and a GitHub code search for 'ag-ui' / 'agui'. The only hit is a description string in the Admin frontend (spring-ai-alibaba-admin/frontend/.../App/index.tsx) saying its debug chat UI is compatible with the AG-UI spec; no docs or implementation details were found, so the cell stays unknown.