spring-ai-alibaba

alibabaApache-2.0活跃维护

面向 Java 开发者的智能体 AI 框架,基于 Spring AI 构建,支持 ReAct 智能体、多智能体协作和基于图的工作流编排。

Agentic AI Framework for Java Developers

v1.1.2.2发布于 2026-03-10 09:32 UTC11,132star +21 / 7 天2,471fork同步于 2026-11-10 23:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone --depth=1 https://github.com/alibaba/spring-ai-alibaba.git
cd spring-ai-alibaba
export AI_DASHSCOPE_API_KEY=your-api-key
./mvnw -pl examples/chatbot spring-boot:run
硬件要求按 README 说明

README 未说明显存或 GPU 要求,仅要求 JDK 17+,并需自选 LLM 提供商并获取 API-KEY

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向 Java 开发者的生产级 Agentic AI 框架,用 Spring 生态快速搭建智能体与多智能体工作流

面向 Java 开发者的智能体 AI 框架,基于 Spring AI 构建,支持 ReAct 智能体、多智能体协作和基于图的工作流编排。

核心能力

  • 内置 SequentialAgent、ParallelAgent、RoutingAgent、LoopAgent 多智能体编排模式
  • 提供 Context Engineering 策略,含 human-in-the-loop、上下文压缩与工具重试
  • 基于 Graph 的工作流运行时,支持条件路由、嵌套图、并行执行与状态管理
  • 支持 DashScope、OpenAI 等多家模型及工具调用与 MCP 协议
  • 提供可视化 Admin 平台与 Studio 调试界面,支持 A2A 与 Nacos 集成

容易踩的坑

