Deploy a knowledge base - Amazon Bedrock

Deploy a knowledge base

To deploy a knowledge base in your application, set it up to make Retrieve or RetrieveAndGenerate requests to the knowledge base. To see how to use these API operations, select the API tab in Test a knowledge base in Amazon Bedrock.

You can also associate the knowledge base with an agent and the agent will invoke it when necessary during orchestration. For more information, see Agents for Amazon Bedrock. Select the tab corresponding to your method of choice and follow the steps.

Console
To associate a knowledge base with an agent
  1. Sign in to the AWS Management Console, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/.

  2. From the left navigation pane, select Agents.

  3. Choose the agent to which you want to add a knowledge base.

  4. In the Working draft section, choose Working draft.

  5. In the Knowledge bases section, select Add.

  6. Choose a knowledge base from the dropdown list under Select knowledge base and specify the instructions for the agent regarding how it should interact with the knowledge base and return results.

To dissociate a knowledge base with an agent
  1. Sign in to the AWS Management Console, and open the Amazon Bedrock console at https://console.aws.amazon.com/bedrock/.

  2. From the left navigation pane, select Agents.

  3. Choose the agent to which you want to add a knowledge base.

  4. In the Working draft section, choose Working draft.

  5. In the Knowledge bases section, choose a knowledge base.

  6. Select Delete.

API

To associate a knowledge base with an agent, send an AssociateAgentKnowledgeBase request.

  • Include a detailed description to provide instructions for how the agent should interact with the knowledge base and return results.

  • Set the knowledgeBaseState to ENABLED to allow the agent to query the knowledge base.

You can update an knowledge base that is associated with an agent by sending an UpdateAgentKnowledgeBase request. For example, you might want to set the knowledgeBaseState to ENABLED to troubleshoot an issue. 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.

To dissociate a knowledge base with an agent, send a DisassociateAgentKnowledgeBase request.