0Pricing
AI Agents · Lesson

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

  1. Feedback Collection and Storage
  2. Reflection and Self-Critique Loops
  3. Trajectory-Based Self-Improvement
  4. When Self-Improvement Goes Wrong
← Back to AI Agents