- the same person uses multiple AI agents or apps
- agents should not automatically share everything
- the user must approve, review, and revoke access themselves
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:
Step 0: Set up your AI agent
Recommended: use the dashboard
- Open Dashboard -> Memory Passport
- Click Create Passport agent
- Provide your agent name, website, logo, and description for verification.
- Choose default requested categories
- Copy the public
agent_id - Copy and securely save your Agent API Key before continuing
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.idis the publicagent_idused in consent URLsraw_agent_api_keyis shown once and must be stored server-side
Step 1: Explain shared memory in your app
Do not surprise users with a consent screen. Add a clear button such as: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.
Step 2A: Add the agent consent button
In your app, add a clear user-facing button: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 publicagent_id for each agent, and generate the URL dynamically from one helper.
Step 2B: Add the secure-link connector button
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.
- The user signs in to your app.
- They click Connect Memory Passport.
- Your backend already knows the signed-in user’s stable ID.
- Your backend creates a one-time connector link.
- Your app redirects the user to that link.
Never put
MEMORYOS_API_KEY in browser codeNext.js App Router example
Create this route in your app: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
req.user. Replace it with your app’s real session object.
Frontend button:
Python / FastAPI example
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: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
- The user opens the MemoryOS consent/manage app.
- They click Connect account.
- They choose your company from the organisation directory.
- MemoryOS redirects them to your OAuth authorize URL.
- The user signs in on your normal login page.
- Your OAuth server redirects back to the MemoryOS OAuth callback.
- MemoryOS verifies the account and creates a verified organisation connection.
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.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: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: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:
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
- access type may be
read_onlyorread_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.no_grant_for_user.
If the grant is read_write, the agent can also add universal memories:
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
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
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