BedrockAgentCore / Client / list_memory_records

list_memory_records

BedrockAgentCore.Client.list_memory_records(**kwargs)

Lists memory records in an AgentCore Memory resource based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

To use this operation, you must have the bedrock-agentcore:ListMemoryRecords permission.

See also: AWS API Documentation

Request Syntax

response = client.list_memory_records(
    memoryId='string',
    namespace='string',
    memoryStrategyId='string',
    maxResults=123,
    nextToken='string'
)
Parameters:
  • memoryId (string) –

    [REQUIRED]

    The identifier of the AgentCore Memory resource for which to list memory records.

  • namespace (string) –

    [REQUIRED]

    The namespace prefix to filter memory records by. Returns all memory records in namespaces that start with the provided prefix.

  • memoryStrategyId (string) – The memory strategy identifier to filter memory records by. If specified, only memory records with this strategy ID are returned.

  • maxResults (integer) – The maximum number of results to return in a single call. The default value is 20.

  • nextToken (string) – The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Return type:

dict

Returns:

Response Syntax

{
    'memoryRecordSummaries': [
        {
            'memoryRecordId': 'string',
            'content': {
                'text': 'string'
            },
            'memoryStrategyId': 'string',
            'namespaces': [
                'string',
            ],
            'createdAt': datetime(2015, 1, 1),
            'score': 123.0,
            'metadata': {
                'string': {
                    'stringValue': 'string'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • memoryRecordSummaries (list) –

      The list of memory record summaries that match the specified criteria.

      • (dict) –

        Contains summary information about a memory record.

        • memoryRecordId (string) –

          The unique identifier of the memory record.

        • content (dict) –

          The content of the memory record.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: text. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • text (string) –

            The text content of the memory record.

        • memoryStrategyId (string) –

          The identifier of the memory strategy associated with this record.

        • namespaces (list) –

          The namespaces associated with this memory record.

          • (string) –

        • createdAt (datetime) –

          The timestamp when the memory record was created.

        • score (float) –

          The relevance score of the memory record when returned as part of a search result. Higher values indicate greater relevance to the search query.

        • metadata (dict) –

          A map of metadata key-value pairs associated with a memory record.

          • (string) –

            • (dict) –

              Value associated with the eventMetadata key.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • stringValue (string) –

                Value associated with the eventMetadata key.

    • nextToken (string) –

      The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.

Exceptions

  • BedrockAgentCore.Client.exceptions.ServiceQuotaExceededException

  • BedrockAgentCore.Client.exceptions.ThrottledException

  • BedrockAgentCore.Client.exceptions.ServiceException

  • BedrockAgentCore.Client.exceptions.AccessDeniedException

  • BedrockAgentCore.Client.exceptions.ValidationException

  • BedrockAgentCore.Client.exceptions.InvalidInputException

  • BedrockAgentCore.Client.exceptions.ResourceNotFoundException