Let your users rate the answers Wren AI gives them — a thumbs up or down, what went wrong, and what the right answer would have been.
Project availability: ✅ Classic projects • ✅ Agentic projects
Answer feedback is currently available on self-hosted Wren AI. Coming soon to Wren AI Cloud.
Answer feedback records how good an answer was. Every call that produces an answer returns an answerId; when your user rates that answer, your backend sends the rating to the feedback API with the same answerId.
- Call an endpoint that produces an answer, such as
/v2/stream/askor/v2/stream/agent_ask, and keep theanswerIdit returns. - Show the answer to your user and collect their rating.
- Send the rating to
POST /v2/answers/{answerId}/feedback. Keep thefeedbackIdit returns if you want to change the rating later.
Endpoints Overview
| Endpoint | What it does |
|---|---|
POST /v2/answers/{answerId}/feedback | Rate an answer, or update a rating you sent earlier. |
Getting an answerId
answerIdThese are the feedback-capable endpoints. Each one's page says where it returns the answerId, in its Answer feedback section:
POST /v2/generate_sql,POST /v2/generate_summaryandPOST /v2/stream/generate_sqlPOST /v2/stream/askandPOST /v2/stream/interactive_askPOST /v2/generate_chartPOST /v2/stream/agent_ask, whoseGET …/statusandGET …/resultreturn the sameanswerIdPOST /v1/ask,POST /v1/generate_vega_chart,POST /v1/stream/askandPOST /v1/stream/interactive_ask
The /v1 aliases of generate_sql, generate_summary and stream/generate_sql behave the same as their /v2 paths.
A few rules apply to all of them:
- Failed calls return an
answerIdtoo, whenever Wren AI recorded the call. Feedback on a failed answer is accepted only if the call got far enough to leave a trace; otherwise it returns422ANSWER_HAS_NO_TRACE. - Calls rejected before they are recorded return none — for example an invalid API key, an expired license, too many concurrent requests, or a request without a
projectId. - One exception: when
/v1/stream/interactive_askbreaks off after its stream has opened, for example because it lost its connection to the AI service mid-answer, the stream closes without a further frame, so that call returns noanswerId. - Other endpoints do not produce answers.
run_sql,stream_explanation, therespondside-channels and the agentic-modeuser_inputandcancellationcalls return noanswerId. If you send the feedback API anidthat one of these endpoints returned, it responds404ANSWER_NOT_FOUND.
Errors
See Error handling on the endpoint page for every status and code the feedback API returns.