需先自行申请 DashScope 等模型提供商的 API-KEY,否则示例无法启动;示例默认占用 8080 端口,访问路径为 /chatui/index.html;使用 OpenAI 或 DeepSeek 需替换 starter 依赖,README 未给出具体坐标

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.1.2.2
  1. v2.0.0-M1.1pre-release2026-06-25 · 2026-06-25 05:46 UTC
    查看更新说明

    Highlights

    Milestone release upgrading to Spring AI 2.0.0-M1 and Spring Boot 4.0.0.

    Dependency Upgrade

    • Spring AI: 1.1.2 → 2.0.0-M1
    • Spring AI Alibaba Extensions → 2.0.0-M1.1
    • Spring Boot: 3.5.8 → 4.0.0
    • Redisson: 3.22.0 → 3.52.0
    • Removed explicit driver dependency versions for MySQL, PostgreSQL, and Oracle (now managed by Spring Boot BOM)
  2. v1.1.2.2最新正式版2026-03-10 · 2026-03-10 09:32 UTC

    AgentScope Integration

    AgentScope Java is an agent-oriented programming framework for building LLM-powered applications.

    # Add the following dependency to ochestrate AgentScope using SAA Graph
    <dependency>
      <groupId>com.alibaba.cloud.ai</groupId>
      <artifactId>spring-ai-alibaba-starter-agentscope</artifactId>
      <version>1.1.2.2</version>
    </dependency>
    

    Multiagent Patterns

    • Subagent – Main orchestrator delegates tasks to specialized sub-agents (codebase explorer, web researcher, etc.) via Task/TaskOutput tools; supports both Markdown and API-defined sub-agents.
    • Supervisor – Central supervisor agent wraps calendar and email agents as tools (AgentTool), invokes them on demand, and synthesizes results.
    • Skills – Single agent uses read_skill to load skill content on demand; system prompt shows only skill descriptions for progressive disclosure and smaller context.
    • Routing
      • Routing (simple) – LlmRoutingAgent classifies the user query, invokes specialist agents (GitHub, Notion, Slack) in parallel, then synthesizes a single answer.
      • Routing (graph) – LlmRoutingAgent as a StateGraph node with preprocess/postprocess and an internal merge node for routing and result synthesis.
    • Handoffs
      • Handoffs (single-agent) – One ReactAgent advances steps via state (e.g. current_step); a ModelInterceptor injects step-specific system prompt and tools per turn.
      • Handoffs (multi-agent) – Sales and support agents as graph nodes; handoff tools update active_agent and conditional edges route between agents.
    • Workflow – Custom workflow examples: RAG (rewrite → retrieve → prepare → agent) and SQL agent (list_tables → get_schema → run_query) as graph-based flows.

    Multimodal & Voice Agent

    • Voice Agent – Sandwich architecture (STT → ReactAgent → TTS): WebSocket-based real-time voice with DashScope ASR and CosyVoice TTS, plus text input; agent uses sandwich-order tools and streams events (stt_chunk, agent_chunk, tts_chunk).
    • Multimodal – Vision (image in/out) and TTS: DashScope vision models for image understanding and ReactAgent with media input; image generation via tools (Wanx), TTS via DashScopeAudioSpeechModel; ToolMultimodalResult for structured tool responses (url/base64).
  3. v1.1.2.12026-03-09 · 2026-03-09 01:42 UTC
    查看更新说明

    Please use 1.1.2.2 instead. 1.1.2.1 was reported with several bugs that have been fixed in 1.1.2.2.

  4. v1.1.2.02026-02-02 · 2026-02-02 04:24 UTC
    查看更新说明

    Summary

    This release upgrades Spring AI to 1.1.2, adds Agent Skills support for Agent Framework, adds parallel sub-agent execution for workflow agents (LlmRouting, Supervisor), extends the graph with parallel conditional edges, parallel aggregation strategy (allOf and anyOf), async tool execution, and tool returnDirect. It also includes serialization and MergeStrategy fixes, admin/UI fixes, and documentation updates.

    Please see the documentation for more details.

    Features

    Agent

    • Agent Skills in ReactAgent (#3975) — Integrated skills capabilities in ReactAgent, supports skill and too progressive disclosure.
    • Built-in multi-agent pattern support — Supports routing, supervisor, supervisor(agent as tool), handoffs, skills, etc., multi-agent patterns; added parallel execution support for routing and supervisor patterns.
    • Flow agent hook support (#3983) — All flow agent (routing, supervisor, loop, sequential, etc) supports customized Hooks.
    • New Agent API (#4031) — New streamMessages API for simplified message streaming; New overload invokeand callmethods for extra inputs.
    • Async and parallel tool execution (#4037) — Support tool execution in parallelization and asynchronous tool execution .
    • Tool returnDirect (#4139) — Support for tool returnDirect behavior.
    • ToolContextHelper (#4163) — Helper class for metadata access in tool context (fixes #3110).

    Graph

    • Parallel conditional edges (#4027) — Conditional edges support parallel execution (fixes #3917).
    • Aggregation strategy for parallel branches (#4028) — New aggregation strategy (AllOf and AnyOf) for parallel branches.
    • Batch addEdge for parallel branches (#3938) — Convenient batch addEdge methods for parallel branch definition in StateGraph.
    • interruptAfter hook (#3864) — InterruptableAction supports interruptAfter hook (fixes #3447, #3904).
    • Async tool execution for AgentToolNode (#4037 / #3988) — Async tool execution support for AgentToolNode.
    • Full output for streaming node (#3941) — Streaming nodes now emit full output including _FINISHED OutputType.

    Sandbox & Studio

    • SAA Sandbox (#4069) — New SAA Sandbox module that provides safe and isolated tool execution.
    • Built-in RenderTemplate (#3935) — Built-in customized RenderTemplate implementation.
    • Studio CORS optional (#4154) — CORS configuration is now optional in Studio.

    Fixes

    DashScopeChatModel

    • Connection reset reported in #3942 (spring-ai-alibaba/spring-ai-extensions#140) — Set default HTTP client for DashScopeApi to better manage connections, avoid Connection Reset issue when the connection is closed by model server.

    Graph

    • Serialization (#3969) — Fixed class bug in serialization (fixes #3895, #3931)..
    • MergeStrategy (#4129) — Corrected Optional handling and enforced strict type checks in MergeStrategy (fixes #3909).

    Agent

    • Instruction (#3974) — Added instruction handling; fixed CI and tests.
    • AgentLlmNode model options (#3986) — Prevent AgentLlmNode from overriding default model options; ensure internalToolExecution(false) is set for ChatOptions (fixes #3903).
    • selectorModel (#4045) — Added selectorModel support (fixes #4026).
    • systemPrompt (#4067) — Fixed system prompt handling.
    • ParallelAgent maxConcurrency (#4053) — Ensured maxConcurrency function of ParallelAgent is implemented.
    • jumpTo (#4081) — Ensured jumpTo operates correctly.
    • ModelRequest builder systemMessage (#4138) — ModelRequest builder no longer loses systemMessage.
    • NacosReactAgentBuilder (#4093) — Fixed NacosReactAgentBuilder to properly merge local tools.
    • AgentLlmNode tool callbacks (#4112) — Corrected tool callbacks filte
  5. v1.1.0.02025-12-30 · 2025-12-30 10:02 UTC
    查看更新说明

    The official Spring AI Alibaba release that built on Spring AI 1.1.0 and Spring AI Alibaba Extensions 1.1.0.0.

    Please check the documentation on our website for usage and upgrade guide.

    Please submit issues and follow the updates on the official website. We will try our best to keep the documentation up to date in the next few weeks.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Spring AI Alibaba

    License CI Status Ask DeepWiki Maven Central gitleaks badge

    Architecture

    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 built-in 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.

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

    • Multimodal Support: ReactAgent with text and media input (image understanding). ReactAgent with tool based image or audio generation.

    • Voice Agent: WebSocket-based real-time voice agent that supports streaming audio or text input and responds with generated audio.

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

    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.

      git clone --depth=1 https://github.com/alibaba/spring-ai-alibaba.git
      cd spring-ai-alibaba
      
    2. Start the ChatBot.

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

      # 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
      
      # Maven installation is optional when using mvnw.
      ./mvnw -pl examples/chatbot spring-boot:run
      
    3. Chat with ChatBot.

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

    Chatbot Code Explained

    1. Add dependencies

      <dependencies>
        <dependency>
          <groupId>com.alibaba.cloud.ai</groupId>
          <artifactId>spring-ai-alibaba-agent-framework</artifactId>
          <version>1.1.2.0</version>
        </dependency>
        <!-- Assume you are going to use DashScope Model. Refer to docs for how to choose model.-->
        <dependency>
          <groupId>com.alibaba.cloud.ai</groupId>
          <artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
          <version>1.1.2.1</version>
        </dependency>
      </dependencies>
      
    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

    RepositoryDescription⭐
    Spring AI Alibaba GraphA low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents.GitHub Repo stars
    Spring AI Alibaba AdminLocal visualization toolkit for the development of agent applications, supporting project management, runtime visualization, tracing, and agent evaluation.GitHub Repo stars
    Spring AI ExtensionsExtended implementations for Spring AI core concepts, including DashScopeChatModel, MCP registry, etc.GitHub Repo stars
    Spring AI Alibaba ExamplesSpring AI Alibaba Examples.GitHub Repo stars
    JManusA Java implementation of Manus built with Spring AI Alibaba, currently used in many applications within Alibaba Group.GitHub Repo stars
    DataAgentA natural language to SQL project based on Spring AI Alibaba, enabling you to query databases directly with natural language without writing complex SQL.GitHub Repo stars
    DeepResearchDeep Research implemented based on spring-ai-alibaba-graph.GitHub Repo stars

    Contact Us

    • Dingtalk Group (钉钉群), search 182255021470 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