Open
Open one excerpt whole, or one fact with the excerpts it was learned from, by the ref a result gave you.
- Auth
- read key
- Cost
- free; never refused for your plan
Every fact and excerpt in a result carries a ref. Open returns what it names. No ranking.
- An excerpt ref returns that excerpt whole, where search and latest cut it at 1,400 characters and grep at 320.
- A fact ref returns the fact and the excerpts it was learned from: where it came from, in the words that were said.
To get an item as you added it, use item.
Headers
AuthorizationstringrequiredBearer tm_…. A read key is enough.
X-Alexein-UserstringrequiredThe app user whose memory to read. See App users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
refstringrequiredA fact's or an excerpt's ref, such as mem_5pQ1zX8gHd2. Valid for this app user only.
Response
memoryobjectWhat the ref names: an excerpt, {type: "excerpt", ref, text, date, added_at, session, roles}, with its whole text; or a fact, {type: "fact", ref, text, source}.
sourcesobject[]For a fact: the excerpts it was learned from, each whole. Absent for an excerpt.
Errors
400bad requestX-Alexein-User is missing or not a usable id.
401unauthorizedThe bearer is not a key this service issued.
403forbiddenThe organisation has been closed in the console.
404not foundno memory for app user 'user_42' yet, or a ref memory does not hold for this app user.
422invalidAn empty ref: `ref` must not be empty.
429too many requestsToo many requests in flight, or reads too fast. Retry after Retry-After seconds. See
Limits.
503unavailableThe service is busy or briefly unavailable. Retry after Retry-After seconds, or with backoff when
there is none.
curl https://api.alexein.ai/v2/memory/open \
-H "Authorization: Bearer $ALEXEIN_API_KEY" \
-H "X-Alexein-User: user_42" \
-H "Content-Type: application/json" \
-d '{ "ref": "mem_5pQ1zX8gHd2" }'{
"memory": {
"type": "fact",
"ref": "mem_5pQ1zX8gHd2",
"text": "(said 2026-10-01) Alice lives in Lisbon",
"source": "mem_9fK2xQ7aLp3"
},
"sources": [
{
"type": "excerpt",
"ref": "mem_9fK2xQ7aLp3",
"text": "I just moved to Lisbon from Berlin for the new job at Acme.",
"date": "2026-10-01T09:30:00+00:00",
"added_at": "2026-10-01T09:30:02+00:00",
"session": "onboarding",
"roles": ["user"]
}
]
}{
"memory": {
"type": "excerpt",
"ref": "mem_7cJ4mE9tRw5",
"text": "Alice is vegan and allergic to peanuts.",
"date": "2026-10-02T12:00:00+00:00",
"added_at": "2026-10-02T12:00:03+00:00",
"session": null,
"roles": []
}
}