Write a fact
const url = 'https://example.com/v1/memory/facts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"example","scope":{"tenantId":"example","userId":"example","orgId":"example","projectId":"example","threadId":"example","sessionId":"example"},"content":"example","retention":{"keepUntil":"2026-04-15T12:00:00Z","keepDays":1,"legalHold":true},"contentHash":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/memory/facts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "example", "scope": { "tenantId": "example", "userId": "example", "orgId": "example", "projectId": "example", "threadId": "example", "sessionId": "example" }, "content": "example", "retention": { "keepUntil": "2026-04-15T12:00:00Z", "keepDays": 1, "legalHold": true }, "contentHash": "example" }'Persists a new fact. type selects the retrieval policy (which indexes populate). Semantic-indexed types require an embedding provider bound on the deployment; if unavailable, the route returns 400 bad-input.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Caller-supplied idempotency key. Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1).
Request Bodyrequired
Section titled “Request Bodyrequired”Write a fact. type selects the retrieval-policy (which indexes populate); scope.tenantId MUST match the caller’s tenant. Optional retention overrides tenant defaults; optional contentHash is a caller-supplied idempotence hint (runtime computes its own hash regardless).
object
Fact scope object. tenantId is required; every optional key narrows the fact (userId, orgId, projectId, threadId, sessionId). Additional keys accepted for forward compatibility.
object
Free-form structured payload.
object
Examplegenerated
{ "type": "example", "scope": { "tenantId": "example", "userId": "example", "orgId": "example", "projectId": "example", "threadId": "example", "sessionId": "example" }, "content": "example", "retention": { "keepUntil": "2026-04-15T12:00:00Z", "keepDays": 1, "legalHold": true }, "contentHash": "example"}Responses
Section titled “Responses”Fact written.
object
FactId.
Fact type identifier (pack-defined; a few are framework-standard).
Fact scope object. tenantId is required; every optional key narrows the fact (userId, orgId, projectId, threadId, sessionId). Additional keys accepted for forward compatibility.
object
Monotonic version within (scope, id). Supersession increments.
Free-form structured payload.
blob://<provider>/<bucket>/<key> when the payload is stored externally.
object
object
object
object
FactId of the predecessor when this row supersedes another.
Example
{ "source": { "kind": "http-api", "refresh": { "strategy": "on-read" } }}Malformed body, or the fact type requires semantic indexing and no embedding provider is bound.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}