Skip to content

SearchMemoriesInput

Source code in docs_src/capo_opensearchmemory/types/search_memories_input.py
class SearchMemoriesInput(TypedDict, closed=True):
    space_id: "capo_opensearchmemory.types.space_id.SpaceId"
    """<p>The space to search. Use <code>actorId</code> to narrow the search within it.</p>"""
    memory_strategies: NotRequired[
        "capo_opensearchmemory.types.strategy_selector_list.StrategySelectorList"
    ]
    """<p>The strategies to search, as a list of selectors. Each selector names a memory type and, optionally, specific strategy names of that type. A space can hold several strategies of the same type. A selector without <code>memoryStrategyNames</code> searches every strategy of its type, and omitting <code>memoryStrategies</code> searches every strategy in the space. A name that is not a declared strategy of that type fails with <code>ValidationException</code>.</p>"""
    actor_id: "capo_opensearchmemory.types.actor_id.ActorId"
    """<p>The actor whose memories to search (exact match). Required: every search covers exactly one actor, and a memory stored without an actor is never returned. This is the only way to filter by actor: a query that references <code>system_metadata.actor_id</code> fails with <code>ValidationException</code> (reason <code>nonFilterableField</code>).</p>"""
    query: "capo_opensearchmemory.types.search_query.SearchQuery"
    """<p>The query: a subset of the OpenSearch Query DSL (see <code>SearchQuery</code>). You can't use the actor and session fields <code>system_metadata.actor_id</code> and <code>system_metadata.session_id</code> here. Use the top-level <code>actorId</code> to filter by actor. Searching memories doesn't filter by session.</p>"""
    sort: NotRequired["capo_opensearchmemory.types.search_sort.SearchSort"]
    """<p>The sort order (see <code>SearchSort</code>). Omit to return the most relevant memories first.</p>"""
    max_results: NotRequired["capo_opensearchmemory.types.max_results.MaxResults"]
    """<p>The maximum number of memories to return, from 1 to 100. The default is 20.</p>"""
    next_token: NotRequired[
        "capo_opensearchmemory.types.pagination_token.PaginationToken"
    ]
    """<p>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.</p>"""

actor_id instance-attribute

actor_id: ActorId

The actor whose memories to search (exact match). Required: every search covers exactly one actor, and a memory stored without an actor is never returned. This is the only way to filter by actor: a query that references system_metadata.actor_id fails with ValidationException (reason nonFilterableField).

max_results instance-attribute

max_results: NotRequired[MaxResults]

The maximum number of memories to return, from 1 to 100. The default is 20.

memory_strategies instance-attribute

memory_strategies: NotRequired[StrategySelectorList]

The strategies to search, as a list of selectors. Each selector names a memory type and, optionally, specific strategy names of that type. A space can hold several strategies of the same type. A selector without memoryStrategyNames searches every strategy of its type, and omitting memoryStrategies searches every strategy in the space. A name that is not a declared strategy of that type fails with ValidationException.

next_token instance-attribute

next_token: NotRequired[PaginationToken]

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.

query instance-attribute

query: SearchQuery

The query: a subset of the OpenSearch Query DSL (see SearchQuery). You can't use the actor and session fields system_metadata.actor_id and system_metadata.session_id here. Use the top-level actorId to filter by actor. Searching memories doesn't filter by session.

sort instance-attribute

sort: NotRequired[SearchSort]

The sort order (see SearchSort). Omit to return the most relevant memories first.

space_id instance-attribute

space_id: SpaceId

The space to search. Use actorId to narrow the search within it.