Amazon Bedrock AgentCore

2026/08/19 - Amazon Bedrock AgentCore - 7 updated api methods

Changes  AgentCore Memory now supports Flexible Namespaces and Non-Conversational Payloads in CreateEvent API

BatchDeleteMemoryRecords (updated) Link ¶
Changes (request)
{'records': {'namespace': 'string'}}

Deletes multiple memory records in a single batch operation from the specified memory.

See also: AWS API Documentation

Request Syntax

client.batch_delete_memory_records(
    memoryId='string',
    records=[
        {
            'memoryRecordId': 'string',
            'namespace': 'string'
        },
    ]
)
type memoryId:

string

param memoryId:

[REQUIRED]

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

type records:

list

param records:

[REQUIRED]

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

  • (dict) --

    Input structure to delete an existing memory record.

    • memoryRecordId (string) -- [REQUIRED]

      The unique ID of the memory record to be deleted.

    • namespace (string) --

      The namespace of the memory record being deleted. This value is used for IAM condition key authorization.

rtype:

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 deleted 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 deleted, 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.

BatchUpdateMemoryRecords (updated) Link ¶
Changes (request)
{'records': {'sourceNamespaces': ['string']}}

Updates multiple memory records with custom content in a single batch operation within the specified memory.

See also: AWS API Documentation

Request Syntax

client.batch_update_memory_records(
    memoryId='string',
    records=[
        {
            'memoryRecordId': 'string',
            'timestamp': datetime(2015, 1, 1),
            'content': {
                'text': 'string'
            },
            'namespaces': [
                'string',
            ],
            'sourceNamespaces': [
                'string',
            ],
            'memoryStrategyId': 'string',
            'metadata': {
                'string': {
                    'stringValue': 'string',
                    'stringListValue': [
                        'string',
                    ],
                    'numberValue': 123.0,
                    'dateTimeValue': datetime(2015, 1, 1)
                }
            }
        },
    ]
)
type memoryId:

string

param memoryId:

[REQUIRED]

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

type records:

list

param records:

[REQUIRED]

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

  • (dict) --

    Input structure to update an existing memory record.

    • memoryRecordId (string) -- [REQUIRED]

      The unique ID of the memory record to be updated.

    • timestamp (datetime) -- [REQUIRED]

      Time at which the memory record was updated

    • content (dict) --

      The content to be stored within the memory record.

      • text (string) --

        The text content of the memory record.

    • namespaces (list) --

      The updated list of namespace identifiers for categorizing the memory record.

      • (string) --

    • sourceNamespaces (list) --

      The namespaces of the source memory record being updated. This value is used for IAM condition key authorization.

      • (string) --

    • memoryStrategyId (string) --

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

    • metadata (dict) --

      Metadata key-value pairs to be stored with the memory record.

      • (string) --

        • (dict) --

          The value of a memory record metadata entry.

          • stringValue (string) --

            A string value.

          • stringListValue (list) --

            A list of string values.

            • (string) --

          • numberValue (float) --

            A numeric value.

          • dateTimeValue (datetime) --

            A timestamp value in ISO 8601 UTC format.

rtype:

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 updated 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 updated, 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.

CreateEvent (updated) Link ¶
Changes (request, response)
Request
{'extractionConfig': {'namespaceVariables': {'string': 'string'}},
 'payload': {'json': {'content': {}}}}
Response
{'event': {'payload': {'json': {'content': {}}}}}

Creates an event in an AgentCore Memory resource. Events represent interactions or activities that occur within a session and are associated with specific actors.

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

This operation is subject to request rate limiting.

See also: AWS API Documentation

Request Syntax

