Repository navigation
Introduce multiagent pattern practices and docs. - #910
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces seven multi-agent pattern examples for AgentScope (Supervisor, Pipeline, Routing, Skills, Subagent, Handoffs, and Workflow), along with corresponding documentation updates in both English and Chinese.
Changes:
- Added seven new Spring Boot example modules under
agentscope-examples/multiagent-patterns/demonstrating various multi-agent orchestration patterns built on Spring AI Alibaba Graph and AgentScope. - Added new documentation pages in
docs/en/multi-agent/anddocs/zh/multi-agent/covering each pattern, plus a newagent-as-tool.mdfeature doc. - Updated
docs/_toc.ymlto reorganize the Multi Agent section and add the new pattern pages, and corrected cross-reference links in existing docs.
Reviewed changes
Copilot reviewed 137 out of 139 changed files in this pull request and generated 29 comments.
Show a summary per file
| File | Description |
|---|---|
agentscope-examples/pom.xml |
Registers the 7 new multiagent-patterns submodules |
agentscope-examples/multiagent-patterns/supervisor/ |
Supervisor pattern: central ReActAgent delegates calendar/email tasks as sub-agent tools |
agentscope-examples/multiagent-patterns/pipeline/ |
Pipeline patterns: SequentialAgent, ParallelAgent, LoopAgent with AgentScopeAgent sub-agents |
agentscope-examples/multiagent-patterns/routing/ |
Routing pattern: classifies queries, invokes GitHub/Notion/Slack specialist agents in parallel |
agentscope-examples/multiagent-patterns/skills/ |
Skills (progressive disclosure) pattern: SQL assistant loads skill schemas on demand |
agentscope-examples/multiagent-patterns/subagent/ |
Subagent pattern: orchestrator delegates to Markdown/API-defined sub-agents via Task tools |
agentscope-examples/multiagent-patterns/workflow/ |
Custom workflow pattern: RAG and SQL agents using StateGraph with H2 in-memory DB |
agentscope-examples/multiagent-patterns/handoffs/ |
Handoffs pattern: sales/support agents with state-driven routing between graph nodes |
agentscope-examples/quarkus/src/main/resources/application.properties |
Adds native build configuration |
docs/_toc.yml |
Adds new multi-agent pattern pages to TOC, reorganizes the Multi Agent section |
docs/en/task/agent-as-tool.md |
New English documentation for Agent as Tool feature |
docs/en/multi-agent/supervisor.md, skills.md |
New English pattern documentation |
docs/zh/multi-agent/supervisor.md, skills.md |
New Chinese pattern documentation |
docs/en/multi-agent/multiagent-debate.md, docs/zh/multi-agent/multiagent-debate.md |
Updated links to new patterns |
docs/en/task/tool.md, docs/zh/task/tool.md |
Fixed relative links to agent-as-tool.md |
docs/en/task/msghub.md, docs/zh/task/msghub.md |
Fixed cross-directory links to pipeline/multiagent-debate |
docs/en/intro.md, docs/zh/intro.md |
Removed MsgHub from top-level multi-agent section |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
LearningGp
approved these changes
Mar 17, 2026
liangxingguang
pushed a commit
to liangxingguang/agentscope-java
that referenced
this pull request
May 21, 2026
…tscope-ai#910) Multi-agent systems coordinate specialized agents or components to handle complex workflows. Not every complex task needs multiple agents—a single agent with the right tools and prompt can often suffice. This pull request introduces several supervisor, handoffs, routing, etc. multiagent patterns that are built on Spring AI Alibaba Graph and AgentScope. ## Examples ### 1. Supervisor - **Location**: `agentscope-examples/multiagent-patterns/supervisor` - **Description**: A central supervisor ReActAgent exposes calendar and email as tools (`schedule_event`, `manage_email`), invokes them from user requests, and combines results. Specialist capabilities are implemented as AgentScope ReActAgents with Model and registered via `Toolkit.registration().subAgent()`. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/supervisor spring-boot:run`. Optionally set `supervisor.run-examples=true` to run two sample conversations (calendar + email) on startup. --- ### 2. Pipeline - **Location**: `agentscope-examples/multiagent-patterns/pipeline` - **Description**: Uses Spring AI Alibaba **SequentialAgent**, **ParallelAgent**, and **LoopAgent** with **AgentScopeAgent** sub-agents and AgentScope Model (DashScopeChatModel). - **SequentialAgent** (`sequential_sql_agent`): Natural language → SQL generation → SQL scoring. - **ParallelAgent** (`parallel_research_agent`): One topic researched in parallel from technology, finance, and market angles; results merged into one report. - **LoopAgent** (`loop_sql_refinement_agent`): Loops “generate SQL → score” until score > 0.5. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/pipeline spring-boot:run`. Optionally set `pipeline.runner.enabled=true` to run all three pipeline demos on startup. --- ### 3. Routing - **Location**: `agentscope-examples/multiagent-patterns/routing` - **Description**: Classifies the user query, invokes specialist AgentScopeAgents (GitHub, Notion, Slack) in parallel, and synthesizes results into one answer. - **Simple**: `AgentScopeRoutingAgent` + `RouterService` (invoke router then synthesize). - **Graph**: StateGraph with preprocess → routing node (LlmRoutingAgent) → postprocess. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/routing spring-boot:run`. Optionally set `routing.runner.enabled=true` or `routing-graph.runner.enabled=true` for the corresponding demo. --- ### 4. Skills (progressive disclosure) - **Location**: `agentscope-examples/multiagent-patterns/skills` - **Description**: A single SQL assistant ReActAgent loads skills from classpath `skills/` (e.g. sales_analytics, inventory_management) via AgentScope **ClasspathSkillRepository** and **SkillBox**. The model sees only skill descriptions first and loads full SKILL.md on demand with the **read_skill** tool. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/skills spring-boot:run`. Optionally set `skills.runner.enabled=true` to run one sample query on startup. --- ### 5. Subagent - **Location**: `agentscope-examples/multiagent-patterns/subagent` - **Description**: A central orchestrator (AgentScopeAgent) delegates work to multiple sub-agents (e.g. codebase-explorer, web-researcher, dependency-analyzer) via Task / TaskOutput tools. Sub-agents can be defined in Markdown or in code (ReActAgent/AgentScopeAgent); the orchestrator is exposed via a CompiledGraph. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/subagent spring-boot:run`. Optionally set `subagent.run-interactive=true` for interactive chat. --- ### 6. Handoffs - **Location**: `agentscope-examples/multiagent-patterns/handoffs` - **Description**: Sales and support AgentScopeAgents as separate graph nodes. Tools (e.g. `transfer_to_support`, `transfer_to_sales`) update state (e.g. `active_agent`); the graph routes between nodes based on that state for role handoffs over multiple turns. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/handoffs spring-boot:run`. Optionally set `agentscope.runner.enabled=true` for the demo. Default port 8089; can be used with the chat UI. --- ### 7. Workflow (custom) - **Location**: `agentscope-examples/multiagent-patterns/workflow` - **Description**: Custom multi-step flows with StateGraph; two sub-examples: - **RAG** (`workflow.rag.enabled=true`): Query → rewrite → retrieve → prepare → Agent (ReActAgent + context) → response. - **SQL** (`workflow.sql.enabled=true`): list_tables → get_schema → generate_query (AgentScopeAgent + SQL tools), using H2 in-memory with a Chinook-like schema. - **Run**: - RAG: `./mvnw -pl agentscope-examples/multiagent-patterns/workflow spring-boot:run -Dspring-boot.run.arguments="--workflow.rag.enabled=true --workflow.runner.enabled=true"` - SQL: Same, but use `--workflow.sql.enabled=true` instead of `--workflow.rag.enabled=true`.
wzl521
pushed a commit
to wzl521/agentscope-java
that referenced
this pull request
Aug 12, 2026
…tscope-ai#910) Multi-agent systems coordinate specialized agents or components to handle complex workflows. Not every complex task needs multiple agents—a single agent with the right tools and prompt can often suffice. This pull request introduces several supervisor, handoffs, routing, etc. multiagent patterns that are built on Spring AI Alibaba Graph and AgentScope. ## Examples ### 1. Supervisor - **Location**: `agentscope-examples/multiagent-patterns/supervisor` - **Description**: A central supervisor ReActAgent exposes calendar and email as tools (`schedule_event`, `manage_email`), invokes them from user requests, and combines results. Specialist capabilities are implemented as AgentScope ReActAgents with Model and registered via `Toolkit.registration().subAgent()`. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/supervisor spring-boot:run`. Optionally set `supervisor.run-examples=true` to run two sample conversations (calendar + email) on startup. --- ### 2. Pipeline - **Location**: `agentscope-examples/multiagent-patterns/pipeline` - **Description**: Uses Spring AI Alibaba **SequentialAgent**, **ParallelAgent**, and **LoopAgent** with **AgentScopeAgent** sub-agents and AgentScope Model (DashScopeChatModel). - **SequentialAgent** (`sequential_sql_agent`): Natural language → SQL generation → SQL scoring. - **ParallelAgent** (`parallel_research_agent`): One topic researched in parallel from technology, finance, and market angles; results merged into one report. - **LoopAgent** (`loop_sql_refinement_agent`): Loops “generate SQL → score” until score > 0.5. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/pipeline spring-boot:run`. Optionally set `pipeline.runner.enabled=true` to run all three pipeline demos on startup. --- ### 3. Routing - **Location**: `agentscope-examples/multiagent-patterns/routing` - **Description**: Classifies the user query, invokes specialist AgentScopeAgents (GitHub, Notion, Slack) in parallel, and synthesizes results into one answer. - **Simple**: `AgentScopeRoutingAgent` + `RouterService` (invoke router then synthesize). - **Graph**: StateGraph with preprocess → routing node (LlmRoutingAgent) → postprocess. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/routing spring-boot:run`. Optionally set `routing.runner.enabled=true` or `routing-graph.runner.enabled=true` for the corresponding demo. --- ### 4. Skills (progressive disclosure) - **Location**: `agentscope-examples/multiagent-patterns/skills` - **Description**: A single SQL assistant ReActAgent loads skills from classpath `skills/` (e.g. sales_analytics, inventory_management) via AgentScope **ClasspathSkillRepository** and **SkillBox**. The model sees only skill descriptions first and loads full SKILL.md on demand with the **read_skill** tool. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/skills spring-boot:run`. Optionally set `skills.runner.enabled=true` to run one sample query on startup. --- ### 5. Subagent - **Location**: `agentscope-examples/multiagent-patterns/subagent` - **Description**: A central orchestrator (AgentScopeAgent) delegates work to multiple sub-agents (e.g. codebase-explorer, web-researcher, dependency-analyzer) via Task / TaskOutput tools. Sub-agents can be defined in Markdown or in code (ReActAgent/AgentScopeAgent); the orchestrator is exposed via a CompiledGraph. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/subagent spring-boot:run`. Optionally set `subagent.run-interactive=true` for interactive chat. --- ### 6. Handoffs - **Location**: `agentscope-examples/multiagent-patterns/handoffs` - **Description**: Sales and support AgentScopeAgents as separate graph nodes. Tools (e.g. `transfer_to_support`, `transfer_to_sales`) update state (e.g. `active_agent`); the graph routes between nodes based on that state for role handoffs over multiple turns. - **Run**: `./mvnw -pl agentscope-examples/multiagent-patterns/handoffs spring-boot:run`. Optionally set `agentscope.runner.enabled=true` for the demo. Default port 8089; can be used with the chat UI. --- ### 7. Workflow (custom) - **Location**: `agentscope-examples/multiagent-patterns/workflow` - **Description**: Custom multi-step flows with StateGraph; two sub-examples: - **RAG** (`workflow.rag.enabled=true`): Query → rewrite → retrieve → prepare → Agent (ReActAgent + context) → response. - **SQL** (`workflow.sql.enabled=true`): list_tables → get_schema → generate_query (AgentScopeAgent + SQL tools), using H2 in-memory with a Chinook-like schema. - **Run**: - RAG: `./mvnw -pl agentscope-examples/multiagent-patterns/workflow spring-boot:run -Dspring-boot.run.arguments="--workflow.rag.enabled=true --workflow.runner.enabled=true"` - SQL: Same, but use `--workflow.sql.enabled=true` instead of `--workflow.rag.enabled=true`.
4 of 5 tasks
xzxiaoshan
added a commit
that referenced
this pull request
Oct 14, 2026
Follow-up to #3526, from the same CI build-time investigation. ## Summary - Build both the Linux and Windows jobs in parallel with `-T1C` (one thread per core) using the standard Maven preinstalled on both runners, replacing the single-threaded `-T1` (Windows previously ran mvnd pinned to `-T1`, so it never actually built in parallel). - Drop mvnd entirely from the Windows job: `MVND_VERSION`, the `Cache mvnd` / `Install mvnd` steps, `mvnd-cache-path` in the matrix, and `-Dmvnd.maxLostKeepAlive=120`. - Companion commit (deliberately separate from the workflow change): raise the hardcoded 10s `.block(...)` timeout in `AnthropicChatModelAuthenticationTest.assertExchange` to 30s. This was the only failure observed under heavy parallel test load (32 concurrent test JVMs) — a test-robustness issue unrelated to build correctness, but one that would pollute the CI signal under `-T1C`. ## Why `-T1` can be lifted - `-T1` was introduced in #910 to keep reactor order so agentscope-core is built before the modules that resolve it. That rationale does not hold: `clean verify` never installs anything, and Maven's parallel builder schedules modules by the dependency graph, so reactor ordering is guaranteed at any thread count. - The failure `-T1` actually papered over was spotless lock contention under mvnd's parallel execution (`spotless-maven-plugin:check failed: Could not acquire lock(s)`, about a dozen modules). Reproduced locally on the #910 tree with mvnd 1.0.3 at default parallelism; the same tree with standard Maven at `-T1C` (32 threads) builds clean, and spotless 3.3.0/3.4.0 under 12-way standard-Maven concurrency shows no lock errors. The module that originally triggered it was removed in cc3b2ee (2026-06). - Linux already builds with standard Maven because of mvnd problems (the embedded distribution broke Surefire IPC, #3080). Moving Windows to standard `mvn` removes the remaining mvnd-specific failure sources plus the mvnd install/cache overhead. ## Rollback Workflow/command-line-level change only — no artifact content changes; reverting the commit fully rolls back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-agent systems coordinate specialized agents or components to handle complex workflows. Not every complex task needs multiple agents—a single agent with the right tools and prompt can often suffice.
This pull request introduces several supervisor, handoffs, routing, etc. multiagent patterns that are built on Spring AI Alibaba Graph and AgentScope.
Examples
1. Supervisor
agentscope-examples/multiagent-patterns/supervisorschedule_event,manage_email), invokes them from user requests, and combines results. Specialist capabilities are implemented as AgentScope ReActAgents with Model and registered viaToolkit.registration().subAgent()../mvnw -pl agentscope-examples/multiagent-patterns/supervisor spring-boot:run. Optionally setsupervisor.run-examples=trueto run two sample conversations (calendar + email) on startup.2. Pipeline
agentscope-examples/multiagent-patterns/pipelinesequential_sql_agent): Natural language → SQL generation → SQL scoring.parallel_research_agent): One topic researched in parallel from technology, finance, and market angles; results merged into one report.loop_sql_refinement_agent): Loops “generate SQL → score” until score > 0.5../mvnw -pl agentscope-examples/multiagent-patterns/pipeline spring-boot:run. Optionally setpipeline.runner.enabled=trueto run all three pipeline demos on startup.3. Routing
agentscope-examples/multiagent-patterns/routingAgentScopeRoutingAgent+RouterService(invoke router then synthesize)../mvnw -pl agentscope-examples/multiagent-patterns/routing spring-boot:run. Optionally setrouting.runner.enabled=trueorrouting-graph.runner.enabled=truefor the corresponding demo.4. Skills (progressive disclosure)
agentscope-examples/multiagent-patterns/skillsskills/(e.g. sales_analytics, inventory_management) via AgentScope ClasspathSkillRepository and SkillBox. The model sees only skill descriptions first and loads full SKILL.md on demand with the read_skill tool../mvnw -pl agentscope-examples/multiagent-patterns/skills spring-boot:run. Optionally setskills.runner.enabled=trueto run one sample query on startup.5. Subagent
agentscope-examples/multiagent-patterns/subagent./mvnw -pl agentscope-examples/multiagent-patterns/subagent spring-boot:run. Optionally setsubagent.run-interactive=truefor interactive chat.6. Handoffs
agentscope-examples/multiagent-patterns/handoffstransfer_to_support,transfer_to_sales) update state (e.g.active_agent); the graph routes between nodes based on that state for role handoffs over multiple turns../mvnw -pl agentscope-examples/multiagent-patterns/handoffs spring-boot:run. Optionally setagentscope.runner.enabled=truefor the demo. Default port 8089; can be used with the chat UI.7. Workflow (custom)
agentscope-examples/multiagent-patterns/workflowworkflow.rag.enabled=true): Query → rewrite → retrieve → prepare → Agent (ReActAgent + context) → response.workflow.sql.enabled=true): list_tables → get_schema → generate_query (AgentScopeAgent + SQL tools), using H2 in-memory with a Chinook-like schema../mvnw -pl agentscope-examples/multiagent-patterns/workflow spring-boot:run -Dspring-boot.run.arguments="--workflow.rag.enabled=true --workflow.runner.enabled=true"--workflow.sql.enabled=trueinstead of--workflow.rag.enabled=true.