Skip to main content
This guide covers Memory Passport, the user-controlled cross-agent memory flow in MemoryOS. Use this flow when:
  • the same person uses multiple AI agents or apps
  • agents should not automatically share everything
  • the user must approve, review, and revoke access themselves
For the normal single-app setup, use the tenant-specific Quickstart instead.

Production flow at a glance

Memory Passport has two user-facing flows. Keep them separate in your product. Memory Passport has these moving parts: Universal memory API calls require both credentials:
The agent key identifies which app is asking. The UUI token identifies which Memory Passport user is being accessed.

Step 0: Set up your AI agent

Register the AI agent before sending users to the consent page. This step is required: the consent page needs a public agent identity to show users who is requesting access, and MemoryOS needs the agent_id to create a valid grant.
  1. Open Dashboard -> Memory Passport
  2. Click Create Passport agent
  3. Provide your agent name, website, logo, and description for verification.
  4. Choose default requested categories
  5. Copy the public agent_id
  6. Copy and securely save your Agent API Key before continuing
New agents appear as Pending MemoryOS review until the MemoryOS operator team verifies them.
agent_sk_... is shown exactly once. Copy it into your backend secret manager or environment variables before leaving this page. There is no way to retrieve it again — if you lose it, you must rotate the key.Never put agent_sk_... in browser code, client-side config, or version control.

Optional: create agents from your backend

Use the API when you want to automate setup from an internal admin tool, CI workflow, or customer provisioning flow.
MemoryOS returns two important values:
  • id is the public agent_id used in consent URLs
  • raw_agent_api_key is shown once and must be stored server-side
default_categories_requested are pre-selected checkboxes only — the end user can add or remove any category before approving.
Fetch the public profile to preview what the user will see:

Step 1: Explain shared memory in your app

TThe consent page gives your users control over their information. They can review requested permissions, grant or revoke access, and choose how conflicting context should be handled across applications
Do not surprise users with a consent screen. Add a clear button such as:
Suggested product copy:
We use MemoryOS so you can choose which AI apps may remember and use your approved context. You can review or revoke access at any time.
In your app, add a clear user-facing button:
When clicked, generate a consent URL and redirect the user to it:
For most production flows, pass the categories your current feature wants to preselect. The user can still change them before approval:
By default, no callback endpoint is required. If redirect_uri is omitted, MemoryOS displays a hosted completion page after the user finishes the consent flow. If your application needs to update its UI, establish a session, or perform additional actions immediately after approval, provide a redirect_uri:

Multi-agent-service company flow starts here

Production helper for multiple agents

If your company has multiple AI agents, do not manually create consent URLs. Create each Passport agent once in the dashboard, store the public agent_id for each agent, and generate the URL dynamically from one helper.
One company can have many agents. Each agent gets its own agent_id, but your app uses the same consent URL helper for all of them.
Use the helper from any product button:
The agent_id is safe to use in frontend code. The agent_sk_... key is not. Keep agent_sk_... only on your backend.
Use this when your product does not have OAuth/OIDC yet, but you want a signed-in app user to link their app account to their Memory Passport.
Use a consent URL when an AI agent needs permission to read Passport memory. Use a secure-link connector when your service needs to prove that the signed-in user in your app is the same person who owns the Memory Passport. This is what makes multi-service memory work across products like support desks, banks, e-commerce apps, and AI agents without asking users to paste permanent tokens.
Add the connector button once in your app account settings or onboarding flow. If your company has multiple agents, they can all reuse the same verified account connection, while each agent still asks for its own consent grant.
  1. The user signs in to your app.
  2. They click Connect Memory Passport.
  3. Your backend already knows the signed-in user’s stable ID.
  4. Your backend creates a one-time connector link.
  5. Your app redirects the user to that link.
Add one backend route and one frontend button in your app. Required environment variables:
Never put MEMORYOS_API_KEY in browser code
For one-agent products, you can keep a single MEMORYOS_AGENT_ID. For multi-agent products, keep a server-side map of agent names to agent IDs and let the route choose the right one.

Next.js App Router example

Create this route in your app:
Replace auth() with your app’s normal authentication helper. The only required value is a stable signed-in user ID. Frontend button:

Node.js / Express example

This Express example assumes your authentication middleware sets req.user. Replace it with your app’s real session object. Frontend button:

Python / FastAPI example

Replace get_current_user with your normal authentication dependency. The connector token expires after 15 minutes, works once, and is bound to your tenant, agent, and customer record. Create it on your backend; never expose your tenant API key in browser code.

What users should see

In your app, use plain copy:
After the user opens the connector link, MemoryOS handles sign-in, consent, category selection, and connection creation.

Manual dashboard generator

Tenant Dashboard -> Memory Passport includes a manual connector-link generator. Use it only to check one user flow during development. Production apps should generate the connector link server-side when the signed-in user clicks your button.

Step 2C: OAuth connectors

