api.memory

Overview

Short notes an agent keeps from one session to the next. Not a log, not a file store — a handful of durable facts, and the user can read every one of them.

3 methods200 notes4 000 characters each
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

A session remembers a conversation. Memory remembers across conversations: a preference, a correction that keeps coming up, a fact that will not change. The agent writes one when it learns something durable — not after every exchange.

The methods

MethodDoes
list({ limit })Every note on the account, most recently changed first.
save({ name, content, … })Creates or replaces a note. The name decides which.
delete(name)Removes one. Answers whether there was anything to remove.

A note

{
  id: "…",
  name: "tone-of-voice",
  description: "How this user wants to be written to",
  content: "Prefers short, direct answers in French. No bullet lists unless asked.",
  type: "preference",
  source: "user",
  createdAt: "2026-09-30T18:02:11.000Z",
  updatedAt: "2026-10-07T11:02:08.400Z"
}
{
    "id": "…",
    "name": "tone-of-voice",
    "description": "How this user wants to be written to",
    "content": "Prefers short, direct answers in French. No bullet lists unless asked.",
    "type": "preference",
    "source": "user",
    "createdAt": "2026-09-30T18:02:11.000Z",
    "updatedAt": "2026-10-07T11:02:08.400Z",
}

Only the index is carried, not the content

The system prompt receives one line per note — its name and its description. The content is opened only when it is needed. That is what makes two hundred notes affordable: you pay for the index on every answer, and for a note's text only when it is read.

The description is what decides whether a note is ever used

It is the only thing the agent sees when choosing. « Notes » tells it nothing; « How this user wants to be written to » tells it exactly when to look.

The limits, and why they are low

LimitValue
Notes per account200
Content4 000 characters, trimmed past it
Description200 characters
Name64 characters, lowercase, digits and hyphens

These are not storage limits, they are design limits. Memory that grows without bound stops being memory: the index gets expensive, and the agent cannot tell what matters. Documents belong in a storage; project instructions belong in a file in the workspace.

What belongs here, and what does not

BelongsDoes not
« Answers in French, short. »A transcript of a conversation.
« Deploys on Friday are refused. »A document, or an extract of one.
« Always calls the production database prod-eu. »Anything that changes every day.
« Corrected twice: the invoice total includes tax. »A secret, a key, a password.
Never put a credential in a note

A note is read back into a model's context by design, and shown to the user in plain text. Keys belong in your secret store, and nowhere a model will read them.

They belong to the account, and they are visible

Notes are not per-session and not per-device: one set, readable and editable by the user. source says who wrote each one — agent when it learned it, user when a person did.

const notes = await api.memory.list();

const learned = notes.filter((n) => n.source === "agent");
// What the agent has decided to remember about this account.
// Showing it to the user is the honest default: it is about them.
notes = api.memory.list()

learned = [n for n in notes if n["source"] == "agent"]
# What the agent has decided to remember about this account.
# Showing it to the user is the honest default: it is about them.