Fallback Patterns for AI Components
Model fallback
When the primary model is unavailable or degraded, route to a secondary model. A primary model call that fails after defined retries falls back to a secondary model from a different provider. The secondary model may have different capability characteristics — design the output schema to be compatible with both, and monitor the fallback rate as an indicator of primary model health.
Cached response fallback
For repeated queries (FAQ, standard questions), serve cached responses when the model is unavailable. The user gets a response — potentially one generated in a prior successful call — rather than an error. This is appropriate when the response is not time-sensitive and the query pattern is repetitive.
Graceful degradation
When AI is unavailable, degrade to a non-AI version of the feature rather than failing completely. An AI-powered document extraction system falls back to a manual review queue. An AI recommendation engine falls back to rule-based recommendations. The user experience degrades, but the workflow continues.