Amazon Bedrock AgentCore Data Plane Fronting Layer

2025/10/06 - Amazon Bedrock AgentCore Data Plane Fronting Layer - 5 new3 updated api methods

Changes  Add support for batch memory management, agent card retrieval and session termination

BatchCreateMemoryRecords (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

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

string

param memoryId:

[REQUIRED]

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

type records:

list

param records:

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

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

type clientToken:

string

param clientToken:

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

This field is autopopulated if not provided.

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

BatchDeleteMemoryRecords (new) Link ¶

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'
        },
    ]
)
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.

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 (new) Link ¶

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',
            ],
            'memoryStrategyId': 'string'
        },
    ]
)
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) --

    • memoryStrategyId (string) --

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

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.

GetAgentCard (new) Link ¶

Retrieves the A2A agent card associated with an AgentCore Runtime agent.

See also: AWS API Documentation

Request Syntax

client.get_agent_card(
    runtimeSessionId='string',
    agentRuntimeArn='string',
    qualifier='string'
)
type runtimeSessionId:

string

param runtimeSessionId:

The session ID that the AgentCore Runtime agent is using.

This field is autopopulated if not provided.

type agentRuntimeArn:

string

param agentRuntimeArn:

[REQUIRED]

The ARN of the AgentCore Runtime agent for which you want to get the A2A agent card.

type qualifier:

string

param qualifier:

Optional qualifier to specify an agent alias, such as prod``code> or ``dev. If you don't provide a value, the DEFAULT alias is used.

rtype:

dict

returns:

Response Syntax

{
    'runtimeSessionId': 'string',
    'agentCard': {...}|[...]|123|123.4|'string'|True|None,
    'statusCode': 123
}

Response Structure

  • (dict) --

    • runtimeSessionId (string) --

      The ID of the session associated with the AgentCore Runtime agent.

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

      An agent card document that contains metadata and capabilities for an AgentCore Runtime agent.

    • statusCode (integer) --

      The status code of the request.

StopRuntimeSession (new) Link ¶

Stops a session that is running in an running AgentCore Runtime agent.

See also: AWS API Documentation

Request Syntax

client.stop_runtime_session(
    runtimeSessionId='string',
    agentRuntimeArn='string',
    qualifier='string',
    clientToken='string'
)
type runtimeSessionId:

string

param runtimeSessionId:

[REQUIRED]

The ID of the session that you want to stop.

type agentRuntimeArn:

string

param agentRuntimeArn:

[REQUIRED]

The ARN of the agent that contains the session that you want to stop.

type qualifier:

string

param qualifier:

Optional qualifier to specify an agent alias, such as prod``code> or ``dev. If you don't provide a value, the DEFAULT alias is used.

type clientToken:

string

param clientToken:

Idempotent token used to identify the request. If you use the same token with multiple requests, the same response is returned. Use ClientToken to prevent the same request from being processed more than once.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'runtimeSessionId': 'string',
    'statusCode': 123
}

Response Structure

  • (dict) --

    • runtimeSessionId (string) --

      The ID of the session that you requested to stop.

    • statusCode (integer) --

      The status code of the request to stop the session.

CreateEvent (updated) Link ¶
Changes (request, response)
Request
{'metadata': {'string': {'stringValue': 'string'}}}
Response
{'event': {'metadata': {'string': {'stringValue': 'string'}}}}

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
        },
    ],
    branch={
        'rootEventId': 'string',
        'name': 'string'
    },
    clientToken='string',
    metadata={
        'string': {
            'stringValue': '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 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.

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.

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
            },
        ],
        '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.

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

GetEvent (updated) Link ¶
Changes (response)
{'event': {'metadata': {'string': {'stringValue': 'string'}}}}

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
            },
        ],
        '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.

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

ListEvents (updated) Link ¶
Changes (request, response)
Request
{'filter': {'eventMetadata': [{'left': {'metadataKey': 'string'},
                               'operator': 'EQUALS_TO | EXISTS | NOT_EXISTS',
                               'right': {'metadataValue': {'stringValue': 'string'}}}]}}
Response
{'events': {'metadata': {'string': {'stringValue': 'string'}}}}

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. If specified, only events from this session are returned.

type actorId:

string

param actorId:

[REQUIRED]

The identifier of the actor for which to list events. If specified, only events from this actor are returned.

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. Minimum value of 1, maximum value of 100. Default 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
                },
            ],
            '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.

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