Core memory operations
Delete a memory
Soft-forget one memory and close the facts only it stated. Nothing is hard-deleted: the memory drops out of every read, and its facts stay as bi-temporal history. An audit row is written.
/v1/memories/{memory_id}
SDK: korely.delete(memory_id). Forgetting a memory sets its
deleted_at and closes (sets invalid_at on) the
active facts that only this memory stated. A fact another memory also
states stays active: it only loses this memory from
source_memory_ids. The rows are never physically removed. The
memory's text no longer comes back from any endpoint (its history keeps the
deleted event), and the facts it closed stay readable with
as_of or include_invalidated=true on
Get facts. For a GDPR
erasure use Forget a user,
which deletes the rows.
Authentication
HTTP header, required: Authorization: Bearer kor_live_.... The key must carry the memories:write scope.
Path parameter
This endpoint takes no query parameters and no request body, only the memory id in the path.
| Parameter | Type | Required | Description |
|---|---|---|---|
memory_id | string | Required | The public memory id to forget (mem_ and 32 hex characters, or the bare UUID). |
Example request
curl -X DELETE https://api.korely.ai/v1/memories/mem_8f2c1a \ -H "Authorization: Bearer kor_live_..."Response
200 OK. A small receipt confirming the forget, with how many
facts were closed and the id of the audit row.
{ "id": "mem_8f2c1a", "status": "forgotten", "facts_invalidated": 2, "audit_id": "aud_5d3e9f"}| Field | Type | Description |
|---|---|---|
id | string | Public memory id (mem_) that was forgotten. |
status | string | Always forgotten. |
facts_invalidated | integer | Facts closed (invalid_at set) because this memory was their only source. 0 when the memory stated none, or when every fact it stated is also stated by another memory. |
audit_id | string | Public id of the audit row recording the forget (scope memory). |
Errors
| Status | Code | Cause |
|---|---|---|
401 | invalid_key | Missing or invalid kor_live_ key in the Authorization header. |
403 | forbidden | The key lacks the memories:write scope required to forget a memory. |
404 | not_found | The memory_id is malformed, or no such memory exists, or it was already deleted. |
429 | rate_limit_exceeded | Rate limit exceeded. Retry after the interval in the Retry-After header. |
Notes
- Soft delete, not erase. The memory's
deleted_atis set and the facts only it stated are closed (theirinvalid_atis set). Because Korely is bi-temporal, the rows are kept: the memory drops out of every read, and the closed facts stay reachable viaas_of. - Write scope required. The key must carry
memories:write; a read-only key gets a403. - The request is always logged. The call is recorded in the audit log before the not-found check runs, so even a forget against an unknown id leaves an event, with result
error. - Idempotent-ish. A second delete of the same memory returns
404,deleted_atis already set, so the memory is filtered out of the lookup.
Related
- Delete a memory, guide, the narrative walkthrough with context.
- Get facts, confirm which facts dropped out after a forget.
- Add a memory, the write path that created it.