Create multi-agent collaboration
Creating a multi-agent collaboration comprises of the following steps:
-
Create and deploy collaborator agents. Make sure to configure each collaborator agent to implement a specific task within the multi-agent collaboration work flow.
-
Create a new supervisor agent or assign an existing agent the role of the supervisor. When you create a new supervisor agent or identify an existing agent as a supervisor agent, you can also specify how you want the supervisor agent to handle information across multiple collaborator agents.
You can assign the supervisor agent the task of coordinating responses from the collaborator agents or you can assign the supervisor agent the task of routing information to the appropriate collaborator agent to send the final response. Assigning the supervisor agent the task of routing information reduces the latency.
-
Associate the alias version of the collaborator agents with the supervisor agent.
Note
You can associate a maximum of 10 collaborator agents with a supervisor agent at this time.
-
Prepare and test your multi-agent collaboration team.
-
Deploy and invoke supervisor agent.
You can create multi-agent collaboration in the Amazon Bedrock console, using the APIs, using the AWS CLI, or by using the AWS SDK. To learn how to create a multi-agent collaboration, choose the tab for your preferred method, and then follow the steps:.
- Console
-
Step 1: Create collaborator agents
-
Follow instructions to Create and configure an agent. Make sure to configure each collaborator agent to perform a specific task.
Step 2: Create a new supervisor agent or assign supervisor role to an existing agent
-
If you are creating a new supervisor agent follow instructions to Create and configure agent manually and then continue with the next step.
If you already have an agent configured and want to assign supervisor role to the agent, continue with the next step.
-
If you're not already in the agent builder, do the following:
-
Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/
. -
Select Agents from the left navigation pane. Then, choose an agent in the Agents section.
-
Choose Edit in Agent builder.
-
In the Agent builder, scroll down to the Multi-agent collaboration section and choose Edit.
-
-
In the Multi-agent collaboration page, in the Collaboration status section, turn on Multi-agent collaboration. This will identify the agent as a supervisor agent.
-
In the Collaboration configuration section, choose how you want the supervisor agent to handle information across multiple collaborator agents to coordinate a final response.
-
If you want supervisor agent to coordinate responses from the collaborator agents, select Supervisor.
-
If you want supervisor agent to route information to the appropriate collaborator agent to send the final response, select Supervisor with routing.
-
Continue with the next steps to add collaborator agents.
-
Step 3: Add collaborator agents
-
Expand the Agent collaborator section and provide details of the collaborator agent you created for multi-agent collaboration.
-
For Collaborator agent, select a collaborator agent and Agent aliasfrom the drop-down. You can choose View to view the details of the collaborator agent.
-
For Collaborator name, enter an alternate name for your collaborator agent. This name will not replace the original name of this agent.
-
In Collaboration instructions, enter the details for when this collaborator should be used by the supervisor agent.
-
(Optional) Turn on Enable conversation history if you want the supervisor agent to share context from previous conversations with this collaborator agent. If this is turned on, the supervisor will include the full history of the current session, including the user input text and the supervisor agent response from each turn of the conversation.
-
-
Choose Add collaborator to add this collaborator agent in your multi-agent-collaboration team. To add more collaborator agents, repeat step 1 until you've added all your collaborator agents.
-
When you've finished adding collaborator agents, select one of the following options:
-
To stay in the Multi-agent collaboration, choose Save and continue with the next step to prepare and test your multi-agents collaboration team.
-
To return to the Agent Details page, choose Save and exit.
-
Step 4: Prepare and test a multi-agent collaboration
-
Follow instructions to prepare and test your multi-agent collaboration team.
Step 5: Deploy a multi-agent collaboration
-
Deploy multi-agent collaboration by setting up the supervisor agent to make an
InvokeAgent
request.
-
- API
-
Complete the following steps to create a multi-agent collaboration team,
Step 1: Create collaborator agents
-
Follow instructions to Create and configure an agent. Make sure to configure each collaborator agent to perform a specific task.
Step 2: Create a new supervisor agent or assign supervisor role to an existing agent
-
To create a new supervisor agent, send a CreateAgent request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint.
To assign a supervisor role to an existing agent, send an UpdateAgent request with an Agents for Amazon Bedrock build-time endpoint. Because all fields will be overwritten, include both fields that you want to update as well as fields that you want to keep the same.
You must minimally include the following fields:
Field Use case agentResourceRoleArn To specify an ARN of the service role with permissions to call API operations on the agent foundationModel To specify a foundation model (FM) for the agent to orchestrate with instruction To provide instructions to tell the agent what to do. Used in the $instructions$ placeholder of the orchestration prompt template. agentCollaboration To assign supervisor role to the agent.
Specify
SUPERVISOR
if you want the supervisor agent to coordinate responses from collaborator agents and output the response.Specify
SUPERVISOR_ROUTER
if you want supervisor agent to route information to the appropriate collaborator agent to send the final response.By default, this field is set to
DISABLED
.The following fields are optional:
Field Use case description Describes what the agent does idleSessionTTLInSeconds Duration after which the agent ends the session and deletes any stored information. customerEncryptionKeyArn ARN of a KMS key to encrypt agent resources tags To associate tags with your agent. promptOverrideConfiguration To customize the prompts sent to the FM at each step of orchestration. guardrailConfiguration To add a guardrail to the agent. Specify the ID or ARN of the guardrail and the version to use. clientToken To ensure the API request completes only once. For more information, see Ensuring idempotency. The response returns an CreateAgent object that contains details about your newly created supervisor agent. If your agent fails to be created, the CreateAgent object in the response returns a list of
failureReasons
and a list ofrecommendedActions
for you to troubleshoot.
Step 3: Add collaborator agents
-
To associate collaborator agents with the supervisor agent, send a
AssociateAgentCollaborator
request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint.You must minimally include the following fields:
Field Use case collaboratorName To specify an alternate name for the collaborator agent. This name will appear only in collaboration instructions and does not replace the original agent name. agentDescriptor To specify the agent's alias Arn. collaborationInstruction To provide instructions to tell the collaborator agent what to do. collaboratorState Set to ENABLED
to associate this collaborator agent with the supervisor agent.relayConversationHistory Set to
TO_COLLABORATOR
to specify that the supervisor agent will share context from previous conversations with this collaborator agent.Valid values:
TO_COLLABORATOR
|DISABLED
.
Step 4: Prepare and test your multi-agent collaborator team
-
Follow instructions to prepare and test your multi-agent collaboration team.
Step 4: Deploy your multi-agent collaboration team
-
Deploy your multi-agent collaboration team by setting up your supervisor agent to make an
InvokeAgent
request.
-