Feedback
Tell memory how one search went - wrong, missing or fine - by the id the search answered with, and optionally what was true.
- Auth
- write key
- Cost
- 1 event, as an added item
Every search answers with a search_id. When the person says an answer from memory was wrong or
incomplete, or your agent found the answer somewhere else, send that id back with a verdict: memory answers
questions like it better afterwards. A note says what was true, in the person's words, and memory reads it
like any other note.
Feedback is kept as an item of this app user's memory: a note whose id begins feedback-, in the session
feedback, with the verdict in its metadata.feedback. It is listed by items, and
forgotten like any item. Feedback sent again for the same search replaces the first, as an
edit does. It never changes a fact: to retract one, use correct.
Headers
AuthorizationstringrequiredBearer tm_…. The key must read and write.
X-Alexein-UserstringrequiredThe app user the search was for. A search id from another app user is a 404. See
App users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
search_idstringrequiredThe search_id a search answered with, such as srch_7Hq2mN4xKd9.
verdictstringrequiredHow the search went: wrong when what came back was wrong, missing when the answer was not in what
came back, ok when it served.
notestringWhat was true instead, or what was missing, 1 to 4,000 characters. Absent, the note says only how the search went.
Response
search_idstringThe search id as sent.
verdictstringThe verdict as sent.
statusstringThe note's status, as add answers it: queued, or stored once it is searchable.
Errors
400bad requestX-Alexein-User is missing or not a usable id.
401unauthorizedThe bearer is not a key this service issued.
402payment requiredYour organisation has used this month's events. Don't retry it: it lasts until the 1st (UTC), or an upgrade. See Plan limits.
403forbiddenthis key reads; writing takes a key that writes, or the organisation has been closed in the console.
404not foundmemory gave no search by this id: not a search id, or one given for another app user.
422invalidA verdict other than wrong, missing or ok, an empty search_id, or a note that is empty or
over 4,000 characters.
429too many requestsYour organisation has many requests in flight while the service is busy. 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/feedback \
-H "Authorization: Bearer $ALEXEIN_API_KEY" \
-H "X-Alexein-User: user_42" \
-H "Content-Type: application/json" \
-d '{
"search_id": "srch_7Hq2mN4xKd9",
"verdict": "wrong",
"note": "Alice moved to Porto in October."
}'{
"search_id": "srch_7Hq2mN4xKd9",
"verdict": "wrong",
"status": "queued"
}{ "detail": "memory gave no search by this id" }