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 and uses no write of your quota. Saving a sentence that contradicts the fact also ends it, but that goes through the contradiction check, which asks a model and may close a different fact. A fact written with POST /v1/facts asks a model too.

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.
503unavailableThe key could not be checked because the database did not answer, or the request waited past one of the store's deadlines. Nothing changed; retry after the seconds in Retry-After. This call asks no model, so it never answers model_unavailable.
408request_timeoutThe body did not arrive whole within 30 seconds. Nothing changed; send it again.

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. It leaves Get facts, Get profile and the facts part of Get context at once.
  • Your word stays (since 1.0.14). A fact you forgot is not given back when the memory that had closed it is deleted, with or without at. A forget never moves an end later: with an at on or after the end the judge gave, the answer is already_forgotten, with that end in invalid_at.
  • The memory stays. Closing a fact does not touch the memory that stated it: search, the memory list and Get context can still return that sentence. To remove the sentence, delete or erase the memory (Delete a memory). The value can also come back as a new fact if its memory is edited or the same sentence is saved again.
  • A later value does not move your end (since 1.0.16). A value that begins after the end of a fact no longer moves that end later, whether you gave the end with at or the judge gave it earlier. A value that begins before the end still closes the fact there. A fact whose end was moved before 1.0.16 keeps the end it has now: forget it again with your at to give it back the end you said.
  • Webhook and audit. A closure sends a fact.invalidated webhook with fact_id, invalidated_by (null here) and at, at the moment of the call even when at is in the future. Nothing is sent for already_forgotten. The call writes one audit row, and audit_id is its receipt.