Skip to content

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.

POST/v2/memory/refreshTry it in the Playground
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

Authorizationstringrequired

Bearer tm_…. The key must read and write.

X-Alexein-Userstringrequired

The app user whose memory to bring up to date. See App users.

X-Request-Idstring

Your id for this request, echoed on the response.

Body

{}objectrequired

An empty object.

Response

statusstring

queued (202 Accepted): the refresh was asked for. already_queued (200 OK): one was already waiting or under way.

Errors

400bad request

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

401unauthorized

The bearer is not a key this service issued.

403forbidden

this key reads; writing takes a key that writes, or the organisation has been closed in the console.

404not found

Nothing was ever written for this app user, so there is nothing to bring up to date.

429too many requests

This 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.

503unavailable

memory cannot be refreshed now. Retry after Retry-After seconds.

Request
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 '{}'
202 Accepted
{ "status": "queued" }
200 OK, one already asked for
{ "status": "already_queued" }
429 Too Many Requests
{ "detail": "refreshed within the hour: ask again in 2140 s" }