Skip to main content

Memory

Memory recalls knowledge from your earlier coding sessions. Learn the recall and capture switches, console setup, project controls, deletion and export.

Last updated

Memory keeps knowledge from your earlier coding sessions. The gateway adds the relevant parts to new requests. This page explains the switches, the console setup, and how to delete or export your memory.

How recall works#

Recall adds a block of stored knowledge to the latest user turn of a request. The model reads that block with your prompt.

Automatic recall runs for Claude requests that arrive at POST /v1/messages. The gateway builds the block only when it expects the Claude pool to serve the request first. This check is a prediction. A request can still end on another pool.

The request must carry a session id. The gateway reads it from the x-claude-code-session-id header, or from the session id in the request metadata. A request without a session id gets no recall block. A request that has no project gets a recall block only when Collect is on for the (none) row of the Projects tab.

The gateway reaches the memory service through the environment variable MEMORY_SERVICE_URL. Without that address, the gateway builds no recall block.

When recall fails#

If the memory service times out, sheds the call or returns an error, the gateway sends the request without a recall block. The request continues.

The two switches#

Memory has two switches for each project:

  • The recall switch controls whether the gateway adds stored knowledge to requests. The console calls it Inject.
  • The capture switch controls whether memtrunk stores session content for the project. The console calls it Collect.

You set both switches for your own projects. The Projects tab of the Memory page holds them. See "Set the switches for one project" below.

Who can use recall#

With sign-in on, recall runs for a user when all of these conditions are true:

  1. The user account is enabled.
  2. The organization is active and allows memory.
  3. An admin has not switched memory access off for the user.
  4. The user has not switched the own memory switch off.
  5. An admin granted memory to the user, or the organization default is "memory on".

A new user starts without the grant. The server setting signupDefaultMemoryEnabled controls the grant for new accounts, and its shipped value is false. An admin can change that setting.

A member cannot grant memory to themselves. The own memory switch is separate from the grant. Admins and org admins change the grant for a user. An org admin selects users on the Org users page and uses the "Bulk memory defaults" bar. The bar has a "Memory feature" list and a "Set to" choice.

Set up memory in the console#

Memory needs model access before it can run.

  1. Open the Memory page. While access is off, the page shows "Connect a model to turn on memory".
  2. Choose one card. "Use a subscription account" uses a pooled subscription account. "Use a provider key" uses a metered provider key that you already added.
  3. Select the account or the key from the list in the card.
  4. Select "Enable with subscription" or "Enable with provider key".

The page then shows the message "Memory enabled with" followed by the email of the account or the name of the key. Setup also turns on your own memory switch.

The subscription option makes an internal caller key and pins it to the account you chose. The server must be able to store that key. If it cannot, the page shows an alert with this text: The server cannot store an internal key: set PROXY_KEY_ENCRYPTION_KEY.

Turn memory off#

The Overview tab shows the current model access with the buttons "Change" and "Turn off memory". The confirmation says that collection and injection stop for every project and that stored memories are kept.

Set the switches for one project#

Open the Memory page and select the Projects tab. Each row is a project. These columns and buttons control the two switches, sessions and deletion:

ControlEffect
CollectA toggle for the capture switch.
InjectA choice of On, Off or Inherit for the recall switch. See below.
SessionsOpens the list of sessions for the project.
Delete allDeletes the stored memories of the project.
Delete & stop collectingDeletes the stored memories and turns Collect off.

The Actions column holds the Sessions, Link, Unlink and delete buttons. It does not show for an auditor or when sign-in is off.

Inherit follows the nearest explicit choice on the project path. For a project with a path, it follows the account default when no project on the path has a choice. The label reads "Inherit (on)" or "Inherit (off)". It shows the account default from the "Defaults for new projects" card, which says that projects set to Inherit follow it. It does not show a choice made on a parent project.

The Inject choice stays disabled until the Digest, Facts, Adjudicator and Synthesis tasks each have a candidate. The hint reads "Add summarizer candidates first". Add the candidates on the "Models & tasks" tab. A fallback model that the instance offers to you covers all four tasks. The row (none) covers memory that has no project. It has the Collect toggle only.

Delete memory#

Select "Delete all" on a project row. The dialog says that it permanently deletes all stored memories for the project and that this cannot be undone. Select "Delete & stop collecting" to delete the same memories and keep Collect off.

To delete single sessions, select "Sessions" on the project row. The dialog "Sessions for" the project lists each session with its row count and its first and last time.

  • The list shows at most the first 200 sessions. A note tells you when more sessions exist.
  • Select "Remove" on a session and confirm. The removal affects only that project and keeps the project controls as they are.
  • If the session shares lineage with other memory, the removal stops. The alert says Session removal was blocked by a lineage conflict. No rows were deleted.

Export your memory#

Open the Profile page and select the Connection tab. The "Memory export" card has an "Export my memories" button. The card shows when you sign in with your own account and sign-in is on.

The button saves a JSON file named memtrunk-memories-<date>.json. The file holds your own stored memory content. It includes memories that are no longer the latest version. The card says that the file excludes shared memories of other users, raw conversations, embeddings, graph data and settings. The file is not a restore format.

The export has limits:

  • An export of more than 5,000 memories or more than 10 MiB fails. No partial file is saved.
  • You can export once a minute and ten times an hour for each server process. Otherwise the card shows "Please wait before exporting again".
  • A slow export ends with "Your memory export timed out".

Next steps#