Skip to main content

Endpoint

Authentication

Simple mode: no source block required

For solo builders, MVPs, small teams, and single-agent products, omit source. MemoryOS automatically creates internal event IDs, timestamps, and default provenance.

Request body

Fields

ConversationMessage

ProposedMemory

For a durable evidence trail, give each persisted chat turn a stable external_turn_id. MemoryOS stores a server-verified reference and content hash with extracted memories.
In normal conversational mode, MemoryOS preserves every submitted role but only creates durable user memory when a user turn directly states or confirms the claim. A user question and an unsupported assistant answer are not sufficient evidence. This prevents an assistant from turning its own suggestion into a user preference or fact.

Explicit assistant proposals

This contract requires a backend deployment containing the structured-proposal migration and an SDK version that exposes the matching fields. Proposal confirmation is feature-gated and remains off until the tenant environment passes its release evaluation.
The assistant must show the proposed durable claim to the user and submit that same claim as proposed_memory. Registering it does not create a memory and does not grant user authority. When confirmation is enabled, a later direct user turn can accept it only after MemoryOS verifies the immutable proposal turn, its content hash, the conversation scope, the referenced proposal, and the user’s confirmation. Model confidence is diagnostic only and cannot grant authority.
Use the same conversation_id and stable turn IDs when you later submit the proposal turn with the user’s direct reply. Tool output, fetched documents, system instructions, and assistant text cannot act as the confirming user turn.

Multi-service mode: add provenance

Use source when multiple services can write memories for the same user. This is for Billing, Support, CRM, Product, or other backend services that may disagree and need source-authority policies.
If you provide source.service, register that service writer in the Tenant Dashboard first. MemoryOS rejects unknown or inactive service keys. Dedicated API keys can then be bound to writers so authority rules and source credentials are enforced consistently. Authenticated source-aware events have a different authority boundary: declarative observations from the registered service may be extracted from an assistant-role message because the service identity, event, evidence, and writer policy provide the provenance. Do not add source merely to make an ordinary chatbot response authoritative.

Response: queued

add() is asynchronous. A queued response means MemoryOS accepted the request, not that a memory has already been stored.

Check extraction job status

Use GET /v1/memories/jobs/ for authentication, response fields, examples and terminal-state handling. Poll the original job only when verifying or diagnosing processing; follow chat lifecycle for interactive use.

Explicitly request a memory clarification

If a direct user message says not to decide between two existing memories and asks to choose, MemoryOS can complete the extraction job with memories_created: 0 and queue a clarification instead of storing the uncertain sentence as a new memory. On the next retrieve call, clarification contains the backend-approved question and answer options for the customer’s existing chat. The extraction model can only select memory IDs that MemoryOS placed in its bounded prompt context. The backend then revalidates the cited user turn, verbatim evidence, tenant, user profile, active status, and category before it queues anything. Tool output, assistant text, invented IDs, and records owned by another user or tenant cannot create a clarification. See Resolve a clarification in your existing chat. Clarification can also arise from a new competing value, not only two records that already exist. In that path, MemoryOS may create an inactive alternative, so memories_created can be nonzero even before the user selects it. The backend validates the alternative against verified user-source text. Repeated mentions of its exact value do not invalidate the option: MemoryOS records a deterministic source occurrence and its digests. This establishes attribution, not commitment or authority. The general extraction quote checks remain strict.

Working PowerShell polling example

Response: blocked by the quality gate

Possible blocked status values: L1, L2, L3, L4, and blocked.

Nothing to extract

Some conversations pass the quality gate but contain no durable memory. This is normal. Examples:
  • greetings
  • acknowledgements
  • one-session debugging instructions
  • temporary UI instructions
  • off-topic questions

Idempotency-Key

Use Idempotency-Key when your application may retry the same write request.
MemoryOS replays the same queued response for duplicate requests instead of creating a second job.

Explicit scoped preferences

Use the typed preference contract for explicit property/value/applicability and target-version-bound replacement. Natural-language project qualifiers do not establish this contract. It requires backend enablement; it cannot be combined with a registered source event or agent-bound write in v1.

Retry and replay boundary

Send Idempotency-Key for a retryable application write. Persist the key with the original authorized request before submitting it; reuse both unchanged after a network failure. Do not generate a new key for a retry. For eligible durable tenant admissions, the receipt retains the request-key hash and request binding for at least 24 hours after acceptance and longer while the job is nonterminal. Raw-payload redaction does not remove that binding. Current permissions are rechecked before replay information is returned; changed owner/payload conflicts instead of rebinding the receipt. Redis is an optimization, not the authoritative durable receipt. Protection ends when the receipt/job row is deleted, including explicit tenant/user deletion. A later request may be admitted under current permissions. This is not permanent duplicate prevention. A persisted receipt proves admission, not application; admission uniqueness alone does not prove one logical worker mutation. Registered source-event replay is a separate provenance contract. Confirm the eligible path for your runtime rather than assuming every optional/universal route uses this receipt policy.