Use this when your product already has OAuth/OIDC for your own users. In the MemoryOS consent/manage app, this appears as a Connect account action. The user chooses your company, signs in on your normal login/approval page, and then lands back on a clear success screen showing that their account is connected.
In your product copy, say: Connect your account or Connect Memory Passport.

OAuth user flow

  1. The user opens the MemoryOS consent/manage app.
  2. They click Connect account.
  3. They choose your company from the organisation directory.
  4. MemoryOS redirects them to your OAuth authorize URL.
  5. The user signs in on your normal login page.
  6. Your OAuth server redirects back to the MemoryOS OAuth callback.
  7. MemoryOS verifies the account and creates a verified organisation connection.
Use secure-link connector mode from Step 2B if you do not have OAuth yet. Use OAuth when you already have an OAuth/OIDC login system and want the cleanest user-first account connection flow.

What you need to build

OAuth connector mode is not magic. Your product must expose the normal OAuth/OIDC endpoints that MemoryOS can call. MemoryOS stores only a tenant-scoped hash of the returned user ID. It never stores the user’s password, OAuth token, or raw account ID.

Step 1: Register your organisation connector

Register your organisation directory entry once. This tells MemoryOS where to send users when they choose your company.
Store oauth_client_secret only in your backend or MemoryOS connector configuration. Do not place OAuth secrets in public docs, frontend code, or mobile apps.

Step 2: Implement your authorize endpoint

MemoryOS sends the user to your authorize endpoint with a callback URL and state token:
Your app should show the normal login or approval screen. After the user approves the connection, redirect to the MemoryOS OAuth callback:

Step 3: Implement your token endpoint

MemoryOS calls your token endpoint to exchange the temporary code for an access token:

Step 4: Implement your userinfo endpoint

MemoryOS calls your userinfo endpoint with the access token. Return a stable user reference:
MemoryOS hashes sub with your organisation ID and creates the verified connection in the user’s Passport.

What the user sees after OAuth

After MemoryOS verifies the userinfo response, the user sees a success screen in the consent/manage app:

Step 3: Let MemoryOS complete the user action

MemoryOS handles the user-facing action after your app redirects the user. There are two different records:
An organisation connection is not the same as an agent permission grant. The connection proves account ownership. The grant decides which agent can read or write memory.
The consent and connector pages handle:
  • new user account creation
  • email OTP login
  • category selection
  • duration selection
  • grant creation
  • secure-link connector creation
  • OAuth connector completion
  • grant notification
  • revoke/manage link
Grant rules:
  • access type may be read_only or read_write
  • grants are category-scoped
  • revoked grants return empty results instead of leaking whether memory exists

Step 4: Use universal memory from your agent

After the user has approved your agent, your backend or agent can call Universal Memory. Universal API calls require: MemoryOS checks the active grant for that exact (agent, user) pair before returning anything.
The consent redirect returns status and state; it does not put the user’s uui_... token in the URL. Use state to match the consent result to your app session. Keep any UUI token or Passport session handling server-side or in the MemoryOS consent/manage app.
If the user connected your service account through Step 2B or 2C, that connection helps MemoryOS know the Passport user belongs to your signed-in account. Your agent still needs an active grant before Universal Memory retrieval returns context.
If this agent does not have an active grant for this user, retrieval returns no context and includes a permission status such as no_grant_for_user. If the grant is read_write, the agent can also add universal memories:
If the grant is read_only, write attempts return:

Integration note

The hosted completion page removes the need for every product to build a callback route. Use hosted completion when:
  • your app only needs user-facing permission confirmation
  • you are testing the flow manually
  • your product does not need to update its own UI immediately
Use app-owned callback mode when your app needs to update its UI immediately after consent. MemoryOS redirects to your callback with:
or:
Use secure-link connector mode when your app needs to associate a signed-in app account with the user’s Memory Passport identity. Use OAuth connector mode when your product already has OAuth/OIDC and you want users to start account linking from the MemoryOS consent/manage app. For raw REST request and response examples, use the Universal Memory APIs reference.

User management

Users manage grants, connections, memories, and questions in the MemoryOS consent/manage app. It lets users:
  • see which agents have access
  • see which organisations are connected
  • disconnect an organisation connection
  • revoke access
  • review memories
  • answer pending questions when MemoryOS needs the user to resolve a personal memory conflict
  • flag or correct memories
  • delete their Memory Passport data
Pending Questions can ask the user to choose the first version, the second version, both are correct, or neither is correct. If they choose one version, MemoryOS archives the conflicting version. If they choose both, both memories remain valid for that user. If they choose neither, the clarification is closed without treating either version as confirmed.

Privacy guarantees

Memory Passport is designed so that:
  • one agent cannot see which other agents were granted access
  • one organisation cannot add itself to a user’s Passport without user action
  • organisation connections do not automatically grant agent memory access
  • denied or revoked grants return empty results
  • universal memories are stored separately from tenant-scoped memory
  • grants are category-scoped and revocable