Configure memory for your Amazon Bedrock agent - Amazon Bedrock

Configure memory for your Amazon Bedrock agent

To configure memory for your agent, you must first enable memory and then optionally specify the retention period for the memory. You can enable memory for your agent when you create or update your agent.

To learn how to configure memory for your agent, select the tab corresponding to your method of choice and follow steps.

Console
To configure memory for your agent
  1. If you're not already in the agent builder, do the following:

    1. 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/.

    2. Select Agents from the left navigation pane. Then, choose an agent in the Agents section.

    3. Choose Edit in Agent Builder

  2. In the Agent details section, for Select model, make sure to select either Claude 3 Sonnet or Claude 3 Haiku.

  3. In the Memory section, do the following:

    1. Select Enabled.

    2. (Optional) By default, agent retains conversational context for 30 days. To configure a custom retention period, enter a number between 1 and 30 to specify the memory duration for your agent.

  4. Make sure to first Save and then Prepare to apply the changes you have made to the agent before testing it.

API

To enable and configure memory for your agent, send an CreateAgent or UpdateAgent request with an Agents for Amazon Bedrock build-time endpoint.

In the Amazon Bedrock API, you specify the memoryConfiguration when you send a an CreateAgent or UpdateAgent request.

The following shows the general format of the memoryConfiguration:

"memoryConfiguration": { "enabledMemoryTypes": [ "SESSION_SUMMARY" ], "storageDays":30 },

You can optionally configure the memory retention period by assigning the storageDays with a number between 1 and 30 days.

Note

If you enable memory for the agent and do not specify memoryId when you invoke the agent, agent will not store that specific turn in the memory.