CustomLabs
Patterns

11 patterns for AI systems that survive production.

This is the companion to the failure-mode field guide. That guide shows what breaks. This library shows how to build so it does not. Each pattern has trade-offs and signals to measure.

Failure mode → pattern that prevents it

Agent control flow #

Retrieval #

Reliability & guardrails #

Evals & observability #

Cost & routing #

Questions

Which of these do you need?#

The questions that come up before a team decides which patterns to adopt and which to skip.

01 How is this different from the failure-mode field guide?

The failure-mode field guide is diagnostic. It starts from a symptom you already have and works backward to a root cause and a fix. This library is prescriptive. It starts from an architectural decision you make before anything breaks. The cross-reference table above links the two. Every failure mode traces to at least one pattern that prevents it.

Link to this answer: How is this different from the failure-mode field guide?
02 Do I need all of these?

No. Most systems need three or four of these patterns. Every entry has an explicit "don't use it when" section for this reason. A pattern your system does not need adds complexity debt. Start from the failure mode you are most exposed to and work from there.

Link to this answer: Do I need all of these?
03 Are these specific to one model provider?

No. Every pattern here is an architectural decision, such as a routing layer or a schema. A caching order or a CI gate qualifies too. These decisions hold up whether the model behind them is a frontier API or a self-hosted open-weight model. See our take on staying model-agnostic by design.

Link to this answer: Are these specific to one model provider?
Next step

A Ship Audit tells you which of these patterns your system lacks. It ranks them by what is most likely to break first.

Book a Ship Audit →

Source: https://customlabs.io/patterns/

↑↓ navigate ↵ select esc close