# Spring AI Alibaba

> Production-ready Java framework for agentic, workflow, and multi-agent apps

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: Java
- Licence: Apache-2.0
- Repository: https://github.com/alibaba/spring-ai-alibaba
- Website: https://java2ai.com
- Canonical page: https://ai-tldr.dev/tools/spring-ai-alibaba/

## In short

Spring AI Alibaba is an open-source framework for Java developers who want to build AI agents, workflows, and multi-agent systems. It builds on the core concepts of Spring AI, so it fits naturally into existing Spring Boot projects and the wider JVM ecosystem. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Java and licensed Apache-2.0.

## Overview

Spring AI Alibaba is an open-source framework for Java developers who want to build AI agents, workflows, and multi-agent systems. It builds on the core concepts of Spring AI, so it fits naturally into existing Spring Boot projects and the wider JVM ecosystem.

The project has three main layers. The Agent Framework lets you build agents quickly with built-in context engineering and human-in-the-loop support. The Graph layer is the underlying runtime that handles persistence, workflow orchestration, and streaming for long-running stateful agents. The Admin platform adds a visual, one-stop way to develop, observe, evaluate, and manage agents.

It supports multiple LLM providers such as DashScope and OpenAI, tool calling, and the Model Context Protocol (MCP). For complex flows it ships ready-made patterns including SequentialAgent, ParallelAgent, RoutingAgent, and LoopAgent.

## What it does

- Multi-agent orchestration with built-in patterns: SequentialAgent, ParallelAgent, RoutingAgent, and LoopAgent for complex tasks.
- Context engineering best practices built in, including human-in-the-loop, context compaction and editing, tool retry, planning, and dynamic tool selection.
- Graph-based workflow runtime with conditional routing, nested graphs, parallel execution, and state management; export to PlantUML and Mermaid.
- Multimodal and voice support, including image understanding and a WebSocket-based real-time voice agent.
- Rich model, tool, and MCP support across providers like DashScope and OpenAI, leaning on Spring AI core concepts.
- A2A (Agent-to-Agent) communication with Nacos integration for distributed coordination, plus a one-stop visual Admin platform.

## Getting started

You need JDK 17 or newer and an API key from your chosen LLM provider. The fastest way to see it run is the community ChatBot example included in the repository.

1. Clone the repository

   Download the source so you have the bundled examples available locally.

```shell
git clone --depth=1 https://github.com/alibaba/spring-ai-alibaba.git
cd spring-ai-alibaba
```

2. Set your API key

   This example uses the DashScope starter. Get an API key from Aliyun Bailian and export it before running.

```shell
export AI_DASHSCOPE_API_KEY=your-api-key
```

3. Start the ChatBot

   Run the example module with the Maven wrapper, then open the chat UI in your browser at http://localhost:8080/chatui/index.html.

```shell
./mvnw -pl examples/chatbot spring-boot:run
```

4. Add it to your own project

   Declare the agent framework and a model starter (DashScope shown here) in your Maven dependencies.

```xml
<dependencies>
  <dependency>
    <groupId>com.alibaba.cloud.ai</groupId>
    <artifactId>spring-ai-alibaba-agent-framework</artifactId>
    <version>1.1.2.0</version>
  </dependency>
  <dependency>
    <groupId>com.alibaba.cloud.ai</groupId>
    <artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
    <version>1.1.2.1</version>
  </dependency>
</dependencies>
```

## When to use it

- Building production agents inside existing Spring Boot applications without leaving the Java stack.
- Orchestrating multi-agent systems using sequential, parallel, routing, and loop patterns for complex tasks.
- Designing graph-based workflows with conditional routing, parallel steps, and persistent state for long-running agents.
- Adding real-time voice agents or multimodal image understanding to a JVM service.
