error-recovery-retry

Implement bounded retries with exponential backoff and circuit breakers for AI agents.

364|53|Updated May 9, 2026
One-click install
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill error-recovery-retry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-recovery-retry
Source: https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories/ai-ml/error-recovery-retry
Command: npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill error-recovery-retry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps production AI agents recover from transient failures and avoid cascading outages by adding structured retry, circuit breaking, and escalation paths when things go wrong.

Core Features & Use Cases

  • Failure taxonomy & decisioning: Classifies errors (transient, rate limited, validation, model error, permanent) to decide what to retry versus when to escalate.
  • Exponential backoff + jitter retries: Implements bounded retries with delay growth and random jitter to reduce load spikes.
  • Circuit breaker + graceful degradation: Prevents repeated calls to failing dependencies and switches capabilities or tool availability under sustained failure.
  • State recovery + dead-letter queue: Checkpoints agent state for replay and routes unrecoverable tasks to a DLQ for human review or later replay.

Quick Start

Ask an agent to apply error-recovery-retry patterns to your tool calls and model requests by implementing bounded exponential backoff retries, circuit breakers per dependency, and a dead-letter queue for unrecoverable failures.

Frequently Asked Questions about error-recovery-retry

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

FAQPage Schema
How do I add retry logic and exponential backoff to AI agent tool calls?

Implement bounded exponential backoff with random jitter to retry transient API failures, preventing load spikes while waiting for dependent services to recover from rate limiting or temporary outages.

What is a circuit breaker pattern for fault tolerance in production AI agents?

A circuit breaker prevents repeated calls to failing dependencies by tracking state transitions, enabling production AI agents to trigger graceful degradation and reduce tool availability under sustained failure conditions.

How do I handle permanent failures and unrecoverable tasks in AI workflows?

Route unrecoverable tasks to a dead-letter queue for human review or later replay, ensuring permanent validation errors and model failures do not block the primary agent workflow or cause cascading outages.

Can I checkpoint agent state for replay after a transient API failure?

Yes, checkpoint agent state during execution to enable replay after transient API failures, allowing the production AI agent to resume tool calls from the last known good state without restarting the workflow.

What is the best way to classify errors for retry versus escalation in agents?

Use a failure taxonomy to classify transient, rate limited, validation, and permanent errors, deciding which failures to retry with backoff versus when to escalate to dead-letter queue routing.

Why does my AI agent cause cascading outages when a dependency fails?

Cascading outages happen when agents lack circuit breakers and graceful degradation, causing repeated calls to failing dependencies; adding bounded retries and fallback strategies prevents this failure mode.