Skip to content
47% off: the complete course for $79 (reg. $149)See the offer →
Agent Builder

AI agent glossary

Circuit breaker

A reliability pattern that stops calling a failing service for a while after repeated errors, and switches to a fallback instead of retrying endlessly.

When a model API or tool starts failing, naive retries make things worse: every run keeps hammering the broken service, queues back up, and the retries themselves add load. A circuit breaker watches the error rate and, once it crosses a threshold, opens the circuit, so calls fail fast or go to a fallback.

After a cooling-off period it lets a few test calls through. If they succeed, normal traffic resumes; if not, it stays open.

For agents, the fallback might be a different model or provider, a cached answer, a simpler degraded mode, or a clear message that the task will be retried later. Pair circuit breakers with retries in a single layer and with timeouts at every level.

Example

After ten consecutive overload errors from the primary model, the breaker opens and routes new agent steps to a fallback model for one minute before testing the primary again.

Learn more in the course

Related terms

Go from definitions to doing

Learn to use and build AI agents in 130 practical lessons.