Refresh
Ask memory to bring what it has gathered of one app user up to date soon, rather than at its own pace - after a large import, say.
- Auth
- write key
- Cost
- free; never counted; once an hour per app user
Memory keeps what it has gathered of each app user up to date at its own pace: the person, fields,
answers, check and topics of summary, and what the person usually does. Refresh asks for
that to happen soon, for one app user. Call it after something that changes a lot at once, such as an import of
their history, or once your project has asked memory for new fields or questions.
Refresh only asks: it answers at once, and the work follows. A refresh already waiting or under way answers
already_queued, and is not asked for twice. Each app user can be refreshed once an hour; sooner is a 429
whose Retry-After says when to ask again. Items you add are searchable without it.
It takes no arguments; send {}.
Headers
AuthorizationstringrequiredBearer tm_…. The key must read and write.
X-Alexein-UserstringrequiredThe app user whose memory to bring up to date. See App users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
{}objectrequiredAn empty object.
Response
statusstringqueued (202 Accepted): the refresh was asked for. already_queued (200 OK): one was already waiting
or under way.
Errors
400bad requestX-Alexein-User is missing or not a usable id.
401unauthorizedThe bearer is not a key this service issued.
403forbiddenthis key reads; writing takes a key that writes, or the organisation has been closed in the console.
404not foundNothing was ever written for this app user, so there is nothing to bring up to date.
429too many requestsThis app user was refreshed within the hour: Retry-After says how many seconds until the next refresh can
be asked for. Also sent when your organisation has many requests in flight while the service is busy. See
Limits.
503unavailablememory cannot be refreshed now. Retry after Retry-After seconds.
curl https://api.alexein.ai/v2/memory/refresh \
-H "Authorization: Bearer $ALEXEIN_API_KEY" \
-H "X-Alexein-User: user_42" \
-H "Content-Type: application/json" \
-d '{}'{ "status": "queued" }{ "status": "already_queued" }{ "detail": "refreshed within the hour: ask again in 2140 s" }