CreateMemory - Amazon Bedrock AgentCore Control

CreateMemory

Creates a new memory.

Request Syntax

POST /memories/create HTTP/1.1 Content-type: application/json { "clientToken": "string", "description": "string", "encryptionKeyArn": "string", "eventExpiryDuration": number, "memoryExecutionRoleArn": "string", "memoryStrategies": [ { ... } ], "name": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

clientToken

A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request but does not return an error.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 500.

Required: No

description

The description of the memory.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 4096.

Required: No

encryptionKeyArn

The Amazon Resource Name (ARN) of the AWS KMS key used to encrypt the memory data.

Type: String

Pattern: arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[^/].{0,1023}

Required: No

eventExpiryDuration

The duration after which memory events expire. Specified as an ISO 8601 duration.

Type: Integer

Valid Range: Minimum value of 7. Maximum value of 365.

Required: Yes

memoryExecutionRoleArn

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the memory to access AWS services.

Type: String

Pattern: arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[^/].{0,1023}

Required: No

memoryStrategies

The memory strategies to use for this memory. Strategies define how information is extracted, processed, and consolidated.

Type: Array of MemoryStrategyInput objects

Required: No

name

The name of the memory. The name must be unique within your account.

Type: String

Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "memory": { "arn": "string", "createdAt": number, "description": "string", "encryptionKeyArn": "string", "eventExpiryDuration": number, "failureReason": "string", "id": "string", "memoryExecutionRoleArn": "string", "name": "string", "status": "string", "strategies": [ { "configuration": { "consolidation": { ... }, "extraction": { ... }, "type": "string" }, "createdAt": number, "description": "string", "name": "string", "namespaces": [ "string" ], "status": "string", "strategyId": "string", "type": "string", "updatedAt": number } ], "updatedAt": number } }

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.

memory

The details of the created memory, including its ID, ARN, name, description, and configuration settings.

Type: Memory object

Errors

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

AccessDeniedException

This exception is thrown when a request is denied per access permissions

HTTP Status Code: 403

ConflictException

This exception is thrown when there is a conflict performing an operation

HTTP Status Code: 409

ResourceNotFoundException

This exception is thrown when a resource referenced by the operation does not exist

HTTP Status Code: 404

ServiceException

An internal error occurred.

HTTP Status Code: 500

ServiceQuotaExceededException

This exception is thrown when a request is made beyond the service quota

HTTP Status Code: 402

ThrottledException

API rate limit has been exceeded.

HTTP Status Code: 429

ValidationException

The input fails to satisfy the constraints specified by the service.

HTTP Status Code: 400

See Also

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