BedrockAgentCore / Client / batch_create_memory_records

batch_create_memory_records

BedrockAgentCore.Client.batch_create_memory_records(**kwargs)

Creates multiple memory records in a single batch operation for the specified memory with custom content.

See also: AWS API Documentation

Request Syntax

response = client.batch_create_memory_records(
    memoryId='string',
    records=[
        {
            'requestIdentifier': 'string',
            'namespaces': [
                'string',
            ],
            'content': {
                'text': 'string'
            },
            'timestamp': datetime(2015, 1, 1),
            'memoryStrategyId': 'string'
        },
    ],
    clientToken='string'
)
Parameters:
  • memoryId (string) –

    [REQUIRED]

    The unique ID of the memory resource where records will be created.

  • records (list) –

    [REQUIRED]

    A list of memory record creation inputs to be processed in the batch operation.

    • (dict) –

      Input structure to create a new memory record.

      • requestIdentifier (string) – [REQUIRED]

        A client-provided identifier for tracking this specific record creation request.

      • namespaces (list) – [REQUIRED]

        A list of namespace identifiers that categorize or group the memory record.

        • (string) –

      • content (dict) – [REQUIRED]

        The content to be stored within the memory record.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: text.

        • text (string) –

          The text content of the memory record.

      • timestamp (datetime) – [REQUIRED]

        Time at which the memory record was created.

      • memoryStrategyId (string) –

        The ID of the memory strategy that defines how this memory record is grouped.

  • clientToken (string) –

    A unique, case-sensitive identifier to ensure idempotent processing of the batch request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'successfulRecords': [
        {
            'memoryRecordId': 'string',
            'status': 'SUCCEEDED'|'FAILED',
            'requestIdentifier': 'string',
            'errorCode': 123,
            'errorMessage': 'string'
        },
    ],
    'failedRecords': [
        {
            'memoryRecordId': 'string',
            'status': 'SUCCEEDED'|'FAILED',
            'requestIdentifier': 'string',
            'errorCode': 123,
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • successfulRecords (list) –

      A list of memory records that were successfully created during the batch operation.

      • (dict) –

        Output information returned after processing a memory record operation.

        • memoryRecordId (string) –

          The unique ID associated to the memory record.

        • status (string) –

          The status of the memory record operation (e.g., SUCCEEDED, FAILED).

        • requestIdentifier (string) –

          The client-provided identifier that was used to track this record operation.

        • errorCode (integer) –

          The error code returned when the memory record operation fails.

        • errorMessage (string) –

          A human-readable error message describing why the memory record operation failed.

    • failedRecords (list) –

      A list of memory records that failed to be created, including error details for each failure.

      • (dict) –

        Output information returned after processing a memory record operation.

        • memoryRecordId (string) –

          The unique ID associated to the memory record.

        • status (string) –

          The status of the memory record operation (e.g., SUCCEEDED, FAILED).

        • requestIdentifier (string) –

          The client-provided identifier that was used to track this record operation.

        • errorCode (integer) –

          The error code returned when the memory record operation fails.

        • errorMessage (string) –

          A human-readable error message describing why the memory record operation failed.

Exceptions

  • BedrockAgentCore.Client.exceptions.ServiceQuotaExceededException

  • BedrockAgentCore.Client.exceptions.ThrottledException

  • BedrockAgentCore.Client.exceptions.ServiceException

  • BedrockAgentCore.Client.exceptions.AccessDeniedException

  • BedrockAgentCore.Client.exceptions.ValidationException

  • BedrockAgentCore.Client.exceptions.ResourceNotFoundException