# Memory (/docs/api/gateway/memory)

List, search, store and delete your persistent memories — the same store the MCP memory tools use.

Persistent memory holds the facts, preferences and decisions Kodwen remembers about you across sessions and tools. These routes expose the same store as the MCP tools `memory_list`, `memory_search`, `memory_store` and `memory_forget`: a memory saved through one surface is visible on the other.

## Scope and availability [#scope-and-availability]

- Memories belong to your account. A key minted for a third-party app sees only that app's memories.
- Memory needs a plan with persistent memory; without it every route answers `403 memory_not_enabled`. When memory is not configured on the gateway the answer is `503 memory_unavailable`.
- Environment (daemon) keys cannot call these routes.
- A failure of the memory store answers `500 memory_error` for that request only; inference is never affected.
- **Delete everything**: `DELETE /v1/memory?confirm=all` erases every memory of your account (all tiers) on any plan; without `confirm=all` it answers `400 confirm_required`. Every surface has the same action behind a confirmation: hub Memory → Delete all memories, desktop Settings → Memory & tools → Account memory, phone Settings → Memory → Delete all account memory, `codaid memory clear` (asks unless `--yes`), and the MCP tool `memory_forget` with `all: true` (a dry run until `confirm: true`).

## Cost [#cost]

`GET /v1/memory` and `DELETE /v1/memory/{id}` do not call a model. Search and create embed the text once each and appear in your usage as `memory:search` and `memory:create`.

```ts
const { id } = await client.memory.create({ content: 'Invoices are issued in RON.' });
const { memories } = await client.memory.search({ q: 'currency for invoices' });
await client.memory.delete(id);
await client.memory.deleteAll(); // { deleted: { semantic, episodic, procedural, graph }, total }
```

<OpenAPIPage document="./openapi/en/gateway.yaml" operations={[{path: '/v1/memory',method: 'get'},{path: '/v1/memory/search',method: 'get'},{path: '/v1/memory',method: 'post'},{path: '/v1/memory/{id}',method: 'delete'},{path: '/v1/memory',method: 'delete'}]} />
