---
title: "Delete Memory"
method: DELETE
path: "/v1/memories/{memory_id}"
tags: ["v1"]
---

# Delete Memory

`DELETE /v1/memories/{memory_id}`

## Request

- Base URL: `https://api.korely.ai`
- URL: `https://api.korely.ai/v1/memories/{memory_id}`
- Auth: HTTP bearer

Forget one memory, or erase it with `erase=true`.

Forgetting drops the memory out of every read and ends the facts it
stated, which stay in history, closed. The row, with its text and vector,
stays in the database, and no call brings the memory back.

`erase=true` deletes it for good: the row, its text and vector, the
facts only it stated, its item in a `/v1/batch` payload, and the aliases
and vocabulary examples its facts alone taught. A memory forgotten
earlier is erased the same way (a forget answers 404 for it). Either way
an audit row keeps the counts, never the content, and a restore of a
backup taken before makes the erasure again. To erase everything of one
end user, use `DELETE /v1/users/{end_user}/memories`.

## Path parameters

- `memory_id` string, required

## Query parameters

- `erase` boolean: Erase it for good: the row, its text, observation and vector, and the facts it alone stated go from the database, with its item in a /v1/batch payload and what its facts taught the project's vocabulary and aliases. A memory forgotten earlier can be erased too. Without it the memory is forgotten: it drops out of every read, its facts stop being true, and the row stays.

## Response `200`

Successful Response

- object

## Other responses

- `401`: `invalid_key`: the `Authorization: Bearer` key is missing, unknown, revoked or expired.
- `403`: `forbidden`: the key lacks the scope this operation needs; `message` names it.
- `404`: `not_found`: nothing with that id is reachable with this key.
- `422`: `invalid_request`: the body, a query parameter or a path parameter is malformed (`detail` is the list of fields that failed, `message` names the first), or the endpoint refuses a value (an empty content, an unreadable timestamp; `detail` is a sentence or `{code, message}`).
- `429`: `rate_limit_exceeded`: past the request ceiling, the per-minute one set on this install (`RATE_LIMIT_PER_MINUTE`) or, on the hosted service, the plan's minute, hour or day; `message` names the window and `Retry-After` the seconds until it resets.
- `500`: `internal_error`: the server failed on this request; `message` holds no detail of it.
- `503`: A dependency did not answer: the database while the key was checked (`unavailable`, see `Retry-After`), or the one `code` names. Nothing was written; retry.

---

[API](https://skmtc.dev/korely/apis/korely-agents-api.md) · [All operations](https://skmtc.dev/korely/apis/korely-agents-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korely/apis/korely-agents-api/revisions/8a40bf09eca1?raw)
