Pattern catalog · 20 patterns
Every pattern, with the way it breaks.
Retrieval, agent behaviour and production patterns: when to use each, how it fails in real traffic, and what to instrument before it does. Hire for the ones your system is missing.
01
Retrieval
Eight ways to put evidence in front of a model, from a single corpus to retrieval that plans.
| Pattern | Use when | Breaks when | What to instrument |
|---|---|---|---|
| Simple RAG | Direct questions over one well-kept corpus. | The corpus drifts, or chunking splits the answer. | Hit rate, empty-result rate, source age. |
| RAG with memory | Multi-turn work where context carries forward. | Stale memory outranks fresh evidence. | Memory hits vs. source hits per answer. |
| Branched RAG | Questions span distinct knowledge bases. | The router picks the wrong base, silently. | Route decision logged with its input. |
| HyDE | Queries are short and sources are long. | The hypothetical answer anchors on a wrong premise. | Recall with and without the hypothesis. |
| Adaptive RAG | Query difficulty varies widely. | Classification costs more than it saves. | Path chosen, latency and spend per path. |
| Corrective RAG | Wrong-but-confident costs more than latency. | The grader shares the generator’s blind spots. | Grade distribution, re-retrieval rate. |
| Self-RAG | Reflection tokens can be tuned on your domain. | Reflection becomes ritual instead of signal. | Critique tokens against human grades. |
| Agentic RAG | Retrieval needs planning and tools. | Loops and tool spend grow without bound. | Tool rounds, finish-reserve hits, spend cap. |
02
Agent behaviour
Four behaviours every agent harness ends up implementing, and the guardrails each one needs.
01 Reflection
A critique pass is another model call with its own budget. Cap it, log the delta, stop when the answer stops changing.
max rounds · delta threshold
02 Tool use
Typed tools with per-call time limits and inspectable outcomes. Independent calls run as a bounded batch.
timeout per call · bounded fan-out
03 Planning
Plans are state, not prose: plan and task events let the interface show progress and the run resume.
task_plan · task_update
04 Multi-agent
Each specialist gets a question, a source policy, an output schema and a budget, and ends in time for synthesis.
schema · budget · finish reserve
03
Production
Eight structural patterns from running agent platforms, each with the cost it brings.
| Pattern | Use when | Breaks when | What to instrument |
|---|---|---|---|
| Thin product gateway | One set of user-facing contracts and authorisation. | Nobody owns the downstream service. | Downstream health per route. |
| Conversation coordinator | Competing turns across replicas. | Identities aren’t stable; cancellation is vague. | Busy results, rejoin rate. |
| Typed events with cursors | Reconnect and deterministic UI reducers. | A client falls past the replay horizon. | Cursor gaps, replay payload size. |
| Checkpointed agent work | Interrupted runs should reuse finished work. | Effects aren’t idempotent; schemas drift. | Resume rate, repeated side effects. |
| Evidence / presentation split | Re-render without losing sources. | Evidence IDs aren’t stable. | Unresolved references per answer. |
| Isolated read mirror | Reads dominated by repeated hydration. | The version misses a dependency. | Mirror hits, sync cost, disk use. |
| Bounded specialist delegation | Parallel, inspectable research. | No finish reserve; overlapping writes. | Specialist time against the reserve. |
| Dual-path rollout | Measure a new path, keep a way back. | Flags outlive the migration. | Flag age, path split, error delta. |
Missing one of these in production?
Hire the engineer who has shipped them, from the Figma frame to the trace.
