> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usepatchwork.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory

> What an agent remembers about a subject between conversations, and how to erase it.

An agent can carry knowledge about a [subject](/guides/subjects) across threads. Memory is partitioned on `(workspace, subject)` and never crosses that boundary — which is why choosing the right subject grain matters so much.

## Two kinds

**Profile** memories are durable facts about the subject — stable preferences, standing context. They are loaded into the agent's context when a run starts.

**Episodic** memories are records of past exchanges, retrieved by relevance rather than loaded wholesale. When a run needs one, the agent uses `recall`, which searches that subject's episodes semantically.

## The tools

Two primitives appear only when the run has a subject:

| Primitive | Appears when |
| - | - |
| `remember` | The run has a subject. |
| `recall` | That subject already has episodic memory. |

Every run has a subject, so `remember` is always available; `recall` appears once that subject has something to recall. A request that names no subject never reaches a run — it is refused with `400 subject_required`.

## Live and sandbox

Memory carries an origin. Runs from the **Playground** write to `sandbox`; everything else writes to `live`, and the two never mix. You can experiment with an agent's behaviour without teaching your production agent anything.

That isolation only covers the Playground. API traffic is `live` even when you think of it as testing, so prefix test subjects — `test:user_9f2` — if you want them separately erasable.

## Erasing

Erasure runs from the dashboard under **Memory**. Deleting a subject removes every subject-scoped memory keyed on that exact string.

<Warning>
  Deletion matches the string byte for byte, and there is no `/v1` endpoint for it today. If you compose subjects — `user_9f2:ws_acme` — you must erase each composite separately, which means keeping your own record of every subject you minted for a person. We cannot reconstruct that from the strings.
</Warning>

## What this means for your privacy posture

Memory is derived from conversations, so anything a user tells the agent may persist beyond the thread it was said in. Two consequences worth designing for:

* Tell users what the assistant remembers, if your jurisdiction expects it.
* Wire your account-deletion flow to the erasure step, rather than treating it as a manual chore.

See [Subjects](/guides/subjects#erasing-a-subject) for why the mapping is yours to keep.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.