Korely

Context & facts

Close a fact

A fact stops being current and stays in history. Nothing is deleted: as_of a date before the closure still returns it, which is the reason the row is kept rather than removed.

POST /v1/facts/{fact_id}/forget

SDK: korely.forget_fact(fact_id, at=...). Use it when your agent already knows a fact is finished. This call asks no model. Writing a contradicting sentence and waiting for the contradiction check to notice also works, but that check asks a model. A fact written directly with POST /v1/facts also asks a model for the vocabulary and the contradiction check whenever a model key is configured. Only an install with no model key writes facts with no model.

Authentication

HTTP header, required: Authorization: Bearer kor_live_.... The key must carry the memories:write scope. Closing a fact does not count against the monthly write quota.

Request body

Optional. A bare POST closes the fact as of now.

FieldTypeRequiredDescription
atstringOptionalISO 8601 date or datetime the fact stopped being true. Not the date you noticed: set it to when the world changed, and as_of before that still returns the fact. Defaults to now. It may be in the future: the fact stays current until then. It may not be before the fact's valid_from.

Any other field is refused with 422 invalid_request.

Example request

Terminal window
curl -X POST https://api.korely.ai/v1/facts/fct_3b9e1d7a5c2f4e8a9d6b0c1f7a2e4d85/forget \
-H "Authorization: Bearer kor_live_..." \
-H "Content-Type: application/json" \
-d '{"at": "2026-06-20"}'

Response

200 OK.

{
"id": "fct_3b9e1d7a5c2f4e8a9d6b0c1f7a2e4d85",
"status": "forgotten",
"invalid_at": "2026-06-20T00:00:00+00:00",
"audit_id": "aud_7c2f0e19a4b84d6c9a1e3f5b2d8c6a40"
}
FieldTypeDescription
idstringThe fact id (fct_ and 32 hex characters).
statusstringforgotten, or already_forgotten when the fact was closed already.
invalid_atstring · nullISO 8601, when the fact stops being true.
audit_idstring · nullId of the audit row recording the closure (aud_ prefix).

Errors

StatusCodeCause
401invalid_keyMissing or invalid kor_live_ key.
403forbiddenThe key lacks the memories:write scope.
404not_foundThe id is malformed, unknown, the fact is in another project or, for a key confined to some end users, belongs to another end user: No fact with that id.
413payload_too_largeThe body is larger than 2,097,152 bytes. Refused before it is read; nothing changes. On the Cloud a body over 1 MB gets a bare 413 first, without this code.
422invalid_requestat is not an ISO date or datetime (at must be an ISO date (2026-06-01) or datetime), at is outside the moments that can be stored (at is outside the moments that can be stored: from 0001-01-02 to 9999-12-30, in UTC), at is before the fact's valid_from, or the body has an unknown field.
429rate_limit_exceededPer-minute, per-hour or per-day request limit. Carries Retry-After.

Notes

  • Idempotent. Closing a fact that has already ended, or whose end is already at or before the at you send, changes nothing and answers "status": "already_forgotten". A fact whose end is still ahead is closed earlier, at the at you send (or now). Without at, a fact dated in the future is closed at its own valid_from, which retracts it.
  • Scoped to your key's project. A fact in another project answers 404, the same answer as an id that never existed, so the two cannot be told apart.
  • Not a delete. The row keeps its dates and stays readable with include_invalidated=true, and point-in-time reads before the closure are unaffected.