Korely

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.

DELETE /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.

ParameterTypeRequiredDescription
memory_idstringRequiredThe public memory id to forget (mem_ and 32 hex characters, or the bare UUID).

Example request

Terminal window
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"
}
FieldTypeDescription
idstringPublic memory id (mem_) that was forgotten.
statusstringAlways forgotten.
facts_invalidatedintegerFacts 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_idstringPublic id of the audit row recording the forget (scope memory).

Errors

StatusCodeCause
401invalid_keyMissing or invalid kor_live_ key in the Authorization header.
403forbiddenThe key lacks the memories:write scope required to forget a memory.
404not_foundThe memory_id is malformed, or no such memory exists, or it was already deleted.
429rate_limit_exceededRate limit exceeded. Retry after the interval in the Retry-After header.

Notes

  • Soft delete, not erase. The memory's deleted_at is set and the facts only it stated are closed (their invalid_at is set). Because Korely is bi-temporal, the rows are kept: the memory drops out of every read, and the closed facts stay reachable via as_of.
  • Write scope required. The key must carry memories:write; a read-only key gets a 403.
  • 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_at is already set, so the memory is filtered out of the lookup.

Related