hoangsonww/AI-RAG-Assistant-Chatbot
View on GitHubResponse Feedback Loop (Thumbs, Optional Correction, and Quality Metrics)
Open
#35 opened on Feb 16, 2026
bugcodexdocumentationenhancementgood first issuehelp wantedquestion
Repository metrics
- Stars
- (43 stars)
- PR merge metrics
- (PR metrics pending)
Description
Summary
Introduce per-response feedback in chat (thumbs up/down + optional free-text correction) and store it for quality analytics and iterative prompt/retrieval tuning.
Problem
The project mentions RLHF-style improvement, but there is no clear user-facing feedback capture path in chat and no structured feedback dataset to guide quality improvements.
Proposed Solution
Add feedback events at the message level and expose lightweight analytics for maintainers.
Backend
- Add
MessageFeedbackmodel (or embedded schema) with:userId | guestIdconversationIdmessageIdrating(up|down)comment(optional)createdAt
- Add endpoints:
POST /api/feedback(submit/update feedback for a message)GET /api/feedback/summary(aggregate counts + trend, admin-only)
- Ensure idempotency: one active feedback record per user/message pair.
Frontend
- Add thumbs up/down controls on assistant messages.
- If thumbs down, prompt for optional short correction/comment.
- Show immediate UI acknowledgement and allow feedback update.
- Add a simple admin quality panel (or stats card) with aggregate metrics.
Observability
- Track counters for positive/negative feedback rates.
- Track top downvoted prompts/conversation intents for triage.
Acceptance Criteria
- Every assistant message can receive feedback in authenticated and guest modes.
- Re-submitting feedback updates prior feedback instead of duplicating records.
- Downvote flow supports optional text comment.
- Summary endpoint returns daily counts and up/down ratio.
- Feedback controls are accessible on desktop and mobile.
- Tests cover API validation, idempotency behavior, and UI interactions.
Out of Scope
- Automatic model fine-tuning pipeline.
- Fully-fledged experimentation platform (A/B framework).
Suggested Tasks
- Create feedback schema/model + indexes.
- Implement submit and summary endpoints.
- Add chat message feedback UI and downvote comment modal.
- Add analytics widget for maintainers.
- Add unit/integration tests + docs in README/openapi.