Spring AI 2.0 vs Spring AI Alibaba: Which Framework Fits Your Needs?

This article compares Spring AI 2.0 and Spring AI Alibaba, detailing their architectures, core capabilities, pros and cons, and ideal scenarios, and explains how the two can be combined to leverage both atomic AI integration and enterprise‑grade multi‑agent orchestration.

Su San Talks Tech
Su San Talks Tech
Su San Talks Tech
Spring AI 2.0 vs Spring AI Alibaba: Which Framework Fits Your Needs?

Release Overview

Spring AI 2.0 GA (2026‑06‑12) is built on Spring Boot 4.1 and Spring Framework 7.0, adopts JSpecify null‑safety annotations and Jackson 3 for serialization. Spring AI Alibaba GA (2026‑05‑13) is Alibaba Cloud’s enterprise‑grade extension, currently at version 1.0 GA with over 10k GitHub stars, and is built on top of Spring AI.

Fundamental Difference

Spring AI 2.0 provides an atomic abstraction that connects enterprise data and APIs to LLMs, treating AI models like JDBC or WebClient middleware. Spring AI Alibaba adds a multi‑agent orchestration layer and a Graph workflow engine on top of that abstraction, enabling complex agent collaboration.

Spring AI 2.0

Architecture

Model Adapter Layer : Translates unified API calls to vendor‑specific request formats.

Core Abstraction Layer : Defines interfaces such as ChatClient, EmbeddingClient, ImageClient.

Advanced Feature Layer : Implements prompt templates, function calling, Retrieval‑Augmented Generation (RAG), and basic agent support.

Integration Layer : Provides seamless integration with other Spring components.

Key upgrades in 2.0

Tool Calling as a first‑class citizen : Extracted from individual chat models and handled by ChatClient via ToolCallingAdvisor.

New ToolCallback API : Tools must be registered as ToolCallback beans and passed through .tools(). Introduces ToolSearchToolCallingAdvisor for on‑demand discovery.

Self‑correcting structured output : Adds EntityParamSpec for per‑call structured output configuration.

Memory management optimisation : MessageWindowChatMemory now truncates at turn boundaries, avoiding mid‑dialog cuts and duplicate memory in tool prompts.

Focused model support : Core providers are OpenAI, Anthropic, Amazon Bedrock, Google GenAI, with SDK‑style integration.

Code example

@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(r -> ChatResponse.builder()
                .content(r.getResult().getOutput().getContent())
                .build());
    }
}

Pros

Seamless Spring integration : One‑click Boot starter for Spring developers.

Vendor lock‑in avoidance : Unified multimodal APIs.

Full AI feature set : Tool calling, RAG, memory, multi‑model, basic agent flow.

Strong structured output : Maps unstructured text to typed POJOs.

Production‑ready features : Built‑in retry, rate‑limiting, observability.

Cons

Intentional scope limitation : Not an Agent Framework; multi‑agent capabilities are limited.

Breaking changes from 1.x : Migration required for ToolCallback API and others.

Advanced workflow orchestration : Must be built by users for complex scenarios.

Typical scenarios

Standard AI application integration (chat, RAG, single‑agent + tool calling).

Existing Spring Boot projects that need a lightweight AI abstraction.

Spring AI Alibaba

Graph engine – core weapon

Multi‑Agent collaboration architecture : Built‑in ReAct Agent, Supervisor, etc., for task decomposition and aggregation.

Visual workflow composition : Over 20 standard components (condition branches, parallel processing, exception handling) for drag‑and‑drop flow design.

Enhanced state management : Automatic snapshots, persistent memory, manual‑intervention nodes.

Feature panorama

Multi‑Agent orchestration : SequentialAgent, ParallelAgent, RoutingAgent, LoopAgent.

Multimodal support : ReactAgent handles text, images, and tool‑driven image/audio generation.

Voice agent : Real‑time speech agent via WebSocket.

Context engineering : Strategies for human‑AI collaboration, context compression, tool retry, dynamic tool selection.

