Skip to main content
Start with the quickstart, using your backend URL, a stable user ID and the original completed job. This example reads existing state; it does not submit another save immediately before retrieval. Set MEMORYOS_API_KEY and MEMORYOS_API_URL server-side. Model inference below is optional and may cost money; use it only within your own approved provider budget. Backend extraction/embeddings can have separate costs.
This conservative example stops a memory-dependent answer on a hold, missing scope/choice, bypass or empty result. Your application can handle unrelated questions without memory under its own policy. Retrieval errors propagate for the application to handle explicitly; do not silently reuse stale context. Render source_reviews separately as user decision cards, including during a hold. Do not put their previews or pending text into the model’s current-fact context. Handle the actual user’s choice through source review, then retrieve again. For project-specific reads, add the explicit preference context rather than relying on project names in the question. Reopening the chat must preserve the same owner mapping. Choose a model available to your account through the environment variable above; no default model availability is assumed. Provider method usage follows the official Python SDK. These documentation examples were not executed against a live model as part of this documentation update. A model answer still requires your own grounding checks; attaching context does not prove semantic correctness. For TypeScript, apply the same pre-inference gate from the TypeScript SDK reference before constructing your provider request.

Capture after a normal reply

For ordinary conversation capture, persist the completed turn and submit it through your existing reliable background-work mechanism. Do not put wait_for_job(timeout=120) in every interactive response. An immediate follow-up can return processing visibility; show the fallback above and retrieve later. Corrections and explicit choices require the operation-before-dependent-answer ordering described in chat lifecycle.