Feedback Collection and Storage
Capturing explicit ratings and implicit behavioral signals from agent interactions.
Why Agents Need Feedback
An agent that never receives feedback is frozen in time — it cannot improve beyond its initial training. Feedback closes the loop between what the agent does and what users actually want.
Two categories matter most: explicit feedback (user consciously rates output) and implicit feedback (user behavior signals quality without them saying so).
Explicit Feedback: Thumbs Up/Down
The simplest form: a binary signal after each response. Easy to collect, easy to store, but low information density.
Implementation pattern: after the agent responds, offer a feedback prompt and record the result alongside the conversation turn ID.
import uuid
from datetime import datetime
def collect_thumbs_feedback(turn_id: str, rating: str) -> dict:
"""rating: 'up' or 'down'"""
assert rating in ('up', 'down'), 'Invalid rating'
record = {
'feedback_id': str(uuid.uuid4()),
'turn_id': turn_id,
'type': 'thumbs',
'value': 1 if rating == 'up' else -1,
'created_at': datetime.utcnow().isoformat()
}
return record
feedback = collect_thumbs_feedback('turn_abc123', 'up')
print(feedback)All lessons in this course
- Feedback Collection and Storage
- Reflection and Self-Critique Loops
- Trajectory-Based Self-Improvement
- When Self-Improvement Goes Wrong