跪拜 Guibai
← Back to the summary

Spring AI 2.0 vs. Spring AI Alibaba: Atomic Abstraction or Enterprise Orchestration?

Foreword

Recently a community member asked: "Brother San, between Spring AI 2.0 and Spring AI Alibaba, which one should I choose?"

These two frameworks, one backed by the official Spring team and the other by Alibaba Cloud, are the two hottest topics in the Java AI development space in 2026.

Spring AI 2.0 just released its GA version on June 12, 2026, built on Spring Boot 4.1 and Spring Framework 7.0.

Spring AI Alibaba also released its 1.0 GA version on May 13, 2026, and has since accumulated over 10k+ Stars.

Many developers are even more confused after reading articles online—some say Spring AI is the "LangChain of the Java world," while others say Spring AI Alibaba is the "LangGraph of the Java world."

Both sound plausible, but when it comes to actually choosing, it's still a fog.

This article is dedicated to discussing this topic with everyone, hoping it will be helpful.

For more project practices, visit my tech website: susan.net.cn/project

1. A Diagram to Understand the Essential Difference

Before diving into the details, let's establish an overall understanding.

image.png

There's a very precise viewpoint: The two are not a simple replacement relationship, but a complementary one between foundational atomic abstractions and a high-level enterprise orchestration runtime.

Spring AI 2.0's official mission is "connecting your enterprise Data and APIs with the AI Models" — not "giving your Java system autonomous agents," but "making LLMs a pluggable middleware in enterprise systems, just like JDBC, JMS, and WebClient." The Spring team deliberately did not build Spring AI as an Agent Framework.

Spring AI Alibaba, on top of Spring AI's low-level abstractions, supplements the key components needed to build enterprise-grade production systems—its core focus is Multi-Agent Orchestration. If Spring AI is the LangChain of the Java world, then Spring AI Alibaba is closer to the LangGraph of the Java world.

In one sentence: Spring AI solves "how to connect to AI," while Spring AI Alibaba solves "how to make multiple AIs work together."

2. Spring AI 2.0

2.1 What is it?

Spring AI is the official AI application development framework launched by Spring. Its core goal is to introduce the design principles of the Spring ecosystem—high portability, dependency injection, modular design, and POJO-based application construction—into the AI domain.

Spring AI 2.0 is built on Spring Boot 4.1 and Spring Framework 7.0. The codebase has now fully adopted JSpecify null-safety annotations and upgraded to Jackson 3 serialization.

2.2 Core Architecture

Spring AI adopts a layered architecture design:

image.png

2.3 Core Upgrades in Version 2.0

Spring AI 2.0 is a major architectural refactoring, not just a dependency version upgrade. Core changes include:

① Tool Calling Becomes a First-Class Citizen

In 2.0, Tool Calling is elevated to a first-class, composable component within the ChatClient Advisor Chain. The tool invocation loop is stripped from each ChatModel and uniformly handled externally by ChatClient through ToolCallingAdvisor.

② Brand New ToolCallback API

2.0 removes SpringBeanToolCallbackResolver and the toolNames API. Tools must now be explicitly registered as ToolCallback Beans and passed via .tools(). It also adds ToolSearchToolCallingAdvisor, supporting on-demand tool discovery and invocation.

③ Enhanced Structured Output

2.0 adds Self-Correcting Structured Output capability and provides EntityParamSpec to support per-call structured output configuration.

④ Memory Management Optimization

MessageWindowChatMemory supports truncation by message boundary (turn-boundary), preventing cuts in the middle of a conversation. It also avoids duplicating chat memory in tool prompts.

⑤ More Focused Model Support

Spring AI 2.0 streamlines the supported Chat Model providers to a core few: OpenAI (unified via SDK), Anthropic (unified via SDK), Amazon Bedrock, Google GenAI, etc. OpenAI-compatible APIs can still be used.

2.4 Code Example

Below is a complete example using Spring AI 2.0 for chat and streaming output:

@Service
@RequiredArgsConstructor
public class SpringAiChatService {
    
    private final ChatClient chatClient;
    
    // Non-streaming chat
    public ChatResponse chat(ChatRequest request) {
        ChatResponse response = chatClient.prompt()
            .user(request.getMessage())
            .call()
            .chatResponse();
        return ChatResponse.builder()
            .content(response.getResult().getOutput().getContent())
            .build();
    }
    
