← All Patterns
Validation Loop Pattern diagram
Validation Loop Pattern — structural diagram

Motivation

Some problems cannot be solved in a single pass. Fraud signal correlation, compliance gap analysis, and document confidence scoring all require iterative convergence — the agent must test something, observe the outcome, and decide whether to try again.

Standard one-shot agents cannot model this. The Validation Loop Pattern gives agents a structured skeleton for problems where the answer must be earned through iteration rather than computed in a single step.

Structure

Key Concepts

BaseValidationLoopAgent K9ValidationLoopAgent ValidationLoopContext ValidationDisposition confidence_threshold max_iterations

Used in K9-AIF

BaseValidationLoopAgent K9ValidationLoopAgent FraudDetectionAgent (EOC) DocumentExtractorAgent (EOC)