liveBook · Manning

Fallback

As explained in AI Agents in Action, Second Edition

A fallback is an alternative action or implementation used when the preferred operation cannot complete successfully.

A fallback is an alternative action or implementation used when the preferred operation fails or exceeds its time budget. It keeps an agent useful instead of exposing an avoidable error. section 8.3.7

Treat failure as normal control flow: after a tool fails, an agent may retry, fall back, ask the user, or abandon the task. Limit retries so recovery does not become a runaway loop. section 1.1.3

Useful fallback choices include:

  • Return a best-effort answer when the preferred tool cannot complete. section 8.3.7
  • Switch to a smaller model when the primary model exceeds its budget or becomes unavailable. section 8.3.7
  • Omit non-essential decoration, such as images, while preserving the core response. section 8.3.7
  • Combine fallbacks with timeouts, budgets, circuit breakers, and graceful degradation to route around repeated or costly failures. section 8.3.7

Graceful alternatives

If text-to-speech is unavailable, continue with text. If an image tool is slow, return a link for viewing later. If confidence remains low or resources run out, present partial information, mark uncertainty, and suggest next steps. section 8.3.7 section 10.3.7

How AI Agents in Action, Second Edition covers it

How deep it goes
Explains fallback triggers, alternatives, retry limits, and coordination with circuit breakers, but does not specify implementation code.
Examples
Uses best-effort answers, smaller models, omitted images, text-only responses, delayed image links, and uncertainty-marked partial information.
What it assumes
Assumes familiarity with agents, tools, model calls, and operational budgets while treating tool failure as normal control flow.
What you can do after
Apply fallback routing to preserve useful agent behavior while limiting retries and clearly marking uncertain results.
How it connects
Connects fallback with timeouts, budgets, retries, circuit breakers, graceful degradation, confidence thresholds, and tool calling.

Also explained in

Compare how 15 books explain fallback →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.