RALPH Protocol (Retry And Learn Protocol)

What It Is

A structured error-recovery protocol for sub-agents. Max3 retries per task. Between retries, diagnostics are passed so the next attempt knows why the previous one failed. If the same error occurs twice consecutively, escalate immediately — do not keep retrying blindly.

Key Rules

  • 3 retries max — after3 failures, stop retrying
  • Pass diagnostics — each retry carries context about what failed and why
  • Same error twice = escalate — if the error repeats after2 retries, escalate immediately
  • Escalation target — human operator or designated fix agent

How It Applies to Marketing Factory

Marketing agents (content, outbound, analytics) should implement RALPH when calling external APIs (email send, CRM update, analytics query). Retry on transient failures (timeout, 503). Pass the error context forward. Escalate on persistent failures (auth rejection, rate limit).