GetMemory
Queries the content, associated scope, metadata, source, type, and validity status based on the memory ID.
Operation description
Queries a long-term memory based on the memory ID.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentcore:GetMemory |
get |
*MemoryStore
|
None | None |
Request syntax
GET /workspaces/{workspaceId}/memorystores/{memoryStoreName}/memories/{memoryId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| workspaceId |
string |
Yes |
The AgentCore workspace ID. |
ws-2f5f9c5a8d0e4c3b |
| memoryStoreName |
string |
Yes |
The MemoryStore name. |
customer-memory |
| memoryId |
string |
Yes |
The long-term memory ID. |
mem-2f5f9c5a8d0e4c3b |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
No parameters required.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| requestId |
string |
The request ID. |
01A00000-0000-0000-0000-000000000001 |
| message |
string |
The response message. |
success |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| code |
string |
The business status code. |
SUCCESS |
| success |
boolean |
Indicates whether the request is successful. |
|
| data |
object |
The long-term memory details. |
|
| memoryId |
string |
The long-term memory ID. |
mem-2f5f9c5a8d0e4c3b |
| content |
object |
The memory content. |
|
| text |
string |
The memory text. |
The user likes hiking |
| scope |
object |
The memory scope. |
|
| userId |
string |
The user ID. The length is limited to 1 to 128 UTF-8 bytes. The value cannot contain a forward slash (/) or an asterisk (*). This field is not returned if the memory is not associated with a user ID. |
user-001 |
| teamId |
string |
The business team ID defined by the caller. The value cannot be empty when provided and can be up to 128 UTF-8 bytes in length. |
team-001 |
| agentId |
string |
The agent ID. The length is limited to 1 to 128 UTF-8 bytes. The value cannot contain a forward slash (/) or an asterisk (*). This field is not returned if the memory is not associated with an agent ID. |
agent-001 |
| sessionId |
string |
The session ID. The length is limited to 1 to 128 UTF-8 bytes. The value cannot contain a forward slash (/) or an asterisk (*). This field is not returned if the memory is not associated with a session ID. |
session-001 |
| metadata |
object |
The memory metadata. |
{"topic":"hiking"} |
|
string |
The metadata value. |
hiking |
|
| source |
string |
The memory source. Valid values:
Valid values:
|
session_extraction |
| type |
string |
The memory content type. Valid values:
Valid values:
|
semantic |
| valid |
boolean |
Indicates whether the memory is valid. A value of false indicates that the memory is revoked and is not included in valid memory retrieval. |
|
| createdAt |
string |
The creation time. The time is in RFC 3339 format. The Z at the end of the example indicates the UTC time zone. |
2026-09-23T10:00:00Z |
| updatedAt |
string |
The last updated time. The time is in RFC 3339 format. The Z at the end of the example indicates the UTC time zone. |
2026-09-23T10:05:00Z |
Examples
Success response
JSON format
{
"requestId": "01A00000-0000-0000-0000-000000000001",
"message": "success",
"httpStatusCode": 200,
"code": "SUCCESS",
"success": false,
"data": {
"memoryId": "mem-2f5f9c5a8d0e4c3b",
"content": {
"text": "The user likes hiking"
},
"scope": {
"userId": "user-001",
"teamId": "team-001",
"agentId": "agent-001",
"sessionId": "session-001"
},
"metadata": {
"key": "hiking"
},
"source": "session_extraction",
"type": "semantic",
"valid": false,
"createdAt": "2026-09-23T10:00:00Z",
"updatedAt": "2026-09-23T10:05:00Z"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified request parameter is invalid. | |
| 400 | UnsupportedOperation | The memory store does not support this operation. | |
| 500 | UnknownError | The request processing has failed due to some unknown error. | |
| 403 | Forbidden | You are not authorized to perform this operation. | |
| 404 | Resource.NotFound | The specified memory store does not exist. | |
| 429 | Throttling | Request was denied due to request throttling. | |
| 409 | Operation.Conflict | The memory store is not in a state that permits this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.