openmemory
Docs

Export and import

No lock-in. Export everything your agents stored, take it to ChatGPT, Claude, your code editor, or your own agent, and bring memory from them into openmemory. With prompts for each.

Your memory isn't locked in. Everything your agents store is plain text that you can read at any time, and one request exports all of it. There's no format you need our code to read. You can take your memory to ChatGPT, Claude, a code editor, or your own agent, and bring memory from those into openmemory the same way.

What you can export

WayWhat you getNeeds
Ask your agent (prompt below)Every live fact as Markdown, grouped by subjectAny connected agent. recall is one of the four default tools.
GET /v1/export (MCP space_export)The whole space as one JSON documentThe space key
GET /v1/memories?limit=100Live facts, a page at a timeThe space key

GET /v1/export has everything: facts (including ones that were replaced or have expired), the journal, records, actions, KV, events, and who is in the space. It never contains keys, invite codes, recovery codes, or an OpenAI key.

bash
curl -s https://api.openmemory.sh/v1/export -H "Authorization: Bearer $OPENMEMORY_KEY" > openmemory-export.json
json
{
  "format": "openmemory-export",
  "version": 1,
  "exported_at": "2026-11-12T10:00:00.000Z",
  "space": { "...": "settings and usage" },
  "members": [], "invites": [],
  "memories": [
    {
      "id": "mem_...", "subject": "Sam", "text": "Prefers Thursday reviews",
      "tier": "core", "tags": [], "pinned": true, "origin": "user", "expires_at": null,
      "author": { "id": "mbr_...", "name": "claude-code" }, "created_at": "...", "updated_at": "..."
    }
  ],
  "journal": [], "records": [], "actions": [], "kv": [], "events": []
}

A fact is live when expires_at is null or still in the future. Replaced facts have expires_at set to the moment they were replaced.

Export with a prompt

Paste this into any agent connected to openmemory:

Export my openmemory so I can use it somewhere else.

1. Call recall with no q and limit 100. Keep calling it with cursor set to next_cursor until next_cursor is null.
2. Write every fact to openmemory-export.md, grouped by subject, with facts that have no subject under "General". Put pinned and core facts first. One line per fact: the text, then [tier, origin, author.name].
3. Don't merge, reword, or drop facts, and don't add anything that isn't stored.
4. Tell me how many facts you wrote and whether that matches total.

If you can't write files, show the whole export in one Markdown code block instead.

The rest of this page starts from that file. With the JSON export instead, tell the agent to read openmemory-export.json and use only the facts in memories that are live.

Take it somewhere else

Each prompt below turns your export into what the destination reads. Run it in the agent that has the export, check the result, then paste or save it. The prompts leave out short-lived notes and anything secret, because the destination may show or sync it in places openmemory doesn't.

You can also keep openmemory and connect it to those tools: most of them support MCP, and every tool you connect reads and writes the same memory. See the agent guides.

ChatGPT

Turn memory on in ChatGPT (Settings > Personalization > Memory), then paste the list into a new chat. ChatGPT saves what you ask it to remember. To check, ask it what it remembers about you.

From openmemory-export.md, write a message I can paste into ChatGPT so it remembers me.

- Start with: "Please remember these facts about me:"
- One fact per line, in the first person ("I prefer...", "My manager Sam...").
- Keep facts about me, the people I mention, my preferences, my work, and projects that are still going. Leave out scratch-tier facts, ids, keys, passwords, and anything private I wouldn't tell a new assistant.
- Most important first. Merge only exact duplicates.
- Put the message in one code block.

Claude

In claude.ai or Claude Desktop, open Claude's memory import at claude.ai/import-memory, paste the list, and add it to memory. Where memory import isn't available, add the list as a file in a Project instead.

From openmemory-export.md, write a summary I can paste into Claude's memory import.

- Group it under short headings: About me, Work, People, Preferences, Projects.
- Under each, one fact per line, in the first person.
- Leave out scratch-tier facts, ids, keys, passwords, and anything private I wouldn't tell a new assistant.
- Don't add anything that isn't in the file. Put the result in one code block.

Claude Code, Cursor, Codex, and other code editors

