Definition
An AI agent design pattern where the model evaluates its own generated output against quality criteria, identifies factual gaps or unsupported claims, and triggers additional tool calls to verify or correct the output before presenting it to the user.
In Depth
The critic loop pattern addresses the core reliability problem in tool-using agents: the model may generate plausible-sounding responses that are not fully supported by the tool results it received. By adding an explicit self-evaluation step, the agent catches and corrects errors before the user sees them. Pattern structure: (1) Generate -- the agent calls tools and drafts a response. (2) Critique -- the agent re-reads its draft and identifies claims that are not directly supported by tool results. (3) Verify -- for each unsupported claim, the agent makes additional tool calls to verify or find supporting data. (4) Revise -- the agent rewrites the response incorporating verified data. (5) Output -- the final response is presented to the user. Cost implications: critic loops increase tool calls by 30-100%. A simple question that requires 1 search call in a direct-answer pattern may require 2-3 calls with a critic loop. At $0.005/query (Scavio), this adds $0.005-$0.01 per question. The tradeoff is worth it for use cases where accuracy matters more than speed: research, financial analysis, medical information, legal queries. Implementation tip: not every response needs a critic loop. Add a confidence threshold: if the initial tool results clearly answer the question, skip the critique step. If the results are ambiguous or the question is complex, trigger the full loop. This reduces unnecessary API calls by 50-70% while maintaining accuracy where it matters. Real-world impact: agents with critic loops produce responses with 40-60% fewer factual errors compared to single-pass agents, based on benchmarks from 2025-2026 agent evaluation datasets.
Example Usage
def critic_loop(query: str, max_iterations: int = 2) -> str: results = search(query) # $0.005 draft = llm.generate(f"Answer based on: {results}") for i in range(max_iterations): critique = llm.generate(f"What claims in this draft lack evidence? {draft}") if "no unsupported claims" in critique.lower(): break verification = search(critique) # $0.005 per iteration draft = llm.generate(f"Revise using: {verification}") return draft
Platforms
Critic Loop Pattern is relevant across the following platforms, all accessible through Scavio's unified API:
Related Terms
Agent Tool Dispatch
The mechanism by which an AI agent selects which external tool or API to call based on the user's intent, routes the req...
Plain Python Agent
An AI agent built using standard Python libraries (requests, json, asyncio) with direct API calls to LLM providers and t...
Agent Credit Budget
A cost control mechanism that limits how many API credits (search queries, tool calls, LLM tokens) an AI agent can consu...