Skip to main content
Install the TypeScript SDK:
The client connects to https://api.memoryo.dev by default. Do not pass a base URL for the hosted service.

Clients

  • Tenant-scoped client: MemoryOS
  • Private-beta cross-agent client: UniversalMemoryOS (disabled by default)
UniversalMemoryOS is retained for the frozen Memory Passport private beta. It will receive 404 memory_passport_not_available unless MemoryOS explicitly enables the feature for your deployment. Use MemoryOS for supported production integrations.
Use MemoryOS for normal workspace memory inside your tenant. Use UniversalMemoryOS only in an explicitly enabled private-beta deployment after a user grants your global agent access.

Tenant-scoped memory

This path uses your application’s existing user identity. It does not require Memory Passport, a user consent redirect, or the UniversalMemoryOS client.

First integration: simple mode

Start here when one backend writer supplies context for a stable user. You do not need eventId, runId, service writers, or authority rules. MemoryOS creates safe internal source metadata automatically.

add()

add() queues a conversation for extraction. It returns quickly; extraction runs in the background.
You may submit the completed user and assistant turns. In simple mode, assistant text is retained as conversation context but is not authoritative user evidence. MemoryOS stores a claim only when a user turn directly states or confirms it. For a durable evidence trail, provide an externalTurnId for each persisted turn. It is a stable identifier from your chat system, not a claim created by the model. Use sourceKind when the role alone is insufficient to describe the origin, such as tool_output or fetched_document. Messages are limited to 64 per request and 16,000 characters each.

Explicit assistant proposals

Preview Phase 3A contract: requires the structured-proposal backend migration and an SDK release containing ProposedMemory. Confirmation is feature-gated and remains off until the deployment passes its release evaluation.
Use the seventh add() argument, conversationId, consistently for one chat. Only mark assistant turns deliberately presented as memory proposals. The marker requires sourceKind: "assistant_output" and a proposedMemory whose exact claim appears in the user-visible assistant text. It never grants user authority or proves consent. Registration is tenant-scoped, not universal.
Job status exposes proposalIds and operationalMetrics.queue_wait_ms when available. Proposal IDs are not stored memory IDs. When confirmation is enabled, submit the proposal turn and later direct user reply with the same conversationId and stable turn IDs. MemoryOS binds the reply to the immutable proposal and stores the registered claim only after deterministic evidence checks accept it; model confidence never grants authority.

For multi-service companies: source-aware mode

Use this when Billing, Support, CRM, Product, or another backend service can write facts about the same user. Source metadata enables auditability, deduplication, conflict handling, and authority rules.
Pass the optional fifth argument when multiple backend services can write memory for the same user. Use MemoryOS.source(...) so your app does not have to manually generate every ID while testing.
Register billing-service in the Tenant Dashboard before sending it as source.service; unknown or inactive service keys are rejected. For production, bind a dedicated API key to the writer so its authority is explicit. Only use source-aware mode for authenticated backend observations. It can treat a registered service’s declarative assistant-role message as authoritative; it must not be used to promote an ordinary chatbot answer into user memory.

Parameters

Return fields

Check extraction job status

Use getJobStatus() for one check or waitForJob() when setup, tests, or a workflow must confirm persistence before continuing.
pendingCandidatesBuffered > 0 means MemoryOS kept a weak signal for reinforcement instead of dropping it. Normal user-facing requests should queue add() without waiting. Use createdMemoryIds when you need the exact records created by this job.

get()

You can also use the object form:

Parameters

Return fields

Each MemoryItem also includes sourceEventId and provenance when available.

Resolve a clarification in the same chat

The backend verifies tenant and user ownership, expiry, conflict state, and the allowed transition. The model may present the question, but it must not invent the resolution or decide authority.

feedback()

Use feedback after retrieval to tell MemoryOS whether the memory helped. This improves lifecycle scoring and can queue retrospective extraction after user corrections.
When a user corrects the answer, send the correction text:
If correctionJobId is present, MemoryOS queued an async retrospective extraction pass. Do not block your user flow while that job runs.

Domain schemas

Domain schemas are configured on the tenant, not in SDK code. Your code stays the same across domain modes. For Support, your own backend tools still provide live truth such as order status, invoice status, refunds, or ticket updates.

Domain profile helpers

For domain-aware tenants, normal get() already includes domain-aware context. Use profile helpers only when your product needs structured UI data.

Other tenant methods

delete()

list()

export()

export() maps to GET /v1/users/{external_user_id}/export. It returns the tenant and proxy-user IDs plus that user’s memories and complete version history.

UniversalMemoryOS

The universal client is independent from MemoryOS. It uses agent credentials and a user UUI token:
  • Authorization: ApiKey agent_sk_...
  • X-MemoryOS-UUI: uui_...

UniversalMemoryOS.consentUrl()

Redirect users to this URL when they click a control such as “Connect shared memory”. If you pass null for the callback, MemoryOS shows a hosted completion page after approval. Users can add or remove categories before approving.

universal.add()

universal.get()

Universal retrieve responses include the normal retrieve fields plus: Universal memory items retain sourceEventId and provenance when the API returns them.