Skip to main content
Retrieve context scoped to a specific customer organization. Customer-scoped memories are visible to all users within that customer. This is useful for fetching shared organizational knowledge, company policies, and team-wide context.

Parameters

string
required
The customer identifier to fetch context for. Required on B2B; auto-resolved on B2C. See B2C vs B2B.
string
Optional conversation identifier. When provided, results are biased toward memories relevant to the active conversation. When supplied, it must be a valid UUID registered via record_message.
string | string[]
One or more search queries to find relevant customer memories. If omitted, returns the most recent and highest-confidence customer-scoped memories.
integer
Maximum number of memory items to return. Defaults to 10. Maximum 50.
string[]
Filter results to specific memory types. If omitted, all types are included.
string
Retrieval mode that controls the speed-quality tradeoff: the retrieval axis (fast vs accurate) of Retrieval Modes.For real per-mode latency on your instance, see Dashboard → Usage.
string
Controls how precisely results are filtered before they’re returned.Independent of mode; combine with either fast or accurate. For real latency on your instance, see Dashboard → Usage.

Returns

A ContextResponse with the following fields:
array
Array of fact memories relevant to the query.
array
Array of preference memories.
array
Array of episode memories.
array
Array of emotion memories.
object
Response metadata including total_results, query_time_ms, tokens_used, scope, and mode.

Example

Response
Customer-scoped memories take priority over client-scoped memories when they cover the same topic, following the scope chain priority rules. To merge customer and client context in a single call, use sdk.context.fetch.

Raises

  • InvalidInputError: when mode is not "fast" or "accurate".
  • InvalidInputError: when precision_level is not "high" or "medium".
  • SDKNotInitializedError: when called before await sdk.initialize().
  • AuthenticationError: when the API key is invalid or revoked.
  • ContextNotFoundError: when customer_id does not exist for this instance.

See also