Coding agents read instructions from files in your project: Claude Code reads CLAUDE.md, Cursor reads .cursor/rules/*.mdc and AGENTS.md, and Codex and many other agents read AGENTS.md. These files are usually committed, so keep personal facts out of them.

From openmemory-export.md, add what matters for this repository to AGENTS.md (or CLAUDE.md if that's the file this project uses).

- Keep only facts about this project and how I like to work on code: conventions, tools, decisions and the reasons for them, things to avoid.
- Leave out personal facts, anything about other people, ids, keys, and anything secret. This file gets committed.
- Short imperative bullets ("Use pnpm, not npm.") under one "## Notes from openmemory" heading. Don't repeat what the file or the code already says.
- Show me the diff before you write it.

For a Cursor rule instead, ask for .cursor/rules/openmemory.mdc with frontmatter description: Notes carried over from openmemory and alwaysApply: true. Cursor ignores plain .md files in that folder.

Your own agent or project

The JSON export is the simplest input: filter to live facts and put them in your agent's own store, or in its system prompt if there are only a few.

From openmemory-export.json, write facts.json for my own agent: an array of {"subject", "text", "tags", "said_by_user"} for every live fact in memories (expires_at is null or in the future). said_by_user is true when origin is "user". Leave out scratch-tier facts. Don't change the text.

Bring memory into openmemory

From ChatGPT, Claude, Gemini, or another assistant

First ask the other assistant to list what it knows about you. Paste this there:

List everything you remember about me from your saved memory and our past conversations: who I am, my work, the people I mention, my preferences, my projects, and decisions I've made.

- One fact per line, in plain words, grouped by topic.
- Copy facts as you stored them. Don't guess, summarize, or fill gaps.
- Leave out passwords, keys, and anything secret.
- Put the whole list in one code block.

Then paste the list into an agent connected to openmemory, with this prompt (change the name of the assistant):

Import this list from ChatGPT into openmemory.

1. Read it all first. Drop lines that are vague, out of date, or secret (passwords, keys, codes).
2. Show me the facts you'll store, one per line with its subject, and wait for my OK. I'll fix or remove some.
3. Store them all with one memory_import call: facts, each with a subject (who or what it's about) and the text, and source "chatgpt". Use tier "core" only for the few facts every task needs.
4. Tell me how many were created and skipped, and which lines you dropped, and why.

<paste the list here>

memory_import (POST /v1/memories/import) stores up to 500 facts in one transaction, as stated by you (origin user), tagged imported and the source, with source_ref import:chatgpt. Facts already stored are skipped, so running the import twice doesn't make copies. If the list doesn't fit in the space's memories limit, nothing is stored. Imported facts are findable by their words at once and by meaning within minutes.

The list can also go in as it is: memory_import with text takes one fact per line, strips bullets and numbering, and skips blank lines and # headings. Facts from text all get the same subject (none by default), so sending facts with a subject each recalls better.

memory_import is listed with ?tools=chat and ?tools=all. With the default four tools, agents can still call it by name.

With the REST API:

bash
curl -s -X POST https://api.openmemory.sh/v1/memories/import \
  -H "Authorization: Bearer $OPENMEMORY_KEY" -H 'content-type: application/json' \
  -d '{"source":"chatgpt","text":"- I live in Lisbon\n- My manager is Sam Lee\n- I prefer short answers"}'
json
{ "created": 3, "skipped": 0, "ids": ["mem_...", "mem_...", "mem_..."], "next": "Stored 3 facts as origin user, ..." }

From project files and notes

Read CLAUDE.md, AGENTS.md, and .cursor/rules/ in this repository (and any notes file I point you to). Find facts that should follow me to other tools: my preferences, conventions I chose, and decisions with their reasons. Skip build commands and anything another agent can read from the code.

Show me the list. After I OK it, store the facts with memory_import, each with a subject, and source "project-notes".

From chat transcripts

For a saved conversation (for example, one chat from ChatGPT's data export), use extract_job with messages: up to 100 messages of up to 8,000 characters each. Your agent's model picks out the facts and extract_submit stores up to 20 at a time. Do it one conversation at a time. Use extract_job for conversations and memory_import for lists of facts. extract_job is listed with ?tools=all, and agents can call it by name without that.

Move to another space

To move your facts from one space to another, export the old space and replay its live facts into the new one with POST /v1/batch, 50 at a time:

js
// node import.mjs openmemory-export.json   (Node 18 or later)
import { readFile } from "node:fs/promises";

const API = "https://api.openmemory.sh";
const key = process.env.OPENMEMORY_KEY; // the key of the space you're importing into
const data = JSON.parse(await readFile(process.argv[2], "utf8"));
const now = new Date().toISOString();

const ops = data.memories
  .filter((m) => m.expires_at === null || m.expires_at > now) // replaced and expired facts stay behind
  .map((m) => ({
    op: "memory.remember",
    input: {
      subject: m.subject,
      text: m.text,
      tier: m.tier,
      tags: m.tags,
      source_ref: m.source_ref,
      pinned: m.pinned,
      origin: m.origin === "user" ? "user" : "agent",
      expires_at: m.expires_at,
    },
  }));

for (let i = 0; i < ops.length; i += 50) {
  const res = await fetch(`${API}/v1/batch`, {
    method: "POST",
    headers: { authorization: `Bearer ${key}`, "content-type": "application/json" },
    body: JSON.stringify({ ops: ops.slice(i, i + 50) }),
  });
  if (!res.ok) throw new Error(`batch ${i / 50 + 1}: ${res.status} ${await res.text()}`);
}
console.log(`Imported ${ops.length} facts.`);

Running it twice is safe: identical facts are stored once.

What changes on the way:

  • Facts get new ids, and the author is the member whose key you used. created_at is the time of the import, and recall counts start at zero.
  • Facts dreaming wrote (origin dream) come in as origin agent.
  • The script moves facts only. The journal, records, KV, and events are in the export too, and you can replay them with the journal.put, record.put, kv.set, and event.append batch ops.
  • Members and keys don't move. Invite your other agents into the new space (see Share a memory box).

Leaving for good

Export first, then delete the space with DELETE /v1/space (owners only). It removes everything at once, for every member. See Forget and privacy.