Multi-Agent Collaboration
Use a coordinator formation to let one coordinator agent orchestrate multiple member agents that work together on a task.
Multi-Agent Collaboration
Multi-agent collaboration lets a coordinator agent orchestrate a group of member agents. When multiagent is not configured or the formation is empty, the agent runs as a single agent.
Formation Configuration
Configure the formation through the multiagent field when creating or updating an agent.
| Field | Description |
|---|---|
type | Collaboration topology. Only coordinator is currently supported. |
agents | Roster entries, 1–20 items. Pass an empty array to clear the formation. |
Fields of each entry in agents:
| Field | Description |
|---|---|
type | Entry type: agent (references another Agent) or self (the coordinator itself, at most one per formation). |
id | ID of the referenced agent. Required when type=agent (up to 64 characters); must not be set when type=self. |
version | Version of the referenced agent. Optional when type=agent (>=1; the latest version is used if omitted); must not be set when type=self. |
NotePassing an empty array "agents": [] clears the formation, and the agent falls back to running as a single agent.
Configuration Example
The following creates an agent with a coordinator formation that includes the coordinator itself (self) and one referenced member agent (agent). For full parameter and response field details, see the Create Agent API.
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/agents" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-coordinator",
"model": {"id": "qwen3.8-max"},
"multiagent": {
"type": "coordinator",
"agents": [
{"type": "self"},
{"type": "agent", "id": "agent_researcher", "version": 3}
]
}
}'
agent = client.agents.create(
name="my-coordinator",
model="qwen3.8-max",
multiagent={
"type": "coordinator",
"agents": [
{"type": "self"},
{"type": "agent", "id": "agent_researcher", "version": 3},
],
},
)
print(agent.id)
Agent agent = client.agents().create(AgentCreateParam.builder()
.name("my-coordinator")
.model("qwen3.8-max")
.multiagent(MultiAgentConfig.builder()
.type("coordinator")
.agents(List.of(
RosterEntry.builder().type("self").build(),
RosterEntry.builder().type("agent").id("agent_researcher").version(3L).build()))
.build())
.build());
System.out.println(agent.getId());
Next Steps
- Define an Agent: Configure the formation on an agent.
- Dynamic Workflow: Orchestrate multiple agents with JavaScript.
- Create a Session: Start a session with the agent that has a formation configured.