Enable agent memory
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
-
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 details section, for Select model, make sure to select either Claude 3 Sonnet or Claude 3 Haiku.
-
In the Memory section, do the following:
-
Select Enabled.
-
(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.
-
-
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.