sdac-store-feedback
Purpose
Stores user feedback (category, free-text comment, and optional numeric rating) for a specific SDAC agent response or full conversation. Uses a MERGE upsert -- re-submitting feedback for the same turn and user updates the existing row rather than inserting a duplicate.
Tool type
Deterministic (write / upsert)
Tool ID
sdac-store-feedback
Inputs
conversation_sk(number, required) --conversationSKof the agent response being rated (fromsdac-log-conversation-turn)report_id(string, required, UUID) -- Cost report GUIDuser_id(string, required) -- User identifier from authenticationsession_id(string, required) -- Browser session IDagent_id(string, required) -- Agent that produced the responsefeedback_scope(response|conversation, default:response) -- Whether feedback applies to a single response or the full conversationturn_number(number, required) -- Turn number of the rated responserating(number, optional) -- Numeric rating on a 1-5 scalecategory(accuracy|clarity|relevance|helpfulness|tone|other| null, required) -- Feedback categorycomment(string, required) -- Free-text explanation (1-2000 characters)
Outputs
feedback_sk(number) -- Database primary key of the inserted or updated feedback recordsuccess(boolean) -- Alwaystrueon successmessage(string) -- Always"Feedback recorded"
Example output
{
"feedback_sk": 9021,
"success": true,
"message": "Feedback recorded"
}
Functional details
- Uses a SQL MERGE upsert keyed on
(ConversationSK, UserId)so duplicate submissions update in place. ratingis optional; a category and comment are sufficient.feedback_scope: conversationis used when the user rates the overall session rather than a specific turn.
Usage notes
- Pass the
conversationSKreturned bysdac-log-conversation-turnasconversation_sk. - Feedback is consumed by the Prompt Tuner workflow via
sdac-read-feedback.
Implementation details
- Writes to
SDAC.fact_UserFeedbackviainsertOrUpdateFeedbackinpackages/domain-sdac/src/tools/feedback/.
Code Location: packages/domain-sdac/src/tools/store-feedback.tool.ts