Skip to main content
Version: Stable (v5.x)

Collect response feedback

DocSearch v5 includes feedback controls for completed Agent Studio answers. You don't need to add an askAi option to enable them.

Use an API key with the search ACL. Agent Studio accepts one vote per message. See Agent Studio feedback for service requirements and reporting details.

Understand the ratings

Thumbs up submits positive feedback immediately:

{
thumbs: 1;
}

Thumbs down opens a form before submission. A user can select zero or more reason tags and add an optional note:

{
thumbs: 0;
tags?: AskAiFeedbackReason[];
notes?: string;
}

Closing or canceling the form doesn't submit feedback. Submitting without a reason or note is valid. DocSearch trims notes, omits an empty note, and limits notes to 1,000 characters.

DocSearch supports these reason values:

ValueDefault label
incorrectIncorrect or incomplete
not_what_i_askedNot what I asked for
slow_or_buggySlow or buggy
style_or_toneStyle or tone
safety_or_legalSafety or legal concern
otherOther

Reason tags and notes are collected only for negative feedback.

Understand submission behavior

DocSearch sends the Agent Studio agent ID, message ID, vote, and optional negative-feedback details to Agent Studio. After a successful request, it shows a thank-you state and records the rating with the locally stored conversation.

If submission fails, DocSearch keeps the negative-feedback form open and displays the error so the user can retry.

Change feedback labels

Override feedback text through translations.modal.askAiScreen:

Search.tsx
<DocSearchAI
appId="YOUR_APPLICATION_ID"
apiKey="YOUR_SEARCH_API_KEY"
indices={['docs']}
askAi={{ agentId: 'YOUR_AGENT_ID' }}
translations={{
modal: {
askAiScreen: {
likeButtonTitle: 'Helpful',
dislikeButtonTitle: 'Not helpful',
thanksForFeedbackText: 'Feedback received',
feedbackPanelTitle: 'Tell us what went wrong',
feedbackDetailsPlaceholder: 'Add details',
feedbackSubmitButtonText: 'Send feedback',
feedbackTagIncorrect: 'Incorrect or incomplete',
feedbackTagNotWhatIAsked: 'Not what I asked for',
feedbackTagSlowOrBuggy: 'Slow or buggy',
feedbackTagStyleOrTone: 'Style or tone',
feedbackTagSafetyOrLegal: 'Safety or legal concern',
feedbackTagOther: 'Other',
},
},
}}
/>

See the React package reference for all feedback translation keys and the exported feedback types.