Korely

Core memory operations

Add a memory

Store a memory. Korely extracts typed facts and resolves contradictions server-side; you just send the text and a scope.

POST /v1/memories

SDK: korely.add(content, ...). The write path runs the intelligence, embeddings, entity and typed-fact extraction, contradiction checking with bi-temporal validity, server-side. You never write supersede logic.

Authentication

HTTP header, required: Authorization: Bearer kor_live_....

Request body

FieldTypeRequiredDescription
contentstringRequiredThe memory text. 1-16,000 characters.
user_idstringOptionalThe end user this memory belongs to. Max 255 chars.
agent_idstringOptionalYour application's namespace. Max 255 chars.
run_idstringOptionalOne session or conversation. Max 255 chars.
metadataobjectOptionalArbitrary JSON stored alongside the memory and echoed back on reads.
timestampstringOptionalISO 8601 event time. Sets the bi-temporal valid_from on facts extracted from this memory, use it when backfilling historical memories so the timeline stays correct.

Example request

Terminal window
curl -X POST https://api.korely.ai/v1/memories \
-H "Authorization: Bearer kor_live_..." \
-H "Content-Type: application/json" \
-d '{
"content": "User prefers email follow-ups, not phone",
"user_id": "customer-giulia-4812",
"agent_id": "support-bot"
}'

Response

201 Created. The stored memory, plus the typed facts derived from it.

{
"id": "mem_8f2c1a",
"content": "User prefers email follow-ups, not phone",
"user_id": "customer-giulia-4812",
"agent_id": "support-bot",
"run_id": null,
"metadata": {},
"created_at": "2026-06-17T10:22:00Z",
"updated_at": "2026-06-17T10:22:00Z",
"facts": []
}
FieldTypeDescription
idstringThe memory id, e.g. mem_8f2c1a.
contentstringThe text you stored, echoed back.
user_id / agent_id / run_idstring · nullThe scope you sent, echoed back (null if omitted).
metadataobjectThe metadata you sent ({} if omitted).
created_at / updated_atstringISO 8601 timestamps.
factsarrayTyped (subject, predicate, object) facts extracted from this memory. See the note on async extraction below.

Facts extract asynchronously. In production the add returns sub-second with facts: []; the extraction pipeline (entity + typed-fact extraction, contradiction checking) lands the facts a few seconds later. Read them back with Get facts or Get context on the next turn, don't block on them in the same request.

Errors

StatusCodeCause
401invalid_keyMissing or invalid Authorization header.
422invalid_requestValidation failed, most often empty content or a field over its length limit.
429quota_exceededMonthly write quota reached. No Retry-After; resets at the next billing cycle, or upgrade.

Notes

  • Counts as one write. Each add counts against your monthly write quota, regardless of how many facts it produces.
  • Contradictions are automatic. If this memory conflicts with an earlier fact (same predicate, different object), the old fact is superseded, invalidated, not deleted, and stays queryable via as_of.
  • Messages, too. The SDKs accept a list of chat messages as content and join them into one block before sending.

Related