Graph workflow : Conditional routing, nested graphs, parallel execution, state export to PlantUML/Mermaid.

A2A support : Agent‑to‑Agent communication integrated with Nacos for distributed coordination.

One‑stop agent platform : Visual development, deployment, observability, evaluation, and MCP management.

New capabilities in 1.1.2.0 (2026‑02)

Agent Skills : Lightweight, open‑format extensions for knowledge‑ and workflow‑driven agent abilities.

Parallel multi‑agent execution : Supports parallel branches and aggregation strategies (AllOf/AnyOf).

Asynchronous tool execution : Enhanced with returnDirect.

Underlying Spring AI upgrade to 1.1.2.

Code example

// 1. Configure ChatModel (e.g., DashScope)
@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 ReAct Agent service
@Service
public class WeatherAgentService {
    @Autowired
    private ChatClient chatClient;
    public String askWeather(String question) {
        return chatClient.prompt()
            .system("你是一个天气查询助手,可以调用天气API工具")
            .user(question)
            .call()
            .content();
    }
}

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

Pros

Powerful Graph engine : Designed for complex multi‑agent collaboration.

Comprehensive enterprise features : Snapshots, persistent memory, manual‑intervention nodes.

Native Chinese model support : Deep integration with Tongyi Qianwen, Tongyi Wanxiang.

Visual development : Drag‑and‑drop agent platform.

A2A distributed support : Nacos‑based coordination.

Cons

Alignment lag with Spring AI 2.0 : Currently based on Spring AI 1.1.2.

Steeper learning curve : Graph engine and multi‑agent concepts require time to master.

Newer ecosystem : Community and star count lower than Spring AI.

Typical scenarios

Multi‑agent collaboration systems.

Complex workflow orchestration with state, long‑running processes.

Domestic deployment with Chinese LLMs.

Projects that benefit from visual development and distributed agent coordination.

Side‑by‑Side Comparison

Developer : Spring AI 2.0 – Spring (VMware); Spring AI Alibaba – Alibaba Cloud.

Core positioning : Atomic AI abstraction vs. enterprise‑grade agent orchestration.

Design philosophy : Vendor‑agnostic, unified abstraction vs. cloud‑native multi‑agent orchestration.

Analogy : JDBC/Servlet API vs. LangGraph.

Latest release : 2.0.0 GA (2026‑06‑12) vs. 1.1.2.0 (2026‑02).

GitHub stars : 32k+ vs. 10k+.

Core capabilities : ChatClient, tool calling, RAG, memory vs. Graph engine, multi‑agent, A2A, visual platform.

Multi‑agent support : Basic (requires extension) vs. native (Sequential/Parallel/Routing/Loop).

Graph workflow : Not provided vs. core feature.

Chinese model support : Via adapters vs. native deep integration.

Visual development : Not available vs. one‑stop visual platform.

Distributed A2A : Not available vs. integrated with Nacos.

Learning curve : Low vs. medium‑high.

Choosing the Right Framework

When to pick Spring AI 2.0

Only need to integrate AI capabilities (standard chat, RAG, single‑agent + tool calling).

Prefer to avoid vendor lock‑in and keep the stack lightweight.

Team is already familiar with the Spring ecosystem.

Low learning curve and minimal additional orchestration.

When to pick Spring AI Alibaba

Require multi‑agent collaboration and complex workflow orchestration.

Need native support for Chinese large models.

Deploying within China and care about latency and compliance.

Want visual development and enterprise‑grade state management.

Need distributed agent coordination (A2A) via Nacos.

Open‑source repositories

Spring AI 2.0: https://github.com/spring-projects/spring-ai

Spring AI Alibaba: https://github.com/alibaba/spring-ai-alibaba

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Spring AITool callingEnterprise AISpring AI AlibabaMulti‑agent orchestrationGraph workflowJava AI frameworks
Su San Talks Tech
Written by

Su San Talks Tech

Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.