Retrieve facts by intent
const url = 'https://example.com/v1/memory/retrieve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mode":"list","query":"example","type":"example","scope":{"tenantId":"example","userId":"example","orgId":"example","projectId":"example","threadId":"example","sessionId":"example","participantId":"example"},"limit":1,"embeddingModel":"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/retrieve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mode": "list", "query": "example", "type": "example", "scope": { "tenantId": "example", "userId": "example", "orgId": "example", "projectId": "example", "threadId": "example", "sessionId": "example", "participantId": "example" }, "limit": 1, "embeddingModel": "example" }'Retrieval over the facts the caller may see (as for listing), current revisions only. mode: list (newest first, no query), keyword (full-text), semantic (by meaning), or both (the two searches fused by rank: reciprocal rank fusion). Searching by meaning needs embeddings on the deployment (KINDGI_MEMORY_EMBEDDINGS); without them semantic and both answer 422 semantic-unavailable.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Retrieval intent — mirrors RetrievalIntent from @kindgi/agents, widened for direct-HTTP use. mode: "list" returns a plain scoped list (no query), newest first. mode: "keyword" runs full-text search. mode: "semantic" searches by meaning — it needs embeddings on the deployment; without them the route answers 422 semantic-unavailable. mode: "both" runs both and fuses them by rank (reciprocal rank fusion), as semantic needing embeddings.
object
Responses
Section titled “Responses”Retrieval results.
object
Example
{ "results": [ { "fact": { "source": { "kind": "http-api", "refresh": { "strategy": "on-read" } }, "trust": "verified", "attributedTo": { "kind": "user" }, "subjects": [ { "kind": "participant" } ], "invalidationReason": "superseded", "review": "pending" } } ]}Malformed intent.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}semantic-unavailable: semantic or both asked to search by meaning, and the deployment has no embeddings (KINDGI_MEMORY_EMBEDDINGS).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}memory-operation-unsupported: this runtime’s memory can’t retrieve by intent.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}