    // Streaming chat
    public Flux<ChatResponse> streamChat(ChatRequest request) {
        return chatClient.prompt()
            .user(request.getMessage())
            .stream()
            .chatResponse()
            .map(response -> ChatResponse.builder()
                .content(response.getResult().getOutput().getContent())
                .build());
    }
}

2.5 Pros and Cons

Pros:

Cons:

2.6 Applicable Scenarios

Scenario Recommendation Reason
Standard AI Application Access ✅✅✅ Highly Recommended Unified AI programming model, avoids vendor lock-in.
RAG Applications ✅✅✅ Highly Recommended Built-in vector storage, document parsing, retrieval-augmented generation.
Single Agent + Tool Calling ✅✅✅ Highly Recommended Tool Calling is a first-class citizen.
Existing Spring Boot Projects ✅✅✅ Highly Recommended Seamless integration, low intrusion.
Complex Multi-Agent Collaboration ⚠️ Requires Extension Needs to be combined with Spring AI Alibaba or other frameworks.

3. Spring AI Alibaba

3.1 What is it?

Spring AI Alibaba is an enterprise-grade Agent framework built by Alibaba Cloud based on Spring AI.

It is not just a localized implementation of Spring AI (e.g., connecting to domestic models like Tongyi Qianwen), but an Agentic AI development framework tailored specifically for Java developers.

Since version 1.1.2.x, Spring AI Alibaba has upgraded from a simple "model access tool" to a complete intelligent agent development framework. Its core architecture includes six major modules, covering the entire chain from Agent development to visual management.

3.2 Graph Engine: The Core Weapon

The biggest highlight of Spring AI Alibaba is the Graph workflow engine, designed specifically for multi-Agent collaboration and complex task orchestration.

Graph is a low-level workflow and multi-agent coordination framework. Its core design concepts include:

image.png

① Multi-Agent Collaboration Architecture

Built-in standard patterns like ReAct Agent and Supervisor. In a customer service scenario, a Supervisor agent can decompose a complex problem into multiple sub-tasks, assign them to ReAct Agents with domain knowledge for processing, and finally aggregate the results to return to the user.

② Visual Workflow Orchestration

Provides a node library aligned with mainstream low-code platforms, including 20+ standard components such as conditional branches, parallel processing, and exception catching. Developers can build complex processes through drag-and-drop, significantly lowering the barrier to entry for non-professional developers.

③ Enhanced State Management

Provides enterprise-grade features like process snapshots (automatically saving execution state, supporting fault recovery), memory persistence (cross-session state retention), and human-in-the-loop nodes (inserting manual confirmation steps).

3.3 Full Feature Panorama

image.png

Specifically includes:

3.4 New Capabilities in Version 1.1.2.0

The 1.1.2.0 version released in February 2026 brought several core upgrades:

3.5 Code Example

Below is a simplified example of building a ReAct Agent using Spring AI Alibaba:

// 1. Configure ChatModel (using Tongyi Qianwen DashScope as an example)
@Configuration
public class AiConfig {
    @Bean
    public ChatModel chatModel() {
        return new DashScopeChatModel(
            DashScopeChatOptions.builder()
                .withApiKey("your-api-key")
                .withModel("qwen-max")
                .build()
        );
    }
    
    @Bean
    public ChatClient chatClient(ChatModel chatModel) {
        return ChatClient.builder(chatModel).build();
    }
}

// 2. Define Agent
@Service
public class WeatherAgentService {
    
    @Autowired
    private ChatClient chatClient;
    
    // Using ReAct Agent pattern
    public String askWeather(String question) {
        // Spring AI Alibaba has built-in ReAct Agent
        // Automatically performs the Think -> Act -> Observe loop
        return chatClient.prompt()
            .system("You are a weather query assistant, you can call weather API tools")
            .user(question)
            .call()
            .content();
    }
}

// 3. Use in Controller
@RestController
public class AgentController {
    @Autowired
    private WeatherAgentService agentService;
    
    @GetMapping("/ask")
    public String ask(@RequestParam String question) {
        return agentService.askWeather(question);
    }
}

3.6 Pros and Cons