client.create_event(
    memoryId='string',
    actorId='string',
    sessionId='string',
    eventTimestamp=datetime(2015, 1, 1),
    payload=[
        {
            'conversational': {
                'content': {
                    'text': 'string'
                },
                'role': 'ASSISTANT'|'USER'|'TOOL'|'OTHER'
            },
            'blob': {...}|[...]|123|123.4|'string'|True|None,
            'json': {
                'content': {...}|[...]|123|123.4|'string'|True|None
            }
        },
    ],
    branch={
        'rootEventId': 'string',
        'name': 'string'
    },
    clientToken='string',
    metadata={
        'string': {
            'stringValue': 'string'
        }
    },
    extractionMode='SKIP',
    extractionConfig={
        'namespaceVariables': {
            'string': 'string'
        }
    }
)
type memoryId:

string

param memoryId:

[REQUIRED]

The identifier of the AgentCore Memory resource in which to create the event.

type actorId:

string

param actorId:

[REQUIRED]

The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.

type sessionId:

string

param sessionId:

The identifier of the session in which this event occurs. A session represents a sequence of related events.

type eventTimestamp:

datetime

param eventTimestamp:

[REQUIRED]

The timestamp when the event occurred. If not specified, the current time is used.

type payload:

list

param payload:

[REQUIRED]

The content payload of the event. This can include conversational data, JSON data, or binary content.

  • (dict) --

    Contains the payload content for an event.

    • conversational (dict) --

      The conversational content of the payload.

      • content (dict) -- [REQUIRED]

        The content of the conversation message.

        • text (string) --

          The text content of the memory item.

      • role (string) -- [REQUIRED]

        The role of the participant in the conversation (for example, "user" or "assistant").

    • blob (:ref:`document<document>`) --

      The binary content of the payload.

    • json (dict) --

      The JSON content of the payload. Use this type to store non-conversational, JSON-formatted data, such as behavioral events, activity logs, or system events.

      • content (:ref:`document<document>`) -- [REQUIRED]

        The JSON content of the payload. Accepts any JSON value, including objects, arrays, strings, numbers, booleans, and null. The maximum size is 100 KB.

type branch:

dict

param branch:

The branch information for this event. Branches allow for organizing events into different conversation threads or paths.

  • rootEventId (string) --

    The identifier of the root event for this branch.

  • name (string) -- [REQUIRED]

    The name of the branch.

type clientToken:

string

param clientToken:

A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.

This field is autopopulated if not provided.

type metadata:

dict

param metadata:

The key-value metadata to attach to the event.

  • (string) --

    • (dict) --

      Value associated with the eventMetadata key.

      • stringValue (string) --

        Value associated with the eventMetadata key.

type extractionMode:

string

param extractionMode:

Controls long-term memory extraction for this event. When set to SKIP, the event is stored in short-term memory but is excluded from long-term memory extraction. If not specified, the event is processed for extraction as usual.

type extractionConfig:

dict

param extractionConfig:

The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.

  • namespaceVariables (dict) --

    A map of namespaceKeys to their values. The service substitutes these values into namespaceTemplates during long-term memory extraction to control namespace hierarchy.

    • (string) --

      The name of the namespace variable key. The name cannot be a built-in variable name ( actorId, sessionId, or memoryStrategyId).

      • (string) --

        The value of a namespace variable key.

rtype:

dict

returns:

Response Syntax

