How they work
How the person works - the routines they follow before an action and how they write on each surface - as plain lines with the counts and facts behind them.
- Auth
- read key
- Cost
- free; never refused for your plan
Search finds what was said. How they work is what the person does: the steps they take before an action, such as running the checks before merging a pull request, and how they write in each place, such as short lowercase one-liners in chat. Call it before your agent acts or writes for the person: before it opens a pull request, sends a message in their name or drafts a reply, so it does things their way.
The answer is cards, each a plain line for your model with what it rests on, then the counts in full. Each card
carries the refs of the facts it cites, for open. Cards are made over time from what memory holds;
a new memory has none yet, and procedures and voice may still answer.
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
whostringSomeone in this memory, by name, up to 512 characters. Absent, the person. Cards are made for the person
alone: for anyone else, cards is empty and the counts answer.
surfacestringWhere the writing is for, such as a channel or a repository, up to 512 characters. Absent, where they write most.
Response
whostringWhose ways these are.
cardsobject[]Plain lines on how the person works, each with a kind, text and refs (the facts it cites):
routine: what they do before an action, in order.proceduresholds that routine's counts:anchor(the action),occurrences,firstandlast(days), andsteps, each{verb, did, total, share}.contexts, when present, says where a step depends on the context:required(the step),anchor,dimensionandvalue(the context),didandtotalin it, andbase_didandbase_totalin any context.style: how they write on onesurface.voiceholds the counts it rests on:messages,median_words, and the shares of their messages that areone_line, start in lower case (lowercase_start), usecontractions,emoji,questionsandgreetings, each 0 to 1.
Every number is counted, never written by a model. Each text is a line for your model; don't parse it.
proceduresstring[]Each routine's counts written out in full, as text for a model.
voicestring | nullHow they write on surface, or where they write most, as text for a model. null when memory has too
few of their messages to say.
For an app user with no memory yet it answers 200 with cards and procedures empty and voice null.
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.
422invalidA field is out of bounds. detail names the field.
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/how_they_work \
-H "Authorization: Bearer $ALEXEIN_API_KEY" \
-H "X-Alexein-User: user_42" \
-H "Content-Type: application/json" \
-d '{}'{
"who": "Alice Chen",
"cards": [
{
"kind": "routine",
"text": "Before merging a pull request: runs the checks, then asks for a review",
"procedures": [
{
"anchor": "merged",
"occurrences": 41,
"first": "2026-03-02",
"last": "2026-10-20",
"steps": [
{ "verb": "ran", "did": 38, "total": 41, "share": 0.927 },
{ "verb": "requested_review", "did": 33, "total": 41, "share": 0.805 }
]
}
],
"refs": ["mem_8nC3vL6qPz1"]
},
{
"kind": "style",
"text": "Short lowercase one-liners, rarely a greeting",
"surface": "slack",
"voice": {
"surface": "slack",
"messages": 412,
"median_words": 7,
"one_line": 0.91,
"lowercase_start": 0.84,
"contractions": 0.37,
"emoji": 0.05,
"questions": 0.22,
"greetings": 0.03
},
"refs": []
}
],
"procedures": ["…"],
"voice": "…"
}