AI Space

AI Models & Assistants / Knowledge library

Reflection Loop

Reviews a draft or trajectory, identifies shortcomings, and uses feedback for another attempt

Agent self-critique loop

Why learn Reflection Loop?

It can improve complex outputs by making detected errors actionable in a subsequent iteration.

The problem it solves

It provides a correction path when a first-pass answer or plan is incomplete.

Where it came from

Reflection loops add a critique step after generation or action. Feedback may come from the same model, a separate model, tests, or environment signals; self-critique alone can repeat the same blind spots.

Build your understanding

Work through these exercises in order. Try the task before opening a reference.

  1. Define Reflection Loop and identify its place in an agent architecture.
  2. Choose a task where Reflection Loop improves an agent system.
  3. Diagnose one failure caused by misusing Reflection Loop.
  4. Interpret a trace or state transition involving Reflection Loop.
  5. Explain one operational tradeoff of Reflection Loop.

Documentation and sources

Connect the ideas

Explore next

Plan-Execute-Replan LoopEvaluator-Optimizer LoopAgent MemoryMemory-Augmented Agent Loop

Real World Example

Illustrative business scenario · AI-generated from linked documentation · Not a measured customer case study

Automated Legal Contract Compliance Review

Corporate legal departments managing high-volume vendor contract renewals.

The business problem

Manual contract review is prone to oversight, leading to missed compliance clauses and inconsistent risk assessment across thousands of documents.

How this topic solves it

The Reflection Loop framework enables an AI agent to draft a compliance summary, receive environment feedback (e.g., missing mandatory clauses), and perform a self-reflective critique to refine the summary before final submission.

  1. Generate an initial compliance summary based on the raw contract text.
  2. Execute a validation script to check for required legal clauses and mandatory terminology.
  3. Pass the validation error logs as linguistic feedback to the agent.
  4. Instruct the agent to analyze the feedback and generate a revised, compliant summary.
  5. Store the successful reflection and final summary in an episodic memory buffer for future similar contract types.
Reflection Loop Process · Process flow

The flow shows how an agent iterates on a task using feedback.

Drafting Agent

Generates initial contract summary

Validator

Checks for missing clauses

Feedback Loop

Provides error logs to agent

Memory Buffer

Stores successful strategies

  • Drafting Agent → submits draft → Validator
  • Validator → identifies errors → Feedback Loop
  • Feedback Loop → provides critique → Drafting Agent
  • Drafting Agent → saves refinement → Memory Buffer

Expected business outcome

Improved accuracy in identifying missing compliance requirements without requiring expensive model fine-tuning.

Limitations and checks

The system may suffer from 'reflection drift' where the agent over-corrects based on feedback, potentially introducing new errors; this is checked by monitoring the delta between consecutive draft versions.

Sources

Generated 2026-10-18 with gemini-3.1-flash-lite. Your assessment includes two questions about this example.

Catalog source: technology-maxxing. This page reproduces the existing catalog’s learning material and source links.