{
    'event': {
        'memoryId': 'string',
        'actorId': 'string',
        'sessionId': 'string',
        'eventId': 'string',
        'eventTimestamp': datetime(2015, 1, 1),
        'payload': [
            {
                'conversational': {
                    'content': {
                        'text': 'string'
                    },
                    'role': 'ASSISTANT'|'USER'|'TOOL'|'OTHER'
                },
                'blob': {...}|[...]|123|123.4|'string'|True|None,
                'json': {
                    'content': {...}|[...]|123|123.4|'string'|True|None
                }
            },
        ],
        'branch': {
            'rootEventId': 'string',
            'name': 'string'
        },
        'metadata': {
            'string': {
                'stringValue': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • event (dict) --

      The event that was created.

      • memoryId (string) --

        The identifier of the AgentCore Memory resource containing the event.

      • actorId (string) --

        The identifier of the actor associated with the event.

      • sessionId (string) --

        The identifier of the session containing the event.

      • eventId (string) --

        The unique identifier of the event.

      • eventTimestamp (datetime) --

        The timestamp when the event occurred.

      • payload (list) --

        The content payload of the event.

        • (dict) --

          Contains the payload content for an event.

          • conversational (dict) --

            The conversational content of the payload.

            • content (dict) --

              The content of the conversation message.

              • text (string) --

                The text content of the memory item.

            • role (string) --

              The role of the participant in the conversation (for example, "user" or "assistant").

          • blob (:ref:`document<document>`) --

            The binary content of the payload.

          • json (dict) --

            The JSON content of the payload. Use this type to store non-conversational, JSON-formatted data, such as behavioral events, activity logs, or system events.

            • content (:ref:`document<document>`) --

              The JSON content of the payload. Accepts any JSON value, including objects, arrays, strings, numbers, booleans, and null. The maximum size is 100 KB.

      • branch (dict) --

        The branch information for the event.

        • rootEventId (string) --

          The identifier of the root event for this branch.

        • name (string) --

          The name of the branch.

      • metadata (dict) --

        Metadata associated with an event.

        • (string) --

          • (dict) --

            Value associated with the eventMetadata key.

            • stringValue (string) --

              Value associated with the eventMetadata key.

DeleteMemoryRecord (updated) Link ¶
Changes (request)
{'namespace': 'string'}

Deletes a memory record from an AgentCore Memory resource. When you delete a memory record, it is permanently removed.

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

See also: AWS API Documentation

Request Syntax

client.delete_memory_record(
    memoryId='string',
    memoryRecordId='string',
    namespace='string'
)
type memoryId:

string

param memoryId:

[REQUIRED]

The identifier of the AgentCore Memory resource from which to delete the memory record.

type memoryRecordId:

string

param memoryRecordId:

[REQUIRED]

The identifier of the memory record to delete.

type namespace:

string

param namespace:

The namespace of the memory record to delete. This value is used for IAM condition key authorization.

rtype:

dict

returns:

Response Syntax

{
    'memoryRecordId': 'string'
}

Response Structure

  • (dict) --

    • memoryRecordId (string) --

      The identifier of the memory record that was deleted.

GetEvent (updated) Link ¶
Changes (response)
{'event': {'payload': {'json': {'content': {}}}}}

Retrieves information about a specific event in an AgentCore Memory resource.

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

See also: AWS API Documentation

Request Syntax

client.get_event(
    memoryId='string',
    sessionId='string',
    actorId='string',
    eventId='string'
)
type memoryId:

string

param memoryId:

[REQUIRED]

The identifier of the AgentCore Memory resource containing the event.

type sessionId:

string

param sessionId:

[REQUIRED]

The identifier of the session containing the event.

type actorId:

string

param actorId:

[REQUIRED]

The identifier of the actor associated with the event.

type eventId:

string

param eventId:

[REQUIRED]

The identifier of the event to retrieve.

rtype:

dict

returns:

Response Syntax

{
    'event': {
        'memoryId': 'string',
        'actorId': 'string',
        'sessionId': 'string',
        'eventId': 'string',
        'eventTimestamp': datetime(2015, 1, 1),
        'payload': [
            {
                'conversational': {
                    'content': {
                        'text': 'string'
                    },
                    'role': 'ASSISTANT'|'USER'|'TOOL'|'OTHER'
                },
                'blob': {...}|[...]|123|123.4|'string'|True|None,
                'json': {
                    'content': {...}|[...]|123|123.4|'string'|True|None
                }
            },
        ],
        'branch': {
            'rootEventId': 'string',
            'name': 'string'
        },
        'metadata': {
            'string': {
                'stringValue': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • event (dict) --

      The requested event information.

      • memoryId (string) --

        The identifier of the AgentCore Memory resource containing the event.

      • actorId (string) --

        The identifier of the actor associated with the event.

      • sessionId (string) --

        The identifier of the session containing the event.

      • eventId (string) --

        The unique identifier of the event.

      • eventTimestamp (datetime) --

        The timestamp when the event occurred.

      • payload (list) --

        The content payload of the event.

        • (dict) --

          Contains the payload content for an event.

          • conversational (dict) --

            The conversational content of the payload.

            • content (dict) --

              The content of the conversation message.

              • text (string) --

                The text content of the memory item.

            • role (string) --

              The role of the participant in the conversation (for example, "user" or "assistant").

          • blob (:ref:`document<document>`) --

            The binary content of the payload.

          • json (dict) --

            The JSON content of the payload. Use this type to store non-conversational, JSON-formatted data, such as behavioral events, activity logs, or system events.

            • content (:ref:`document<document>`) --

              The JSON content of the payload. Accepts any JSON value, including objects, arrays, strings, numbers, booleans, and null. The maximum size is 100 KB.

      • branch (dict) --

        The branch information for the event.

        • rootEventId (string) --

          The identifier of the root event for this branch.

        • name (string) --

          The name of the branch.

      • metadata (dict) --

        Metadata associated with an event.

        • (string) --

          • (dict) --

            Value associated with the eventMetadata key.

            • stringValue (string) --

              Value associated with the eventMetadata key.

GetMemoryRecord (updated) Link ¶
Changes (request)
{'namespace': 'string'}

Retrieves a specific memory record from an AgentCore Memory resource.

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

See also: AWS API Documentation

Request Syntax

client.get_memory_record(
    memoryId='string',
    memoryRecordId='string',
    namespace='string'
)
type memoryId:

string

param memoryId:

[REQUIRED]

The identifier of the AgentCore Memory resource containing the memory record.

type memoryRecordId:

string

param memoryRecordId:

[REQUIRED]

The identifier of the memory record to retrieve.

type namespace:

string

param namespace:

The namespace of the memory record to retrieve. This value is used for IAM condition key authorization.

rtype:

dict

returns:

Response Syntax

{
    'memoryRecord': {
        'memoryRecordId': 'string',
        'content': {
            'text': 'string'
        },
        'memoryStrategyId': 'string',
        'namespaces': [
            'string',
        ],
        'createdAt': datetime(2015, 1, 1),
        'metadata': {
            'string': {
                'stringValue': 'string',
                'stringListValue': [
                    'string',
                ],
                'numberValue': 123.0,
                'dateTimeValue': datetime(2015, 1, 1)
            }
        }
    }
}

Response Structure

  • (dict) --

    • memoryRecord (dict) --

      The requested memory record.

      • memoryRecordId (string) --

        The unique identifier of the memory record.

      • content (dict) --

        The content of the memory record.

        • 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. Namespaces help organize and categorize memory records.

        • (string) --

      • createdAt (datetime) --

        The timestamp when the memory record was created.

      • metadata (dict) --

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

        • (string) --

          • (dict) --

            The value of a memory record metadata entry.

            • stringValue (string) --

              A string value.

            • stringListValue (list) --

              A list of string values.

              • (string) --

            • numberValue (float) --

              A numeric value.

            • dateTimeValue (datetime) --

              A timestamp value in ISO 8601 UTC format.

ListEvents (updated) Link ¶
Changes (response)
{'events': {'payload': {'json': {'content': {}}}}}

Lists events 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:ListEvents permission.

See also: AWS API Documentation

Request Syntax

client.list_events(
    memoryId='string',
    sessionId='string',
    actorId='string',
    includePayloads=True|False,
    filter={
        'branch': {
            'name': 'string',
            'includeParentBranches': True|False
        },
        'eventMetadata': [
            {
                'left': {
                    'metadataKey': 'string'
                },
                'operator': 'EQUALS_TO'|'EXISTS'|'NOT_EXISTS',
                'right': {
                    'metadataValue': {
                        'stringValue': 'string'
                    }
                }
            },
        ]
    },
    maxResults=123,
    nextToken='string'
)
type memoryId:

string

param memoryId:

[REQUIRED]

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

type sessionId:

string

param sessionId:

[REQUIRED]

The identifier of the session for which to list events.

type actorId:

string

param actorId:

[REQUIRED]

The identifier of the actor for which to list events.

type includePayloads:

boolean

param includePayloads:

Specifies whether to include event payloads in the response. Set to true to include payloads, or false to exclude them.

type filter:

dict

param filter:

Filter criteria to apply when listing events.

  • branch (dict) --

    The branch filter criteria to apply when listing events.

    • name (string) -- [REQUIRED]

      The name of the branch to filter by.

    • includeParentBranches (boolean) --

      Specifies whether to include parent branches in the results. Set to true to include parent branches, or false to exclude them.

  • eventMetadata (list) --

    Event metadata filter criteria to apply when retrieving events.

    • (dict) --

      Filter expression for retrieving events based on metadata associated with an event.

      • left (dict) -- [REQUIRED]

        Left operand of the event metadata filter expression.

        • metadataKey (string) --

          Key associated with the metadata in an event.

      • operator (string) -- [REQUIRED]

        Operator applied to the event metadata filter expression.

      • right (dict) --

        Right operand of the event metadata filter expression.

        • metadataValue (dict) --

          Value associated with the key in eventMetadata.

          • stringValue (string) --

            Value associated with the eventMetadata key.

type maxResults:

integer

param maxResults:

The maximum number of results to return in a single call. The default value is 20.

type nextToken:

string

param nextToken:

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.

rtype:

dict

returns:

Response Syntax

{
    'events': [
        {
            'memoryId': 'string',
            'actorId': 'string',
            'sessionId': 'string',
            'eventId': 'string',
            'eventTimestamp': datetime(2015, 1, 1),
            'payload': [
                {
                    'conversational': {
                        'content': {
                            'text': 'string'
                        },
                        'role': 'ASSISTANT'|'USER'|'TOOL'|'OTHER'
                    },
                    'blob': {...}|[...]|123|123.4|'string'|True|None,
                    'json': {
                        'content': {...}|[...]|123|123.4|'string'|True|None
                    }
                },
            ],
            'branch': {
                'rootEventId': 'string',
                'name': 'string'
            },
            'metadata': {
                'string': {
                    'stringValue': 'string'
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • events (list) --

      The list of events that match the specified criteria.

      • (dict) --

        Contains information about an event in an AgentCore Memory resource.

        • memoryId (string) --

          The identifier of the AgentCore Memory resource containing the event.

        • actorId (string) --

          The identifier of the actor associated with the event.

        • sessionId (string) --

          The identifier of the session containing the event.

        • eventId (string) --

          The unique identifier of the event.

        • eventTimestamp (datetime) --

          The timestamp when the event occurred.

        • payload (list) --

          The content payload of the event.

          • (dict) --

            Contains the payload content for an event.

            • conversational (dict) --

              The conversational content of the payload.

              • content (dict) --

                The content of the conversation message.

                • text (string) --

                  The text content of the memory item.

              • role (string) --

                The role of the participant in the conversation (for example, "user" or "assistant").

            • blob (:ref:`document<document>`) --

              The binary content of the payload.

            • json (dict) --

              The JSON content of the payload. Use this type to store non-conversational, JSON-formatted data, such as behavioral events, activity logs, or system events.

              • content (:ref:`document<document>`) --

                The JSON content of the payload. Accepts any JSON value, including objects, arrays, strings, numbers, booleans, and null. The maximum size is 100 KB.

        • branch (dict) --

          The branch information for the event.

          • rootEventId (string) --

            The identifier of the root event for this branch.

          • name (string) --

            The name of the branch.

        • metadata (dict) --

          Metadata associated with an event.

          • (string) --

            • (dict) --

              Value associated with the eventMetadata key.

              • 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.