Skip to content

Feedback

Tell memory how one search went - wrong, missing or fine - by the id the search answered with, and optionally what was true.

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

Authorizationstringrequired

Bearer tm_…. The key must read and write.

X-Alexein-Userstringrequired

The app user the search was for. A search id from another app user is a 404. See App users.

X-Request-Idstring

Your id for this request, echoed on the response.

Body

search_idstringrequired

The search_id a search answered with, such as srch_7Hq2mN4xKd9.

verdictstringrequired

How the search went: wrong when what came back was wrong, missing when the answer was not in what came back, ok when it served.

notestring

What was true instead, or what was missing, 1 to 4,000 characters. Absent, the note says only how the search went.

Response

search_idstring

The search id as sent.

verdictstring

The verdict as sent.

statusstring

The note's status, as add answers it: queued, or stored once it is searchable.

Errors

400bad request

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

401unauthorized

The bearer is not a key this service issued.

402payment required

Your organisation has used this month's events. Don't retry it: it lasts until the 1st (UTC), or an upgrade. See Plan limits.

403forbidden

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

404not found

memory gave no search by this id: not a search id, or one given for another app user.

422invalid

A verdict other than wrong, missing or ok, an empty search_id, or a note that is empty or over 4,000 characters.

429too many requests

Your organisation has many requests in flight while the service is busy. Retry after Retry-After seconds. See Limits.

503unavailable

The service is busy or briefly unavailable. Retry after Retry-After seconds, or with backoff when there is none.

Request
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."
  }'
200 OK
{
  "search_id": "srch_7Hq2mN4xKd9",
  "verdict": "wrong",
  "status": "queued"
}
404 Not Found
{ "detail": "memory gave no search by this id" }