An Intelligent Recovery Layer for Recurring Payments

Razorpay’s subscription infrastructure retries failed payments on a fixed T+1 / T+2 / T+3 schedule, regardless of why the payment failed. RecoverOS is the reasoning and governance layer that decides retry-vs-wait-vs-stop-vs-escalate based on failure cause, customer context, and RBI constraints — built to complement Razorpay’s existing infrastructure, not replace it.

THE REVENUE PROBLEM

Why Generic Retries Fail

The difficult part is not knowing that a payment failed. The difficult part is deciding what should happen next — without creating unnecessary retries, unsafe automation, or customer fatigue.

GENERIC HANDLING (STATIC RULES)
Payment Fails
↓
Generic Retry / Generic Notification
↓
Customer Does Not Recover
↓
Revenue Remains Lost

A fixed retry schedule blindly retries cancelled mandates (0% recoverable) and mis-times insufficient funds (salaries credited on 1st/30th).

RECOVEROS BOUNDED ORCHESTRATION
1. Revenue Event Detected
↓
2. Understand Why It Happened
↓
3. Choose Right Intervention
↓
4. Check Policy Guardrails
↓
5. Execute / Escalate / Stop
↓
6. Observe Outcome & Measure Recovered Revenue

Decisions are bounded by deterministic rules, quiet hours (22:00–08:00), ₹15k RBI mandate limits, and active dispute hard gates.

THE RECOVEROS SOLUTION

How RecoverOS Handles a Failed Subscription Payment

Instead of a single blind retry loop, RecoverOS operates as a multi-layered diagnostic system tailored specifically for recurring billing in India.

01 · MULTI-MERCHANT AGGREGATOR

Aggregator Vantage Point

Detects systemic issuing bank outages (e.g. HDFC 400+ failures) across merchants to prevent gateway retry storms with jittered deferrals.

90–150 min randomized jitter
02 · CAUSAL DIAGNOSIS

Root-Cause Taxonomy

Distinguishes transient network glitch vs. salary-cycle insufficient funds vs. permanent mandate cancellations vs. active chargebacks.

13 distinct failure categories
03 · DETERMINISTIC POLICY

Bounded Restraint

Enforces non-AI overridable rules: retry limits, 4h cooldowns, RBI ₹15,000 mandate authentication, quiet hours, and dispute gates.

100% fail-closed execution
04 · ATTRIBUTION HONESTY

Counterfactual Lift

Explicitly reports gross recovered vs. what native retry would have recovered on its own. Declines credit when baseline would succeed.

+17.0% net incremental lift
SYSTEM ARCHITECTURE

Hexagonal Clean Architecture Diagram

RecoverOS decouples core domain rules from external infrastructure and payment clients.

RECOVEROS DOMAIN BOUNDARIES
141 Unit & Integration Tests Passed
Razorpay-compatible / Merchant Events
↓
Event Ingestion & Normalization
↓
Recovery Case Pipeline
↓
Signals & Context
AI Investigator
Deterministic Fallback
↓
Policy & Routing (Hard Gate)
Approved ↓Escalated ↓
Action Adapter
Human Review
↓
Outcome Observer + Audit Trail
↓
Metrics & Benchmark
BOUNDARIES & EXECUTION AUDIT

AI Can Recommend. It Cannot Act Without Boundaries.

Every recovery decision passes through a deterministic policy layer that is not AI at all. Below is the exact boundary ledger alongside the transparent reality audit.

AI IS USED FOR
Classifying ambiguous failure causes: (~17.5% of cases requiring multi-signal nuance).
Drafting customer reminders: Context-aware tone matching high-LTV vs. standard tiers.
Proposing WHEN to retry & WHY: Behavioural timing suggestions.
Audit explanations: Translating telemetry into plain-language audit logs.
Strict Zod schema validation · Zero direct money authority
AI IS DELIBERATELY NOT USED FOR
Retry caps, cooldowns & quiet hours: Hard deterministic code blocks (22:00–08:00).
RBI ₹15,000 mandate threshold: Enforces re-authentication without exceptions.
Active dispute hard blocks: Halts recovery during active customer chargeback.
Direct money execution: AI never calls the payment capture API directly.
100% deterministic code · Fail-closed transactions

