For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Collect user feedback in Agent Analytics
Agent Analytics records user feedback as [Agent] Score events that your application sends when a user rates a response. A score named user-feedback overrides the detected negative feedback signal for its session, so a thumbs up beats a false-positive frustration detection, and a thumbs down flags a session even when the model saw nothing wrong.
Amplitude never generates Score events. A chart of [Agent] Score where Score Name is user-feedback is a pure measure of what your users said. The classic quality chart is the disagreement view: sessions the signals judged fine that users rated thumbs down.
Decide the score shape
Three decisions matter:
- Name it
user-feedback. Use this exact Score Name for a binary thumbs control, because of its override semantics. For a five-star or CSAT scale, use a different name, such ascsat, so your thumbs metric stays clean. - Target the message. Rate the specific AI response the user reacted to by passing its
[Agent] Message IDas the target, with target typemessage. Use target typesessiononly for end-of-conversation ratings, such as a CSAT prompt. - Send value 1 for up, 0 for down, with source
user. For other scales, pass the numeric value.
Sparse clicks are fine. Built-in signals score every session regardless, and Amplitude captures implicit behavior (copy, regenerate, abandonment) automatically. Explicit ratings sharpen the picture where you have them.
Send feedback with the AI SDK
Wire your feedback control to the session's scoring method:
// Node: inside the session, when the user clicks the control
s.score('user-feedback', 1, aiMessageId, { source: 'user' }); // thumbs up
s.score('user-feedback', 0, aiMessageId, {
source: 'user',
comment: freeTextFromUser, // optional; gated by privacy mode
}); // thumbs down
Feedback often arrives after the request that produced the response has finished, for example when the user clicks minutes later in the frontend. For that path, call the client-level method with the session and target IDs you stored alongside the message:
ai.trackScore({
userId,
name: 'user-feedback',
value: 0,
targetId: aiMessageId,
targetType: 'message',
source: 'user',
sessionId,
});
The optional comment is content, so your privacy mode gates it.
Send feedback without the AI SDK
POST the same event shape to the HTTP API. The override semantics apply identically.
curl -X POST https://api2.amplitude.com/2/httpapi \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"events": [{
"event_type": "[Agent] Score",
"user_id": "user-123",
"event_properties": {
"[Agent] Session ID": "ticket-42",
"[Agent] Agent ID": "support-bot",
"[Agent] Score Name": "user-feedback",
"[Agent] Score Value": 1,
"[Agent] Target ID": "msg-1",
"[Agent] Target Type": "message",
"[Agent] Evaluation Source": "user"
}
}]
}'
For every Score property, refer to [Agent] Score in the taxonomy.
Was this helpful?