Korely

Core memory operations

Memory history

The timeline of one memory: created, updated, deleted, plus every fact it taught the store, including facts that were closed later.

GET /v1/memories/{memory_id}/history

SDK: korely.history(memory_id). Unlike Get a memory, which returns only the open facts, history returns the complete trail of one memory: the created event, a single updated event dated with the last edit (there is no log of each edit), deleted once the memory is forgotten, and each fact this memory stated, fact_extracted and, once closed, fact_invalidated. Use it to see why the store believes what it believes.

Authentication

HTTP header, required: Authorization: Bearer kor_live_.... The key needs the memories:read permission.

Path parameter

This endpoint takes no query parameters and no request body, only the memory id in the path.

ParameterTypeRequiredDescription
memory_idstringRequiredThe memory id (mem_ prefix), as returned by Add a memory or any read. A forgotten memory still has a history, with its deleted event.

Example request

Terminal window
curl https://api.korely.ai/v1/memories/mem_8f2c1a/history \
-H "Authorization: Bearer kor_live_..."

Response

200 OK. The memory id and its events, sorted chronologically.

{
"id": "mem_8f2c1a",
"events": [
{"event": "created", "at": "2026-03-01T09:14:22.418093+00:00", "fact": null, "fact_id": null},
{"event": "fact_extracted", "at": "2026-03-01T09:14:25.902114+00:00", "fact": "Giulia likes async standups", "fact_id": "fct_a1"},
{"event": "updated", "at": "2026-03-02T11:02:10.183112+00:00", "fact": null, "fact_id": null},
{"event": "fact_extracted", "at": "2026-03-02T11:02:13.540871+00:00", "fact": "Giulia likes in-person standups", "fact_id": "fct_b2"},
{"event": "fact_invalidated", "at": "2026-03-02T11:02:13.540871+00:00", "fact": "Giulia likes async standups", "fact_id": "fct_a1"}
]
}
FieldTypeDescription
idstringThe memory id (mem_ prefix), echoed back.
eventsarray<HistoryEvent>Chronologically sorted events (equal times keep the order created, updated, facts). Each HistoryEvent has the four fields below.
events[].eventstringOne of created, updated, fact_extracted, fact_invalidated, deleted.
events[].atstring · nullISO 8601 timestamp of the event, by the store's clock: for fact_extracted, when the store learned the fact from this memory (never before the memory was written); for fact_invalidated, when the store learned the fact had ended (its closed_known_at), never before the fact was learned. null when no timestamp is available; such events sort last.
events[].factstring · nullThe fact as a subject predicate object string, with the predicate as Korely stores it (for example Brightside Bikes opens_at 9 am), on fact_extracted and fact_invalidated events; null on the others.
events[].fact_idstring · nullThe fact id (fct_ prefix) on fact_extracted and fact_invalidated events; null on the others.

History shows closed facts; Get a memory does not. Get a memory returns only the facts currently active. History includes every fact this memory ever stated, with its fact_invalidated event whenever the fact was closed: superseded by a newer fact, dropped by an edit of this memory, closed when this memory was forgotten, or closed through the facts API. When a fact was true is its valid_from and invalid_at on Get facts.

Errors

StatusCodeCause
401invalid_keyMissing or invalid kor_live_ key in the Authorization header.
403forbiddenThe key lacks the memories:read scope.
404not_foundMalformed memory_id, or no memory with that id in this key's project (for a key confined to some end users, also a memory of another end user). A memory erased with erase=true is gone: 404.
429quota_exceededMonthly query quota reached. Resets on the 1st of the month (UTC), or upgrade.
429rate_limit_exceededPast the rate limit (per minute, hour or day). Wait as long as Retry-After says.
500internal_errorThe server failed on this request; the message holds no detail.
503unavailableThe database did not answer while the key was checked. Retry after the seconds in Retry-After.

Notes

  • This is a read. Each call counts against your monthly query quota, a 404 for a well-formed id included.
  • The updated event is conditional. It appears only when the memory's updated_at differs from its created_at, a memory written once and never edited has no updated event.
  • Fact timestamps come from the store's clock, not from validity. For when a fact was true, read valid_from and invalid_at on Get facts.
  • Undated events sort last. Events with no timestamp are ordered as if dated 9999-12-31, so they fall at the end of the timeline.

Related

  • Get a memory, the current state, with active facts only.
  • Get facts, query typed facts directly, with as_of time travel.
  • SDK reference, korely.history(memory_id) in Python and Node.