Search

This page presents the developer-facing scoping helpers together with the concrete Oracle search result type.

Scope Resolution

For each scope field, you can do one of three things:

Each stored record has three independent scope fields: user_id, agent_id, and thread_id. Each field may hold a concrete ID or None.

Examples:

The same scoping rules apply to both synchronous and asynchronous search APIs.

In the following table, ID means any of user_id, agent_id, or thread_id together with its corresponding exact-match flag.

Search Scope Resolution by API Layer

Case thread.search() OracleAgentMemory.search() store.search()
ID omitted Uses the thread defaults: exact user_id and agent_id, plus the current thread_id with exact_thread_match=False. Uses the client defaults. Omitted user_id is rejected. Omitted agent_id and thread_id stay broad. Uses the store defaults: ID=None and exact_*_match=False, so that dimension is not filtered.
Explicit value, including None + exact_*_match=False That dimension is not filtered. Records whose value matches the specified one may rank higher than other records. For user_id, rejected because client searches require explicit exact user scoping. For agent_id and thread_id, that dimension is not filtered. Records whose value matches the specified one may rank higher than other records. That dimension is not filtered. Records whose value matches the specified one may rank higher than other records.
Explicit ID + exact_*_match=True Matches that ID exactly. Matches that ID exactly. Matches that ID exactly.
Explicit None + exact_*_match=True Matches only records unscoped on that dimension. Matches only records unscoped on that dimension. Matches only records unscoped on that dimension.

Use explicit None together with exact_*_match=True when you want only records unscoped on that dimension and the API permits it. Omit the field when you want the operation default instead.

Scopes

class oracleagentmemory.apis.scope.Scope

Bases: object

Represents a scope for information insertion or searches.

user_id

End-user ID. NOT_SET_MARKER means the field was omitted and should be resolved by the operation-specific default. Explicit None is preserved and interpreted by the operation-specific rules. Higher-level client APIs such as OracleAgentMemory.search() may require the user scope to be explicit. In those APIs, None may be used to target unscoped records only.

agent_id

Agent ID. NOT_SET_MARKER means the field was omitted and should be resolved by the operation-specific default. Explicit None is preserved and interpreted by the operation-specific rules.

thread_id

Thread ID. NOT_SET_MARKER means the field was omitted and should be resolved by the operation-specific default. Explicit None is preserved and interpreted by the operation-specific rules.

class oracleagentmemory.apis.searchscope.SearchScope

Bases: Scope

Represents the scope for a search query and therefore constrains what can be returned.

user_id

End-user ID. When the resolved exact_user_match value is True, this ID is matched exactly, including None. When it is False, the user dimension is unconstrained. NOT_SET_MARKER is replaced by an operation-specific default. Higher-level client APIs such as OracleAgentMemory.search() may require the user scope to be explicit. In those APIs, None targets only unscoped records when exact_user_match resolves to True.

agent_id

Agent ID. When the resolved exact_agent_match value is True, this ID is matched exactly, including None. When it is False, the agent dimension is unconstrained. NOT_SET_MARKER is replaced by a default value depending on the operation using the scope.

thread_id

Thread ID. When the resolved exact_thread_match value is True, this ID is matched exactly, including None. When it is False, the thread dimension is unconstrained. NOT_SET_MARKER is replaced by a default value depending on the operation using the scope.

exact_user_match

Whether to match the resolved user_id exactly. True matches exactly, including None. False leaves the user dimension unconstrained. NOT_SET_MARKER is replaced by a default depending on the operation. Higher-level client APIs such as OracleAgentMemory.search() may require this to remain True.

exact_agent_match

Whether to match the resolved agent_id exactly. True matches exactly, including None. False leaves the agent dimension unconstrained. NOT_SET_MARKER is replaced by a default depending on the operation.

exact_thread_match

Whether to match the resolved thread_id exactly. True matches exactly, including None. False leaves the thread dimension unconstrained. NOT_SET_MARKER is replaced by a default depending on the operation.

Results

class oracleagentmemory.core.OracleSearchResult

Bases: SearchResult

Search result returned by an Oracle thread.

property content

property formatted_content

property id

property metadata

property record

The returned value may be a plain Record or a ScopedRecord subclass. Use isinstance(result.record, ScopedRecord) before reading public scope identifiers.

property timestamp