Skip to content

Move from Supermemory

Bring a Supermemory account into Alexein with one command, then change a few calls. How namespaces, documents, memories and profiles map, and what does not carry over.

Supermemory keeps documents and memories per namespace (containerTag before its v5 API). Alexein keeps items per app user, named by the X-Alexein-User header. Moving takes two steps: one command copies every namespace's documents and memories into an app user of the same id, and then your code swaps a handful of calls.

Supermemory's v3 and v4 API closes on 31 December 2026, and v5 changes every call. If you are rewriting those calls anyway, you can write them for Alexein instead.

1. Import your Supermemory account

Set both keys, look at what would be added, then add it:

Terminal
export SUPERMEMORY_API_KEY=sm_...    # your Supermemory API key
export ALEXEIN_API_KEY=ax_...        # a read and write API key, from the Console
uvx alexein-cli import supermemory --dry-run
uvx alexein-cli import supermemory
Output
Importing Supermemory into Acme/Production, reads and writes.
  user_4f8a -> user_4f8a  documents 212/212 read, 210 added
  user_4f8a -> user_4f8a  memories 540/540 read, 131 added
  user_9c1d -> user_9c1d  documents 18/18 read, 18 added
  user_9c1d -> user_9c1d  memories 61/61 read, 42 added
Added 401 items for 2 app users; left out 2 no text, 412 learned from an imported document, 16 inferred and never confirmed.
Each user's app user id is after its ->: your app sends it as X-Alexein-User.

It reads every namespace your key can see, and each one's documents, with their text, and memories. It adds the documents, and the memories that did not come from them, to Alexein, 500 at a time. Namespaces written with containerTag on v3 or v4 are read the same way: they are the same names. The dry run reads everything and prints the first item as it would be added, and adds nothing.

  • Run it again at any time. Every item's id comes from its Supermemory id, so a second run edits the items the first one added and never copies them. An import that stops names the namespace it stopped at: run it again, with --from that namespace to carry on from there.
  • Namespaces stay as they are. A namespace becomes the app user of the same id. Only one that cannot be a header, longer than 128 characters or not plain ASCII, becomes a stable u_… digest: the output says which, so keep it. See App users.
  • Some namespaces, or some of each. --from <namespace> imports only that namespace (repeat it for more), so sm_project_default and test namespaces can stay behind. --only documents brings the documents alone, and --only memories every memory and no document. With --user <id>, the one namespace you name goes into the app user you choose. A personal key imports one namespace into your own memory.
  • Keys stay private. The Supermemory key is read from SUPERMEMORY_API_KEY only and is never printed. The Alexein key is the one the CLI already uses: --key, ALEXEIN_API_KEY or alexein login.

Which memories come across

Alexein learns its own facts from the documents you import, so a memory Supermemory learned from one of those documents would only say the same thing twice: it is left out. So is a memory Supermemory inferred and nobody confirmed. The memories that come across are the ones that came from no imported document: those your app added as memories, inferred ones a person confirmed, and those of a document that had no text to import. The last line counts each kind left out.

How the concepts map

SupermemoryAlexein
Namespace (containerTag in v3 and v4)The app user, named by the X-Alexein-User header. One app user per namespace.
A document (content, title)An item of kind document, with its text and title.
A memory (memory text)An item of kind note, when it came from no imported document. A static memory carries supermemory_static: true in metadata.
Document or memory id (customId before v5)Item id supermemory-doc-<id> or supermemory-mem-<id>, and supermemory_id in metadata.
system.createdAtat: when Supermemory took the item in. A document's own date is not in what the import reads.
metadatametadata as it was, with imported_from: "supermemory" and supermemory_id added, and a document's supermemory_url and supermemory_type when it has them. Filterable.
A conversation added under one idItems of kind message, one per turn, each with its role, in one session.
date (documentDate before v5), when you addat, in the code you change.
filterfilters, on author, mentions and metadata keys.
Profile (static, dynamic, buckets)profile: what is true about the person now, as one text for a system prompt. summary has every line, and every search also starts with what is known.

2. Change your code

Each Supermemory call has one counterpart. The namespace moves from the first argument to user(), and is sent as the header, never as a field a model could fill in.

Before: Supermemory v5
import { Supermemory } from "supermemory";

