Skip to content

Facts

Every fact memory has learned for one app user, newest first, a page at a time, each with its date and the excerpt it came from.

POST/v2/memory/factsReads memoryTry it in the Playground
Auth
read key
Cost
free; never refused for your plan

Lists the facts memory has learned from what you added and from connected apps, newest first. Use it for a "what we know about you" screen, or to review facts before you correct one. A fact that was corrected, or whose items were forgotten or have expired, is not listed.

Headers

Authorizationstringrequired

Bearer tm_…. A read key is enough.

X-Alexein-Userstringrequired

The app user whose memory to read. See App users.

X-Request-Idstring

Your id for this request, echoed on the response.

Body

limitinteger

How many facts on one page, 1 to 100. Default 20.

cursorstring

The next the previous page answered with, for the page after it. Leave it out for the first page.

Response

factsobject[]

Newest first, each {type: "fact", ref, text, source, date}: ref is what open and correct take, source the ref of the excerpt it was learned from (or null), and date when it was said.

nextstring | null

The cursor of the next page. null on the last page.

For an app user with no memory yet it answers 200 with facts: [].

Errors

400bad request

X-Alexein-User is missing or not a usable id.

401unauthorized

The bearer is not a key this service issued.

403forbidden

The organisation has been closed in the console.

422invalid

A limit outside 1 to 100, or a cursor that is not one a page answered with.

429too many requests

Too many requests in flight, or reads too fast. Retry after Retry-After seconds. See Limits.

503unavailable

The service is busy or briefly unavailable. Retry after Retry-After seconds, or with backoff when there is none.

Request
curl https://api.alexein.ai/v2/memory/facts \
  -H "Authorization: Bearer $ALEXEIN_API_KEY" \
  -H "X-Alexein-User: user_42" \
  -H "Content-Type: application/json" \
  -d '{ "limit": 2 }'
200 OK
{
  "facts": [
    {
      "type": "fact",
      "ref": "mem_3vB7yT0nKe6",
      "text": "(2026-10-02) Alice is vegan and allergic to peanuts",
      "source": "mem_7cJ4mE9tRw5",
      "date": "2026-10-02T12:00:00+00:00"
    },
    {
      "type": "fact",
      "ref": "mem_5pQ1zX8gHd2",
      "text": "(said 2026-10-01) Alice lives in Lisbon",
      "source": "mem_9fK2xQ7aLp3",
      "date": "2026-10-01T09:30:00+00:00"
    }
  ],
  "next": "Kx7pW2qLm9vR"
}