← Back to concept explainers

Concept Fable

Circuit breaker

Conclusion first:A Circuit Breaker is a reliability pattern that stops calls to a failing dependency after failures or latency cross a threshold, then allows limited probes before fully restoring traffic. In AI Agent systems, circuit breakers protect workflows from cascading failures in model providers, tools, APIs, vector databases, browsers, or downstream services. They should define failure thresholds, open/half-open/closed states, fallback behavior, telemetry, and recovery rules.

Circuit Breaker · Reliability / architecture

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

The gate that falls on its own

Mill Town had a canal that drove the millstone, the sawmill and the granary lift. The water flow was normally steady, and whichever workshop needed power simply opened its own small gate.

Later, the town brought in automatic puppets. When they saw a machine slow down, they opened the gates more frequently, pushed for more water, and retried. For a short time, output did rise.

After a heavy rainstorm, the sawmill jammed. The puppet kept requesting more water power, and the millstone beside it slowed down too, so more puppets began to retry. The entire canal was dragged into chaos.

The mayor first ordered everyone to wait patiently. But machines don't listen to reason; automatic retries, like a host of invisible hands, pushed one workshop's failure out to the whole town.

The old water engineer installed a gate that drops on its own. When a certain workshop repeatedly fails, takes too long, or returns strange sounds, the gate temporarily cuts off the water flow so it doesn't keep consuming the whole channel.

After the gate falls, the workshop enters cooldown. The system no longer retries blindly, but returns a clear signal: temporarily unavailable, take the backup path, probe for recovery later.

The water craftsman also added a half-open state. After cooling, release only a small amount of water to test; if the sawmill recovers, open it gradually; if it is still stuck, the gate continues to protect the canal.

The next time the sawmill broke down, the millstones and the granary did not stop. The townspeople saw only the sawing area temporarily closed while everything else ran as usual. The mayor understood that some doors close not as failure, but to stop failure from spreading. Later, an even trickier job came along. On the surface it looked like an old problem magnified, but in reality it forced out every gap hidden in the process: who takes over first, who can make changes, how to return to the previous step when something goes wrong. Places that used to get by on familiarity and tacit understanding now had to be spelled out clearly. The person in charge did not urge everyone to be more careful again; instead, he walked the site once more. He had people record every handover, every failure and every recovery, which places were merely slow, which places would harm the results, and which places, once wrong, would be hard to trace back. After the new rules were rolled out, the first few days were not smooth. Some complained about an extra check, some felt their old experience was being insulted. But when the next anomaly appeared, for the first time everyone could follow the traces to find where the problem had occurred, instead of gathering around the results and guessing at each other.

Reveal

This story is about: circuit breakers

A Circuit Breaker is a reliability pattern that stops calls to a failing dependency after failures or latency cross a threshold, then allows limited probes before fully restoring traffic. In AI Agent systems, circuit breakers protect workflows from cascading failures in model providers, tools, APIs, vector databases, browsers, or downstream services. They should define failure thresholds, open/half-open/closed states, fallback behavior, telemetry, and recovery rules.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Metaphor mapping

  • Water Channels: Shared Runtime Resources and Call Chains
  • Sawmill jammed: downstream service or tool failure
  • Automatic retries: uncontrolled retries by Agents and systems
  • Automatic gate drop: the circuit breaker opens
  • Cooldown period: open state and suspended calls
  • Half-open trial: half-open probe and recovery detection
  • Final insight: circuit breaking protects the overall system by stopping calls, not just fixing a single point of failure

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

Retrytimeoutfallbackresiliencebulkheadincident prevention
京ICP备2026014272号