const client = new Supermemory({ apiKey: process.env.SUPERMEMORY_API_KEY });

await client.add("user_123", {
  content: "user: I moved to Lisbon.\nassistant: Congratulations!",
  id: "conv_1",
});
const { results } = await client.search("user_123", { query: "Where does the user live?" });
const { profile } = await client.profile("user_123");
const { documents } = await client.list("user_123", "documents");
await client.documents.delete("user_123", { ids: ["conv_1"] });
await client.namespaces.delete("user_123");
After: Alexein
import { Memory } from "@alexein/sdk";

const user = new Memory().user("user_123"); // ALEXEIN_API_KEY

await user.add(
  [
    { text: "I moved to Lisbon.", role: "user", author: { self: true } },
    { text: "Congratulations!", role: "assistant" },
  ],
  { session: "conv_1" },
);
const found = await user.search("Where does the user live?");
const promptContext = found.context(); // ready for a system prompt
const { text: profile } = await user.profile(); // for your system prompt
for await (const item of user.iterItems()) console.log(item.id, item.text);
await user.forget({ sessions: ["conv_1"] });
await user.delete();
Supermemory v5Alexein
add(namespace, { content, id })add: a conversation's turns as message items in one session; a text as a document with a title; a single statement as a note.
documents.batchAddadd with a list: up to 500 items a request, more sent in batches for you.
search(namespace, { query })search. context() gives the text to put in a prompt.
profile(namespace)profile: what is true about the user now, as text for a system prompt.
list(namespace, "documents")items, newest first and paged: what you added, as you sent it.
documents.get(namespace, id)item, by its id.
documents.update / add again with an idadd again with the same id, only to fix the same statement. When something changed, add a new item.
documents.delete(namespace, { ids })forget with items, or sessions for a whole conversation.
memories.forget(namespace, { ids })forget with refs, for a fact search returned.
namespaces.delete(namespace)users/delete, or delete the app user in the console.
namespaces.list()users: every app user of the project, with how much each holds.
withSupermemory(model, …)Automatic memory: wrap the Anthropic or OpenAI client, or the AI SDK model.

What changes

  • Searchable at once. An add is searchable within seconds, with nothing to set. Its facts follow, usually within minutes; status says how far each item has got.
  • Search returns more than a list. A search answers with what is known about the people and things asked about, dated facts and the excerpts behind them, each with a ref. There are no modes, thresholds or rewrites to set; fast trades a little precision for speed. See Search.
  • Nothing is overwritten for you. A later value does not replace an earlier one: both are kept with the day each was said, and search shows the newest first. See Values and history.
  • An edit is for a mistake. Adding again under a Supermemory id adds to that document. Here, the same id replaces the item's text, so send it again only to fix the same statement. New turns of a conversation are new items in the same session. See Versions and edits.

What does not carry over

  • Memories learned from an imported document. Memory learns its own facts from the document, so these are left out and counted. --only memories brings every memory instead, with no documents.
  • Inferred memories nobody confirmed. These are left out and counted; a confirmed one comes across.
  • Chunks and memory links. Supermemory's chunks of a document, and the links between its memories, are not copied. Alexein searches a document in excerpts of its own and learns how things relate from what it holds.
  • Forgotten memories and earlier versions. Supermemory lists only the newest version of each memory and hides forgotten ones, so neither is imported.
  • Documents with no text yet. A document still processing for the first time, or whose first processing failed, has no text to bring: the output counts it as no text. Run the import again once it is done. One whose later replacement failed keeps its earlier text, and that comes across.
  • Files themselves. An uploaded file comes across as the text Supermemory took from it, with its url in metadata as supermemory_url, not as the file.
  • Very large documents. A document over 950 KB is left out and counted. Split it, and add the parts as documents of their own.
  • Profiles, buckets and settings. Memory builds what it knows of each person from what is imported, so profile and summary fill in over time. Profile buckets, a namespace's supportingContext, connectors and organisation settings are not copied.

3. Check

Search for a namespace you know well, or ask how far an item has got:

Terminal
uvx alexein-cli search "Where does the user live?" --user user_4f8a
uvx alexein-cli status supermemory-doc-conv_1 --user user_4f8a

stored means searchable, and processed means its facts are ready.