MCPcopy Index your code
hub / github.com/alibaba/spring-ai-alibaba

github.com/alibaba/spring-ai-alibaba @v2.0.0-M1.1 sqlite

repository ↗ · DeepWiki ↗ · release v2.0.0-M1.1 ↗
19,741 symbols 91,379 edges 2,256 files 4,061 documented · 21%
README

Spring AI Alibaba

License CI Status Ask DeepWiki Maven central gitleaks badge

A production-ready framework for building Agentic, Workflow, and Multi-agent applications.

Agent Framework Docs, Graph Docs, Spring AI, Examples.

Architecture

<img src="https://github.com/alibaba/spring-ai-alibaba/raw/v2.0.0-M1.1/docs/imgs/architecture-new.png" alt="architecture" style="max-width: 740px; height: auto" />

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 builtin 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 and SupervisorAgent.

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, LlmRoutingAgent, and LoopAgent for complex task execution.

  • 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.

    architecture

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.

  1. Download the code.

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

  2. Start the ChatBot.

    Before starting, set API-KEY first (visit Aliyun Bailian to get API-KEY): ```shell

    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 ```

    shell mvn spring-boot:run

  3. Chat with ChatBot.

    Open the browser and visit http://localhost:8080/chatui/index.html to chat with the ChatBot.

    chatbot-ui

Chatbot Code Explained

  1. Add dependencies

    ```xml com.alibaba.cloud.ai spring-ai-alibaba-agent-framework 1.1.2.0

    com.alibaba.cloud.ai spring-ai-alibaba-starter-dashscope 1.1.2.1 ```

  2. Define Chatbot

    For more details of how to write a Chatbot, please check the Quick Start on our official website.

📚 Documentation

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 130240015687 and 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.

Star History

Star History Chart


Made with ❤️ by the Spring AI Alibaba Team

Extension points exported contracts — how you extend this code

AgentToolCallback (Interface)
Title agent tool callback. Description agent tool callback. @since 1.0.0.3 [6 implementers]
spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/agent/tool/AgentToolCallback.java
MessageDTO (Interface)
Base interface for message DTOs with polymorphic serialization support. Uses Jackson annotations for type discrimination [10 …
spring-ai-alibaba-studio/src/main/java/com/alibaba/cloud/ai/agent/studio/dto/messages/MessageDTO.java
Prioritized (Interface)
Interface for objects that can be prioritized and sorted by their order value. Classes implementing this interface c [11 …
spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/Prioritized.java
KeyStrategy (Interface)
Strategy interface for generating cache keys based on input parameters and the overall state. This interface extends BiF [105 …
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/KeyStrategy.java
CodeExecutor (Interface)
@author HeYQ @since 2024-12-02 17:15 [4 implementers]
spring-boot-starters/spring-ai-alibaba-starter-builtin-nodes/src/main/java/com/alibaba/cloud/ai/graph/node/code/CodeExecutor.java
EvaluatorVersionService (Interface)
(no doc) [7 implementers]
spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/EvaluatorVersionService.java
MessageDTO (Interface)
(no doc) [5 implementers]
spring-ai-alibaba-studio/agent-chat-ui/src/lib/spring-ai-api.ts
AgentRegistry (Interface)
@author xiweng.yy [2 implementers]
spring-boot-starters/spring-ai-alibaba-starter-a2a-nacos/src/main/java/com/alibaba/cloud/ai/a2a/core/registry/AgentRegistry.java

Core symbols most depended-on inside this repo

get
called by 3235
spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/api/AppAPI.java
of
called by 2181
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/state/Channel.java
map
called by 1636
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/async/AsyncGenerator.java
push
called by 1633
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/146-d6e9a367e424464b.js
put
called by 1459
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/checkpoint/BaseCheckpointSaver.java
get
called by 1379
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/skills/registry/SkillRegistry.java
forEach
called by 854
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/146-d6e9a367e424464b.js
isEmpty
called by 841
spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/store/Store.java

Shape

Method 11,233
Function 5,207
Class 2,354
Interface 773
Enum 174

Languages

Java58%
TypeScript42%
Python1%

Modules by API surface

spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/resources/static/main.js3,476 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/146-d6e9a367e424464b.js705 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/framework-92fe0709eb3fe4d5.js441 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/e610e9eb-8deba821626819b0.js430 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/75146d7d-7a23bbf06fbcf463.js307 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/polyfills-42372ed130431b0a.js212 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/main-677a513809f18e96.js146 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/9670-abdaec9aa9c93e16.js97 symbols
spring-ai-alibaba-studio/src/main/resources/META-INF/resources/chatui/_next/static/chunks/app/page-860f772a0822cd35.js86 symbols
spring-boot-starters/spring-ai-alibaba-starter-builtin-nodes/src/main/java/com/alibaba/cloud/ai/graph/node/HttpNode.java69 symbols
spring-ai-alibaba-admin/frontend/packages/main/src/legacy/services/evaluators/typing.ts69 symbols
examples/documentation/src/main/java/com/alibaba/cloud/ai/examples/documentation/framework/tutorials/AgentsExample.java61 symbols

Dependencies from manifests, versioned

cglib:cglib3.3.0 · 1×
ch.qos.logback:logback-classic
co.elastic.clients:elasticsearch-java
com.alibaba.cloud.ai:spring-ai-alibaba-admin-server-core
com.alibaba.cloud.ai:spring-ai-alibaba-admin-server-openapi
com.alibaba.cloud.ai:spring-ai-alibaba-admin-server-runtime
com.alibaba.cloud.ai:spring-ai-alibaba-agent-framework
com.alibaba.cloud.ai:spring-ai-alibaba-autoconfigure-arms-observation1.0.0.4 · 1×
com.alibaba.cloud.ai:spring-ai-alibaba-bom
com.alibaba.cloud.ai:spring-ai-alibaba-core
com.alibaba.cloud.ai:spring-ai-alibaba-extensions-bom
com.alibaba.cloud.ai:spring-ai-alibaba-graph-core1.0.0.4 · 1×

Datastores touched

(mysql)Database · 1 repos
adminDatabase · 1 repos

For agents

$ claude mcp add spring-ai-alibaba \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact