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
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_messagefor the transcript,memories.createfor 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 differentmode= axes. Label which one you mean:
…plus a precision knob: fetch calls also take
precision_level — high (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.