Share a memory box
Give several agents one memory, each with its own key. Invite with a one-time code, see which agent wrote each fact, and remove one agent without touching the others.
A space can have several members. Each member is one agent (Claude Code, Cursor, Codex, a script) with its own key. They read and write the same memory, and every fact records which of them wrote it. Removing one member stops only its key.
A space with one member is private. Once a second one joins, it is shared. There is nothing to switch on.
Invite another agent
From the agent that owns the space, ask it to invite the other one ("invite Cursor into this memory"), or call invite_create yourself:
curl -s -X POST https://api.openmemory.sh/v1/space/invites \
-H "Authorization: Bearer $OPENMEMORY_KEY" \
-H 'content-type: application/json' \
-d '{"name": "cursor"}'{
"id": "inv_...",
"name": "cursor",
"role": "member",
"expires_at": "2026-11-07T10:00:00.000Z",
"code": "omi_...",
"prompt": "Join my openmemory space so we share one memory. ..."
}Paste prompt into the other agent. It redeems the code itself and keeps its own key. You never copy a key between agents, and the owner never sees the new one.
- A code works once and expires after 24 hours (set
expires_in_hours, up to 168). namesuggests the new member's name.roleismemberby default, orowner.GET /v1/space/inviteslists open invites, andDELETE /v1/space/invites/{id}revokes one. Codes are never shown again.
Join with an invite
The invited agent calls this once. It needs no key:
curl -s -X POST https://api.openmemory.sh/v1/invites/accept \
-H 'content-type: application/json' \
-d '{"code": "omi_...", "name": "cursor"}'{ "space_id": "sp_...", "member_id": "mb_...", "name": "cursor", "role": "member", "api_key": "om_...", "next": "..." }The api_key is shown once. Use it like any space key: as Authorization: Bearer on REST, or as the header of the MCP connection at https://mcp.openmemory.sh?tools=all. If the name is taken, accepting fails with 409. Leave name out and a free one is picked (cursor-2).
Who wrote what
Every fact, journal entry, record, action, and event has an author, and those that can change have updated_by:
{
"text": "The launch moved to 15 June",
"origin": "user",
"author": { "id": "mb_...", "name": "cursor" },
"updated_by": { "id": "mb_...", "name": "owner" }
}authoris the member that created it.originstill says where it came from (user,agent, ordream). They answer different questions: which agent and who said it.authorisnullfor things written before the space had members, and for writes by dreaming.- A removed member's facts stay, marked
"removed": true. recallandGET /v1/memoriestakeauthor(a member id, orme) to see what one agent stored.GET /v1/activity(MCPactivity_list) lists who did what, newest first, by id only: writes, approvals, imports, forgets, and member changes. Filter bymemberto see one agent's changes. See Activity log.
get_context tells an agent who it is (you) and, in a shared space, who else is in it (members).
See which app each member uses
GET /v1/space/members (MCP: member_list) shows each member with the app it last connected from, and how it joined:
{
"id": "mb_...",
"name": "my-app",
"role": "member",
"client": { "name": "My App", "version": "1.2.3", "seen_at": "2026-11-12T10:00:00.000Z" },
"oauth": { "client_id": "https://app.example.com/oauth/client.json", "client_name": "My App", "domain": "app.example.com" }
}client is what the app says about itself (MCP clients name themselves when they connect, REST callers by their User-Agent), so it is a label, not proof. oauth is set for members an app's OAuth sign-in created; domain is set when a domain vouches for the app. See Keys and recovery.
Owners and members
| Owner | Member | |
|---|---|---|
| Read and write everything, including what others wrote | ✓ | ✓ |
forget anything in the space | ✓ | ✓ |
| Rename yourself, rotate your own key, leave | ✓ | ✓ |
| Invite, revoke invites, remove others, change roles | ✓ | |
| Change the timezone or dream mode, set the OpenAI key | ✓ | |
| Delete the space | ✓ |
A member calling an owner operation gets 403 forbidden. A space can have several owners, and it always keeps at least one: leaving, being removed, or being demoted is refused (409) if no owner would be left. To hand over a space, promote the new owner first with PATCH /v1/space/members/{id} and {"role": "owner"}.
Remove a member, or leave
curl -s -X DELETE https://api.openmemory.sh/v1/space/members/mb_... -H "Authorization: Bearer $OPENMEMORY_KEY"Its key stops working at once. Every other key keeps working, and nothing it wrote is deleted. To delete what it wrote, use forget or recall with author and delete those facts. Use me as the id to leave a space yourself.
POST /v1/space/key replaces only your own key. Everyone else's stays the same.
Your own OpenAI key
If the space uses your own OpenAI key, every member's recall uses it. It is still encrypted, and each member's key opens it separately. A removed member's key can't open it.
Limits
At most 10 members and 5 open invites per space. Accepting invites is rate limited per IP address, like creating spaces. The space's request limit (120 a minute) is shared by its members. See Limits.
Sharing one key
Agents that share one key still work as before, but they act as one member: you can't tell them apart or remove one of them alone. Use invites, or OAuth sign-in for apps that support it: there, the sign-in page takes an invite code, so the app joins without anyone copying a key.
Concepts
The primitives in an openmemory space - members, memories, journal, records, actions, KV, events, context, batch, and forget - and how they fit together.
Keys and recovery
How openmemory keys work, why each app should have its own, how to see which app each member uses, and how a recovery code gets you back in when every key is lost.