View a markdown version of this page

GetMemory - Amazon OpenSearch Memory

GetMemory

Gets a memory by ID, as returned by SearchMemories or ListMemories. A memory that doesn't exist returns ResourceNotFoundException. Unlike SearchMemories, this operation also returns memories that consolidation has superseded.

A memory past its expiry (set from the space's memoryExpiryDays when the memory is written) reads as not found: ResourceNotFoundException, the same answer as for an ID that does not exist.

If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with AccessDeniedException if you aren't allowed to use the key, and with ThrottlingException if AWS KMS throttles the request. It fails with ValidationException if the key is disabled, pending deletion, or deleted.

Request Syntax

{ "actorId": "string", "memoryId": "string", "spaceId": "string", "strategyName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

actorId

The identifier of the actor associated with the memory. This value is intended for authorization: IAM policies can reference it in condition keys to allow or deny the request.

Type: String

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

Pattern: [a-zA-Z0-9][a-zA-Z0-9-_]*

Required: No

memoryId

The memory's ID, as returned by SearchMemories or ListMemories.

Type: String

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

Required: Yes

spaceId

The ID of the space that holds the memory.

Type: String

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

Pattern: sp-[a-f0-9]{12}

Required: Yes

strategyName

The name of the memory extraction strategy associated with the memory. This value is intended for authorization: IAM policies can reference it in condition keys to allow or deny the request.

Type: String

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

Required: No

Response Syntax

{ "memory": { "content": "string", "memoryId": "string", "memoryType": "string", "metadata": { "string" : "string" }, "strategyName": "string", "systemMetadata": { "actorId": "string", "createdAt": "string", "sessionId": "string", "updatedAt": "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.

memory

The memory. Always present: a memory that doesn't exist returns ResourceNotFoundException.

Type: Memory object

Errors

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

AccessDeniedException

You don't have sufficient access to perform this operation. To use this operation, you must have AWS Identity and Access Management (IAM) permissions for the operation, and on the resource it acts on. If the space uses a customer managed AWS Key Management Service (AWS KMS) key, you must also have permission to use the key.

message

A message that describes which access the request is missing.

HTTP Status Code: 403

InternalServerException

The service couldn't process the request because of an internal error. Retry the request.

message

A message that describes the internal error.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource doesn't exist. Check the IDs in the request.

message

A message that describes which resource wasn't found.

resourceId

The ID of the resource that wasn't found.

resourceType

The type of the resource that wasn't found.

HTTP Status Code: 404

ThrottlingException

The service throttled the request. Retry the request with exponential backoff.

message

A message that describes the throttling.

retryAfterSeconds

The number of seconds to wait before you retry the request.

HTTP Status Code: 429

ValidationException

The request isn't valid. The reason, message, and fieldList members describe the problem. Fix the request, and then try again.

fieldList

The fields that failed validation, if any.

message

A message that describes why the request failed validation, such as the field, key, or limit involved.

reason

The reason that the request failed validation.

HTTP Status Code: 400

See Also

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