Pros:

Cons:

3.7 Applicable Scenarios

Scenario Recommendation Reason
Multi-Agent Collaboration Systems ✅✅✅ Highly Recommended Graph engine + Multi-Agent orchestration are core capabilities.
Complex Workflow Orchestration ✅✅✅ Highly Recommended 20+ standard components + visual orchestration.
Domestic Large Model Access ✅✅✅ Highly Recommended Native support for Tongyi Qianwen/Tongyi Wanxiang.
Long-Running Processes Requiring State Persistence ✅✅✅ Highly Recommended Process snapshots + memory persistence.
Domestic Deployment/Compliance Requirements ✅✅✅ Highly Recommended Data stays in-country, good access performance.
Simple Single-Agent Scenarios ⚠️ Potentially Over-Engineered Spring AI 2.0 is sufficient.

4. Comprehensive Side-by-Side Comparison

4.1 Core Differences at a Glance

Comparison Dimension Spring AI 2.0 Spring AI Alibaba
Developer Spring Official (VMware) Alibaba Cloud
Core Positioning Atomic Abstractions for AI Engineering Enterprise Intelligent Agent Orchestration Center
Design Philosophy Avoid vendor lock-in, unified abstraction Cloud-native Multi-Agent Orchestration
Analogy JDBC / Servlet API LangGraph
Latest Version 2.0.0 GA (2026-06-12) 1.1.2.0 (2026-02)
GitHub Stars 32k+ 10k+
Core Capabilities ChatClient, Tool Calling, RAG, Memory Graph Engine, Multi-Agent, A2A, Visual Platform
Multi-Agent Orchestration Basic (requires self-extension) ✅ Native (Sequential/Parallel/Routing/Loop)
Graph Workflow ✅ Core Feature
Domestic Model Support Via adapters ✅ Native Deep Integration
Visual Development ✅ One-Stop Agent Platform
A2A Distributed ✅ Integrated with Nacos
Learning Curve Low Medium to High
Applicable Scenarios Standard AI Application Access Complex Multi-Agent Systems

4.2 The Relationship Between the Two: Not Replacement, but Complement

A very precise summary is: Spring AI 2.0 provides "atomic abstractions," while Spring AI Alibaba provides an "enterprise orchestration runtime."

Spring AI 2.0 lets you connect to AI—just like JDBC lets you connect to a database. It provides unified multimodal APIs like ChatClient and EmbeddingClient, eliminating strong dependencies on underlying model providers.

Spring AI Alibaba, on this foundation, lets you orchestrate multiple AIs—just like Spring Cloud lets you orchestrate multiple microservices. Through its Graph engine, Multi-Agent patterns, A2A communication, and other capabilities, it organizes multiple AI Agents into a collaborative, observable, and recoverable enterprise-grade system.

5. Which One Should You Choose?

Scenarios for Choosing Spring AI 2.0

Scenarios for Choosing Spring AI Alibaba

Best Practice: Use Them Together

The two frameworks are not an "either-or" relationship; they can be used together.

Spring AI Alibaba itself is built on top of Spring AI, and the two APIs are compatible.

A typical combination plan is:

This way, you get both Spring AI's standardized abstraction and Spring AI Alibaba's enterprise-grade orchestration capabilities—the best of both worlds.

For more project practices, visit my tech website: susan.net.cn/project

6. Final Words

Returning to the original question: Spring AI 2.0 and Spring AI Alibaba, which one is better?

The answer is not "which is stronger," but "which is more suitable for your scenario."

Spring AI 2.0 is the AI abstraction layer carefully crafted by the Spring official team—restrained, standard, and portable. Like JDBC, it lets you access various AI models through a unified interface. If you just need to "connect to AI," it is the best choice.

Spring AI Alibaba is the orchestration framework precipitated by Alibaba Cloud in its enterprise AI implementation practice—powerful, complete, and cloud-native. Like Spring Cloud, it lets you orchestrate multiple AI Agents to work together. If you need to "make multiple AIs work together," it is the best choice.

Even better, the two can be used together.

Spring AI Alibaba itself is built on Spring AI. You can absolutely start by laying the foundation with Spring AI 2.0, and then introduce Spring AI Alibaba's Graph engine for complex orchestration.