GetAgentMemoryCommand

Gets the sessions stored in the memory of the agent.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { BedrockAgentRuntimeClient, GetAgentMemoryCommand } from "@aws-sdk/client-bedrock-agent-runtime"; // ES Modules import
// const { BedrockAgentRuntimeClient, GetAgentMemoryCommand } = require("@aws-sdk/client-bedrock-agent-runtime"); // CommonJS import
const client = new BedrockAgentRuntimeClient(config);
const input = { // GetAgentMemoryRequest
  nextToken: "STRING_VALUE",
  maxItems: Number("int"),
  agentId: "STRING_VALUE", // required
  agentAliasId: "STRING_VALUE", // required
  memoryType: "SESSION_SUMMARY", // required
  memoryId: "STRING_VALUE", // required
};
const command = new GetAgentMemoryCommand(input);
const response = await client.send(command);
// { // GetAgentMemoryResponse
//   nextToken: "STRING_VALUE",
//   memoryContents: [ // Memories
//     { // Memory Union: only one key present
//       sessionSummary: { // MemorySessionSummary
//         memoryId: "STRING_VALUE",
//         sessionId: "STRING_VALUE",
//         sessionStartTime: new Date("TIMESTAMP"),
//         sessionExpiryTime: new Date("TIMESTAMP"),
//         summaryText: "STRING_VALUE",
//       },
//     },
//   ],
// };

GetAgentMemoryCommand Input

See GetAgentMemoryCommandInput for more details

Parameter
Type
Description
agentAliasId
Required
string | undefined

The unique identifier of an alias of an agent.

agentId
Required
string | undefined

The unique identifier of the agent to which the alias belongs.

memoryId
Required
string | undefined

The unique identifier of the memory.

memoryType
Required
MemoryType | undefined

The type of memory.

maxItems
number | undefined

The maximum number of items to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

nextToken
string | undefined

If the total number of results is greater than the maxItems value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

GetAgentMemoryCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
memoryContents
Memory[] | undefined

Contains details of the sessions stored in the memory

nextToken
string | undefined

If the total number of results is greater than the maxItems value provided in the request, use this token when making another request in the nextToken field to return the next batch of results.

Throws

Name
Fault
Details
AccessDeniedException
client

The request is denied because of missing access permissions. Check your permissions and retry your request.

BadGatewayException
server

There was an issue with a dependency due to a server issue. Retry your request.

ConflictException
client

There was a conflict performing an operation. Resolve the conflict and retry your request.

DependencyFailedException
client

There was an issue with a dependency. Check the resource configurations and retry the request.

InternalServerException
server

An internal server error occurred. Retry your request.

ResourceNotFoundException
client

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

ServiceQuotaExceededException
client

The number of requests exceeds the service quota. Resubmit your request later.

ThrottlingException
client

The number of requests exceeds the limit. Resubmit your request later.

ValidationException
client

Input validation failed. Check your request parameters and retry the request.

BedrockAgentRuntimeServiceException
Base exception class for all service exceptions from BedrockAgentRuntime service.