What is Simulated vs. What Actually Executes

Pipeline LayerWhat is SyntheticWhat Actually Executes in Real Code
Event IngressSample webhook JSON payloadsHMAC-SHA256 signature verification & deduplication execute
AI InvestigationMock LLM provider option for offline testsZod schema validation, retry loop & fallback matrix execute
Policy EngineConfigured merchant limitsRetry caps, quiet hours, ₹15k RBI limits & dispute checks execute
Outage Cluster EngineSimulated bank failure burst10-min rolling window cluster tracker & randomized jitter deferral execute
Payment Action AdapterMoney movement is simulatedIdempotency headers, state machines & audit log events execute
Human Review ConsoleDemo cases are seededReal-time polling, state transitions & analyst approval execute
RESILIENCE & CHAOS HANDLING

When Systems Fail, RecoverOS Remains Safe

When AI, infrastructure, external APIs, or data fail, RecoverOS remains predictable, safe, and prevents duplicate financial actions.

CHAOS TEST: PROVIDER RESPONSE TIMEOUT & RECONCILIATION
CHAOS VERIFIED
14:01:02ACTION_DISPATCHED — Razorpay capture attempt #1 with idempotency key
14:01:03Provider HTTP 504 gateway response timeout
14:01:03STATUS_UNKNOWN — retry blocked, no duplicate action fired
14:01:04Reconciliation worker scheduled with 5s exponential backoff
14:01:08Provider payment lookup initiated (`GET /payments/pay_4918`)
14:01:09Payment confirmed CAPTURED on provider ledger
14:01:09CASE → RECOVERED (via reconciliation lookup, zero duplicate charges)
JUDGE DEMO GUIDE

4-Step Demonstration Route & What to Notice

The fastest, most thorough way to evaluate RecoverOS against the AI Buildathon rubric.

STOP 1 · SIMULATOROpen Screen

Simulation Control Center

What is this? A real-time execution engine loaded with 13 production payment failure scenarios (Expired cards, OTP timeouts, mandate revocations, etc.).

What to notice: The 7-stage interactive pipeline stepper, live telemetry logs, webhook emission, and customer WhatsApp/Email action simulator.

Test Simulator Scenarios →
STOP 2 · HUMAN REVIEWOpen Screen

Operations Review Console

What is this? Operations review queue for low-confidence AI proposals, policy threshold escalations, and high-value invoice disputes.

What to notice: The plain-language reasoning chain, signal vectors, and 1-click Approve / Reject / Override controls with live state persistence.

Inspect Review Queue →
STOP 3 · FAILURE LABOpen Screen

Chaos Engineering Lab

What is this? A live chaos laboratory to trigger provider 504 timeouts, corrupted JSON outputs, and multi-merchant bank outages.

What to notice: Fail-closed database transactions, automated reconciliation workers, and prevention of duplicate financial transactions.

Run Chaos Scenarios →
STOP 4 · BENCHMARK LIFTOpen Screen

Counterfactual Attribution

What is this? A 500-case paired benchmark comparing RecoverOS against Razorpay’s native retry schedule.

What to notice: The honest +17% incremental recovery lift, transparent 82.5% fast-path cost split (avg ₹0.15/call), and refusal to take credit on baseline wins.

View Benchmark Metrics →
WHY RECOVEROS WINS THE AI BUILDATHON

Detecting that 412 failures across different merchants share one root cause — a specific bank having an outage — requires seeing volume across merchants, which only an aggregator like Razorpay can see. RecoverOS is designed as the reasoning layer that sits naturally at that vantage point: complementing Razorpay’s existing retry infrastructure, grounded in real RBI regulatory constraints, and built so that every dollar of recovered revenue it claims can be explained, audited, and — when it’s not sure — handed to a human instead of guessed.