Quickstart

Documentation · updated 9 November 2026

In short: Start building: sign up or sign in, and answer four questions about what you are building. Then let your coding agent do the rest with the prompt below, or do it by hand: pair your terminal for a test key, install the SDK, make a test customer, write a memory and recall it. Test keys reach only test customers, so nothing you try touches your live ones.

Set up with your agent

Paste this prompt into your coding agent. It holds no secret: the key reaches your terminal by pairing, which you approve in the browser. Team → API shows the same prompt with your project's id.

Open your coding agent in your product's folder (in Cursor, a chat in Agent mode) and paste this: It works the same in Claude Code, Cursor, Codex.

Add localmem memory to this project.
1. Read https://localmem.org/llms.txt, the Memory API quickstart and "Use it well" it links: what localmem already does (duplicates, retries, history), so this code does not do it again.
2. Run `npx @localmem/memory login` (or `pip install localmem-memory` then `localmem-memory login` in a Python project). Tell me the code it prints; I will approve it in the browser.
3. Install the SDK for this project's language (@localmem/memory or localmem-memory).
4. Ask me: which of our users or companies is one localmem customer, and what data we send (documents, chat turns, facts). Ask whether any of it is health data; if yes or unsure, stop and tell me.
5. Create a test customer, write one memory for it, recall it, and show me the result.
6. Tell me which files you changed. Never print or commit LOCALMEM_KEY_SECRET.
7. Then propose how to wire it into this product, as the quickstart's "Wire it into your product" says: one module that holds the client, writes where the product learns something, reads where it needs context. Ask me what the app is and what one customer is before writing more code.

By hand

1. Pair your terminal

In your product's folder:

npx @localmem/memory login

It prints a code such as WDJB-MJHT and opens app.localmem.org/pair. Check the code matches, choose the project, and approve. The terminal then writes LOCALMEM_PROJECT, LOCALMEM_KEY_ID and LOCALMEM_KEY_SECRET into .env (or the file --env-file names) and adds that file to .gitignore. The code lasts 10 minutes. In a Python project, pip install localmem-memory then localmem-memory login does the same.

Made a key in Team → API instead? When it is made, the app shows LOCALMEM_PROJECT, LOCALMEM_KEY_ID and LOCALMEM_KEY_SECRET together, with one copy for all three. The secret is shown only then; the project's page keeps the other two under Connect your backend.

2. Install the SDK

npm install @localmem/memory     # TypeScript, Node 18.17 or later
pip install localmem-memory       # Python 3.9 or later

Both read the three variables, sign every request and retry safely; see the SDKs. Use them from your backend only: a secret must never reach a browser or an app.

3. Write a memory and recall it

import { Memory } from "@localmem/memory";

const lm = new Memory();
const { tenant } = await lm.customers.create("cust-42");   // your own id for the customer
await lm.documents.send(tenant, {
  text: "Ada Byron joined Acme as head of research on 3 March.",
  as_of: "2026-03-03T09:00:00Z",
});
const { facts } = await lm.recall(tenant, { entity: "Ada Byron" });
console.log(facts);
from localmem_memory import Memory

lm = Memory()
tenant = lm.customers.create("cust-42")["tenant"]
lm.documents.send(tenant, "Ada Byron joined Acme as head of research on 3 March.",
                  as_of="2026-03-03T09:00:00Z")
print(lm.recall(tenant, "Ada Byron")["facts"])

Each fact comes back with its source document and the date it became true. Ask for at_time to hear what was true on a past date.

Wire it into your product

After the first memory, this is the shape that works. Your coding agent reads this section too: the prompt above ends by asking it to propose these steps for your code.

Then