verification-retry-loop

Verify structured Pydantic LLM output and retry once with feedback.

Updated May 10, 2026
One-click install
npx skills add https://github.com/PatientVibes/agent-skills --skill verification-retry-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: verification-retry-loop
Source: https://github.com/PatientVibes/agent-skills/tree/main/plugins/verification-retry-loop/skills/verification-retry-loop
Command: npx skills add https://github.com/PatientVibes/agent-skills --skill verification-retry-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures the quality of data extracted from LLMs by automatically verifying it and retrying if necessary, with a maximum of one retry, to maintain accuracy.

Core Features & Use Cases

  • Structured Data Extraction: Supports structured Pydantic extraction from LLMs.
  • Deterministic Post-Checks: Runs deterministic checks on the output.
  • Bounded Retries: Automatically retries extraction with feedback if issues are detected, up to one time.
  • Use Case: Ideal for extracting information from user documents and ensuring the data quality before final processing.

Quick Start

Implement the extract_with_verification function with your Pydantic model and verification function.

Frequently Asked Questions about verification-retry-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify structured data extracted from an LLM?

Verify structured data extracted from an LLM by running deterministic post-checks against a Pydantic model. This process validates the extracted output to ensure high data accuracy before final processing.

What is the best way to retry LLM extraction when data accuracy checks fail?

Retry LLM extraction with automated feedback when data accuracy checks fail. This approach implements a bounded retry loop, automatically re-running extraction once with verification issues provided as feedback to the model.

Can I use Pydantic models for structured output verification?

Yes, you can use Pydantic models for structured output verification. The Skill supports structured Pydantic extraction from LLMs, applying deterministic checks on the output to validate the extracted data structure.

How do I automate document processing quality checks with bounded retries?

Automate document processing quality checks by implementing the extract_with_verification function. It runs deterministic post-checks on extracted data and automatically retries once with feedback if issues are detected.

What are the limitations of using a bounded retry loop for LLM data extraction?

The limitation of a bounded retry loop for LLM data extraction is the maximum retry count of one. If the re-extraction attempt with feedback still fails the deterministic post-checks, the loop stops and does not attempt further retries.