Amazon Bedrock AgentCore

2026/04/01 - Amazon Bedrock AgentCore - 1 updated api methods

Changes  Added the ability to filter out empty sessions when listing sessions. Customers can now retrieve only sessions that still contain events, eliminating the need to check each session individually. No changes required for existing integrations.

ListSessions (updated) Link ΒΆ
Changes (request)
{'filter': {'eventFilter': 'HAS_EVENTS'}}

Lists sessions 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:ListSessions permission.

See also: AWS API Documentation

Request Syntax

client.list_sessions(
    memoryId='string',
    actorId='string',
    maxResults=123,
    nextToken='string',
    filter={
        'eventFilter': 'HAS_EVENTS'
    }
)
type memoryId:

string

param memoryId:

[REQUIRED]

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

type actorId:

string

param actorId:

[REQUIRED]

The identifier of the actor for which to list sessions.

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.

type filter:

dict

param filter:

Filter criteria to apply when listing sessions.

  • eventFilter (string) --

    The event filter condition to apply. Use this to filter sessions based on event presence.

rtype:

dict

returns:

Response Syntax

{
    'sessionSummaries': [
        {
            'sessionId': 'string',
            'actorId': 'string',
            'createdAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • sessionSummaries (list) --

      The list of session summaries that match the specified criteria.

      • (dict) --

        Contains summary information about a session in an AgentCore Memory resource.

        • sessionId (string) --

          The unique identifier of the session.

        • actorId (string) --

          The identifier of the actor associated with the session.

        • createdAt (datetime) --

          The timestamp when the session was created.

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