Answer feedback

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.

  1. Call an endpoint that produces an answer, such as /v2/stream/ask or /v2/stream/agent_ask, and keep the answerId it returns.
  2. Show the answer to your user and collect their rating.
  3. Send the rating to POST /v2/answers/{answerId}/feedback. Keep the feedbackId it returns if you want to change the rating later.

Endpoints Overview

EndpointWhat it does
POST /v2/answers/{answerId}/feedbackRate an answer, or update a rating you sent earlier.

Getting an answerId

These are the feedback-capable endpoints. Each one's page says where it returns the answerId, in its Answer feedback section:

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 answerId too, 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 returns 422 ANSWER_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_ask breaks 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 no answerId.
  • Other endpoints do not produce answers. run_sql, stream_explanation, the respond side-channels and the agentic-mode user_input and cancellation calls return no answerId. If you send the feedback API an id that one of these endpoints returned, it responds 404 ANSWER_NOT_FOUND.

Errors

See Error handling on the endpoint page for every status and code the feedback API returns.