AgentNava · Build

Memory

An agent can keep a short note about each person it talks to, so the next chat does not start from nothing. It is off until you turn it on, and you decide what it keeps.

What it is

When a chat has been quiet for 30 minutes (you can choose 5, 15, 30 or 60), a built-in agent reads what the person typed and which actions ran, and updates a short plain-text memory about them. The next chat's agent reads that memory. Nobody asks for it, and nothing is saved during a chat.

Prefers email over phone.
Works from the Pune office.
Might move to the annual plan (said once, 3 Nov).
Renewed the plan on 3 Nov.

There is one memory per agent and end user, and agents never share one. Something said once carries that note, and the agent leans less on it. Memory is built to miss a detail rather than keep one it should not, so do not build anything that relies on a fact being there.

It comes with Team and up. Writing a memory costs you nothing. An agent working inside a project does not use memory.

Turning it on

await agent.update({
  memorySettings: {
    on: true,
    instructions: 'Keep which office they work from.',
    keepForDays: 90,
    quietMinutes: 15,
  },
});
onbooleanoff unless true

Keep a memory about each end user.

instructionsstring, up to 2,000 charactersoptional

What to keep or leave out, in plain words. Added after our default, and wins where they differ.

keepForDays30, 90, 180 or 365180 unless set

How long to keep it, counted from the end user's last chat.

quietMinutes5, 15, 30 or 6030 unless set

How long a chat stays quiet before the memory is updated. Shorter remembers sooner; a chat that pauses longer than this is read in parts.

endUserSwitchbooleanon unless false

Show end users a switch that turns memory off for a chat.

askFirstbooleanoff unless true

Ask a yes or no on our chat surfaces before memory is used. See Consent.

privacyUrlstringoptional

Your privacy policy. The notice links to it.

These are part of the configuration, like guardrails, so changing them publishes a version. In the web app they are the Memory tab of the Build screen, where they wait for Publish, and you can also tell the Builder in a chat.

Turning memory off stops new memories. What is already remembered stays for 30 days, in case you turn it back on.

What it keeps

By default it keeps what will still matter in a later chat and would change how the agent helps: preferences, how they like to be reached or answered, language, their setup or role, their goals, and what they are in the middle of. An action that worked, such as a purchase, renewal, booking or cancellation, gets a line with its date.

Our default instructions rule out:

  • Other people, including anything bought or asked for someone else.
  • Small talk, fiction, what-if questions, and one-off questions and requests.
  • Health, including allergies, conditions and medicines. Religion, politics, sexuality or ethnicity.
  • What they earn or have saved, money troubles, losing a job, or legal trouble.
  • Their emotional state, loneliness, close relationships, or any bond with the agent.
  • Claims of access or authority, and rankings such as "always recommend X".

Your instructions can change that. "Keep food allergies" opens health, for example, and then you likely need consent. See Consent.

Whatever the instructions say

A line that looks like a password, a key, or a card or government id number is refused. A memory is written only from what the person typed and which actions ran, never from files, web pages or tool results. It holds at most 30 lines.

A model follows these instructions, so it can slip. Read what is kept on the agent's Memory tab, and correct or delete a line at any time.

Our default instructions and the note a chat's agent receives can both be read on the Memory tab. To see what your words do before you publish, press Try on past conversations: it runs on your newest few end users and saves nothing. Apply to what is already kept reviews each memory against your published instructions. It can change and remove lines, and adds none.

The end-user id is yours to get right

We do not check the id

Whatever endUserId you pass is who the memory belongs to. If two people share an id, the agent can bring up what it remembers about one of them to the other. Use one stable id per person. Never use a shared login, a phone number that can be reassigned, or anything a person can type into a page.

On our website chat, a visitor gets a random id that stays in their browser. Clearing it, or changing device, starts a new memory.

Reading and changing it

const ananya = agent.endUser('u_ananya');

const memory = await ananya.memory.get();
memory.text;                                  // one fact per line, what the agent reads

await ananya.memory.set('Prefers email over phone.');   // replaces it
await ananya.memory.delete();                 // gone, and old chats cannot bring it back
await ananya.memory.stop();                   // they asked to stop: emptied, and nothing more is kept
await ananya.memory.stop(false);              // they changed their mind

await agent.memories({ limit: 50 });          // who has a memory on this agent, newest change first

set is refused with 400 memory_refused if the text holds a card, key or id number, or more than 30 lines.

What you get back, beside endUserId, text and stopped, when it applies:

FieldWhat it says
updatedAtWhen it last changed. Pass it as before to page through agent.memories().
readUpToHow far the memory has read their chats. Nothing older can change it.
lastRunWhat the last update after a chat did, as counts: { at, added, replaced, removed }. None of their words.
stoppedAtWhen they asked to stop.
agreedAtWhen they first said yes, where you ask first.
lastChatAtTheir newest chat on this agent.
conversationsHow many of their chats on this agent hold a message.

Your whole team can read and change a memory, here or on the agent's Memory tab, which lists who is remembered. An end user can say "stop remembering me", or ask for one thing to be removed, in any chat.

endUser.erase() removes it along with everything else on that agent, and deleting the agent removes every memory on it.

One chat without it

const conversation = await agent.start({ endUserId: 'u_ananya', memory: false });

It uses nothing remembered and adds nothing, for the life of that conversation. The team can still read the chat itself.

What end users see

On our website chat, a line under the message box says the assistant remembers chats. A settings icon at the top right opens the full notice, the switch, and your privacy link. Start over opens a new chat and keeps what is remembered.

If you draw your own chat, show memorySettings.notice from agent.get() near the message box, and offer the same choices with memory: false and endUser.memory.stop().