View a markdown version of this page

BatchUpdateMemoryRecords - Amazon Bedrock AgentCore Data Plane
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

BatchUpdateMemoryRecords

Updates multiple memory records with custom content in a single batch operation within the specified memory.

Request Syntax

POST /memories/memoryId/memoryRecords/batchUpdate HTTP/1.1 Content-type: application/json { "recordExpirySpecification": { ... }, "records": [ { "content": { ... }, "memoryRecordId": "string", "memoryStrategyId": "string", "metadata": { "string" : { ... } }, "namespaces": [ "string" ], "sourceNamespaces": [ "string" ], "timestamp": number } ] }

URI Request Parameters

The request uses the following URI parameters.

memoryId

The unique ID of the memory resource where records will be updated.

Length Constraints: Minimum length of 12.

Pattern: (arn:(aws|aws-cn|aws-us-gov):bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:memory/)?[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}

Required: Yes

Request Body

The request accepts the following data in JSON format.

recordExpirySpecification

The record expiry (long-term memory time-to-live) applied to every record updated by this request. Set recordExpiryDurationDays to configure or overwrite the number of days after which the records expire, or set action to REMOVE to clear a previously configured expiry so that the records no longer expire.

When you do not provide this value, the service determines each record's expiry from its current state:

  • If the record already has an expiry configured, the service resets and reapplies the expiry based on the last applied recordExpiryDurationDays.

  • If the record does not have an expiry configured, no expiry is applied and the record remains non-expiring. This is the outcome regardless of whether the record's strategy configures an expiry.

Providing an explicit recordExpiryDurationDays always takes precedence: it overwrites an existing expiry, or sets one on a record that previously had none.

Type: RecordExpirySpecification object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: No

records

A list of memory record update inputs to be processed in the batch operation.

Type: Array of MemoryRecordUpdateInput objects

Array Members: Minimum number of 0 items. Maximum number of 100 items.

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "failedRecords": [ { "errorCode": number, "errorMessage": "string", "memoryRecordId": "string", "requestIdentifier": "string", "status": "string" } ], "successfulRecords": [ { "errorCode": number, "errorMessage": "string", "memoryRecordId": "string", "requestIdentifier": "string", "status": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

failedRecords

A list of memory records that failed to be updated, including error details for each failure.

Type: Array of MemoryRecordOutput objects

successfulRecords

A list of memory records that were successfully updated during the batch operation.

Type: Array of MemoryRecordOutput objects

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.

HTTP Status Code: 403

ResourceNotFoundException

The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.

HTTP Status Code: 404

ServiceException

The service encountered an internal error. Try your request again later.

HTTP Status Code: 500

ServiceQuotaExceededException

The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.

HTTP Status Code: 402

ThrottledException

The request was denied due to request throttling. Reduce the frequency of requests and try again.

HTTP Status Code: 429

ValidationException

The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: