Feedback¶
Every intelligent-search request — streaming or JSON — is persisted, so that:
- The frontend can submit a thumbs-up/down vote (and optional comment) against a previous search using its
uuid. - Content editors can review questions, answers, and submitted feedback in the Sulu admin UI.
Failed requests are persisted too (with their upstream error). Failed prompts are often the most valuable signal for tuning ingestion and chunking.
Submission Endpoint¶
Route: POST /api/intelligent-search/feedback
Request body (JSON):
| Field | Required | Description |
|---|---|---|
uuid |
yes | UUID of the search, from the metadata SSE event or the JSON uuid field |
feedback |
yes | up or down |
comment |
no | Free-text comment |
Success response (200):
{
"success": true,
"message": "Feedback submitted successfully"
}
Errors:
400— invalid JSON body, missing/emptyuuid, missing/invalidfeedback, or non-stringcomment404— no persisted search matches the givenuuid
{
"success": false,
"error": {
"message": "Field \"feedback\" must be \"up\" or \"down\"",
"code": 400
}
}
Example¶
await fetch('/api/intelligent-search/feedback', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
uuid: searchUuid, // captured from the `metadata` SSE event
feedback: 'up', // or 'down'
comment: 'Exactly what I needed.',
}),
});
Admin UI¶
A navigation entry appears under the Sulu AI menu, listing every persisted search with its question, answer, sources, and submitted feedback. Records can be reviewed and deleted from the detail view.
Access is gated by the sulu.ai.intelligent_search_feedback security context with VIEW and DELETE permission types — grant these to the roles that should review search interactions.