Building self-healing tool chains with precedent memory
When a tool call fails, Cadreen classifies the failure, fixes the arguments, and retries. After a few successes, it stores the fix as a precedent for future failures.
How self-healing works
Cadreen classifies failures into categories and applies the right recovery strategy. This happens automatically — you don't need to implement retry logic.
7 recovery strategies: retry, sub_mission, human_handoff, skip, reconfigure, coerce, regenerate
Failure classification
Cadreen classifies failures using LLM inference, not string matching. The classification determines the recovery strategy.
connector_failureauth_failurepermission_failurecapability_failurerate_limit_failuredata_failureSee it in action
> Create an invoice for $500 for Acme Corp
Let me create that invoice for you.
[Calling create_invoice... Error: invalid address format]
I noticed the address format needs adjustment. Let me fix that.
[Calling create_invoice... Success]
Invoice created: inv_abc123 for $500.
Acme Corp will receive it shortly.The user sees the final result. The self-healing happened transparently. The intelligence trace records both the failure and the recovery.
Precedent memory
After 3 similar successful recoveries, Cadreen stores the fix as a precedent atom. Future failures of the same type use the stored solution — faster and more reliable.
const precedents = await cadreen.healing.precedents();
console.log(precedents);
// [
// {
// failure_type: "data_failure",
// tool: "create_invoice",
// fix: "normalize address format",
// success_count: 12,
// last_used: "2026-06-21T10:00:00Z"
// }
// ]