Skip to content

CreateMemoryInput

Source code in docs_src/capo_opensearchmemory/types/create_memory_input.py
class CreateMemoryInput(TypedDict, closed=True):
    space_id: "capo_opensearchmemory.types.space_id.SpaceId"
    """<p>The ID of the space that owns the memory, for example <code>sp-02864597b164</code>.</p>"""
    name: "capo_opensearchmemory.types.strategy_name.StrategyName"
    """<p>The name of the strategy that the memory belongs to. The space must already declare the strategy, and the memory's type comes from that strategy. The name must be 1 to 64 characters: letters, digits, periods, hyphens, and underscores, starting with a letter or digit.</p>"""
    content: "capo_opensearchmemory.types.create_memory_content.CreateMemoryContent"
    """<p>The memory text, stored and embedded as provided.</p>"""
    actor_id: "capo_opensearchmemory.types.actor_id.ActorId"
    """<p>The actor (end user or agent) that owns the memory.</p>"""
    session_id: NotRequired["capo_opensearchmemory.types.session_id.SessionId"]
    """<p>The session that the memory belongs to. If you omit it, the service generates a session ID and returns it.</p>"""
    metadata: NotRequired["capo_opensearchmemory.types.metadata_map.MetadataMap"]
    """<p>Metadata tags to store with the memory. Keys that begin with <code>x-amz-</code>, the key <code>documentS3Source</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p> <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>"""
    client_token: NotRequired["capo_opensearchmemory.types.client_token.ClientToken"]
    """<p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token returns the same <code>memoryId</code> instead of creating a second memory. Reusing the token with a different <code>name</code>, <code>content</code>, <code>metadata</code>, <code>actorId</code>, or <code>sessionId</code> fails with <code>ConflictException</code>. If you omit <code>sessionId</code>, a retry with the same token gets the same session. If you omit the token, each call creates a new memory.</p>"""

actor_id instance-attribute

actor_id: ActorId

The actor (end user or agent) that owns the memory.

client_token instance-attribute

client_token: NotRequired[ClientToken]

A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token returns the same memoryId instead of creating a second memory. Reusing the token with a different name, content, metadata, actorId, or sessionId fails with ConflictException. If you omit sessionId, a retry with the same token gets the same session. If you omit the token, each call creates a new memory.

content instance-attribute

The memory text, stored and embedded as provided.

metadata instance-attribute

metadata: NotRequired[MetadataMap]

Metadata tags to store with the memory. Keys that begin with x-amz-, the key documentS3Source, and other keys that the service uses internally are reserved: a request that sets one fails with ValidationException, and the message names the key.

A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with ValidationException. Reuse an existing key instead.

name instance-attribute

The name of the strategy that the memory belongs to. The space must already declare the strategy, and the memory's type comes from that strategy. The name must be 1 to 64 characters: letters, digits, periods, hyphens, and underscores, starting with a letter or digit.

session_id instance-attribute

session_id: NotRequired[SessionId]

The session that the memory belongs to. If you omit it, the service generates a session ID and returns it.

space_id instance-attribute

space_id: SpaceId

The ID of the space that owns the memory, for example sp-02864597b164.