Skip to main content
Everything you need to hold in your head, on one page. Each row links to the full reference.

The identifiers (scope chain)

From broadest to narrowest. A memory can be tagged with several of these and is then retrievable through any matching scope.
B2C vs B2B: B2C instances need only user_id (customer_id is auto-resolved); B2B instances pass user_id under a customer_id. The shape is set per-Instance by the User Relationship setting in the Dashboard. See Memory scopes.

The two write paths

Passing conversation_id inside memories.create(metadata=...) does not register the conversation: metadata is stored but not indexed for scope resolution. Only record_message creates the conversation row that conversation.context.fetch reads from.
Which do I use?
  • Turn-by-turn chat history → record_message
  • Long-term knowledge (a document, a profile, an imported fact) → memories.create
  • Production chat agent → both: record_message for the transcript, memories.create for durable knowledge. See the cost & dedup note in Ingestion.

The four fetch interfaces

Each reads from one scope. A memory tagged with multiple identifiers is retrievable through any matching interface.
Fetching a brand-new or never-ingested scope returns an empty ContextResponse (facts == [], etc.), not an error. This is the normal cold-start path. A malformed (non-UUID) conversation_id raises InvalidInputError. See Error handling.

The two mode pairs

Two different mode= axes. Label which one you mean: …plus a precision knob: fetch calls also take precision_levelhigh (default) = results go through an additional relevance-refinement pass before being returned; medium = skips the refinement pass for faster responses (recall isn’t impacted — the same candidate memories are searched — but outputs are less precisely filtered). Independent of mode; combine with either fast or accurate.

Going deeper

The full memory model: memory types, lifecycles, entity resolution, and MACA.