Skip to content

Creates an event in an AgentCore Memory resource

Description

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.

Usage

bedrockagentcore_create_event(memoryId, actorId, sessionId,
  eventTimestamp, payload, branch, clientToken, metadata, extractionMode,
  extractionConfig)

Arguments

  • memoryId

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

  • actorId

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

  • sessionId

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

  • eventTimestamp

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

  • payload

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

  • branch

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

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

  • metadata

    The key-value metadata to attach to the event.

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

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

Value

A list with the following syntax:

list(
  event = list(
    memoryId = "string",
    actorId = "string",
    sessionId = "string",
    eventId = "string",
    eventTimestamp = as.POSIXct(
      "2015-01-01"
    ),
    payload = list(
      list(
        conversational = list(
          content = list(
            text = "string"
          ),
          role = "ASSISTANT"|"USER"|"TOOL"|"OTHER"
        ),
        blob = list(),
        json = list(
          content = list()
        )
      )
    ),
    branch = list(
      rootEventId = "string",
      name = "string"
    ),
    metadata = list(
      list(
        stringValue = "string"
      )
    )
  )
)

Request syntax

svc$create_event(
  memoryId = "string",
  actorId = "string",
  sessionId = "string",
  eventTimestamp = as.POSIXct(
    "2015-01-01"
  ),
  payload = list(
    list(
      conversational = list(
        content = list(
          text = "string"
        ),
        role = "ASSISTANT"|"USER"|"TOOL"|"OTHER"
      ),
      blob = list(),
      json = list(
        content = list()
      )
    )
  ),
  branch = list(
    rootEventId = "string",
    name = "string"
  ),
  clientToken = "string",
  metadata = list(
    list(
      stringValue = "string"
    )
  ),
  extractionMode = "SKIP",
  extractionConfig = list(
    namespaceVariables = list(
      "string"
    )
  )
)