Skip to content

create_event

Operation

create_event

create_event(request: CreateEventInput | CreateEventInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateEventInputDict]) -> CreateEventOutput

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.

Parameters:

Name Type Description Default
request CreateEventInput | CreateEventInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateEventInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateEventOutput

An instance of CreateEventOutput.

create_event async

create_event(request: CreateEventInput | CreateEventInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateEventInputDict]) -> CreateEventOutput

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.

Parameters:

Name Type Description Default
request CreateEventInput | CreateEventInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateEventInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateEventOutput

An instance of CreateEventOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateEventInputDict

Bases: TypedDict

Dictionary form of CreateEventInput.

Attributes

actor_id instance-attribute
actor_id: Required[str]

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

branch instance-attribute
branch: Branch | BranchDict | None

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

client_token instance-attribute
client_token: str | None

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.

event_timestamp instance-attribute
event_timestamp: Required[datetime]

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

extraction_config instance-attribute
extraction_config: ExtractionConfig | ExtractionConfigDict | None

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

extraction_mode instance-attribute
extraction_mode: str | None

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.

memory_id instance-attribute
memory_id: Required[str]

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

metadata instance-attribute

The key-value metadata to attach to the event.

payload instance-attribute

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

session_id instance-attribute
session_id: str | None

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

CreateEventInput dataclass

Bases: _SerdeShape

Dataclass for CreateEventInput structure.

Attributes

actor_id class-attribute instance-attribute
actor_id: str | None = ...

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

branch class-attribute instance-attribute
branch: Branch | None = ...

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

client_token class-attribute instance-attribute
client_token: str | None = ...

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.

event_timestamp class-attribute instance-attribute
event_timestamp: datetime | None = ...

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

extraction_config class-attribute instance-attribute
extraction_config: ExtractionConfig | None = ...

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

extraction_mode class-attribute instance-attribute
extraction_mode: str | None = ...

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.

memory_id class-attribute instance-attribute
memory_id: str | None = ...

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

metadata class-attribute instance-attribute
metadata: dict[str, MetadataValue] | None = ...

The key-value metadata to attach to the event.

payload class-attribute instance-attribute
payload: list[PayloadType] | None = ...

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

session_id class-attribute instance-attribute
session_id: str | None = ...

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

Output

CreateEventOutput dataclass

Bases: _SerdeShape

Dataclass for CreateEventOutput structure.

Attributes

event instance-attribute
event: Event

The event that was created.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.