Memory

July 29, 2026 · View on GitHub

Memory is short, durable text the agent should remember across chats for one tenant. It lives in two files on that tenant’s volume:

FileHoldsDefault size limit
memories/USER.mdWho the user is: role, preferences, style, expectations1,375 characters
memories/MEMORY.mdEnvironment facts, conventions, tool quirks, lessons2,200 characters

Limits are character counts, not tokens. If a store is full, the write is rejected. Consolidate first, then add in one batch.

Parallel chats for one tenant share the same volume. Memory add / replace / remove / applyBatch run one at a time per volume so concurrent writers do not overwrite each other. The frozen system-prompt snapshot for each open chat still does not change mid-session.

Frozen snapshot (why mid-chat writes feel “delayed”)

When a session starts, the kit copies memory into the system prompt once. That copy is the frozen snapshot for this chat.

EventWhat happens
Session startsSnapshot is built from disk and put in the system prompt
Model calls memory and writesFile on disk updates now
Same open session continuesSystem prompt still uses the old snapshot
New session startsNew snapshot includes what is on disk (after approval rules)
memory with action=listReads live disk. Does not change the prompt

Why freeze it: many model providers cache the start of the system prompt. If you rebuild the snapshot on every HTTP request, that cache breaks and cost goes up.

Where you runWhat counts as one session
Long-lived process or CLIOne process or one conversation
Example chat appOne useChat id. “New chat” starts a new session

What to save vs skip

SaveSkip
Stable prefs (“prefer short answers”, “TypeScript”)One-off task stories
Corrections the user repeatsTemporary TODOs
Durable environment factsRaw dumps. Step-by-step procedures belong in skills

Every write is threat-scanned before it can enter a future prompt. See Security.

Next