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.

PatternUse whenBreaks whenWhat to instrument
Simple RAGDirect questions over one well-kept corpus.The corpus drifts, or chunking splits the answer.Hit rate, empty-result rate, source age.
RAG with memoryMulti-turn work where context carries forward.Stale memory outranks fresh evidence.Memory hits vs. source hits per answer.
Branched RAGQuestions span distinct knowledge bases.The router picks the wrong base, silently.Route decision logged with its input.
HyDEQueries are short and sources are long.The hypothetical answer anchors on a wrong premise.Recall with and without the hypothesis.
Adaptive RAGQuery difficulty varies widely.Classification costs more than it saves.Path chosen, latency and spend per path.
Corrective RAGWrong-but-confident costs more than latency.The grader shares the generator’s blind spots.Grade distribution, re-retrieval rate.
Self-RAGReflection tokens can be tuned on your domain.Reflection becomes ritual instead of signal.Critique tokens against human grades.
Agentic RAGRetrieval 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.

PatternUse whenBreaks whenWhat to instrument
Thin product gatewayOne set of user-facing contracts and authorisation.Nobody owns the downstream service.Downstream health per route.
Conversation coordinatorCompeting turns across replicas.Identities aren’t stable; cancellation is vague.Busy results, rejoin rate.
Typed events with cursorsReconnect and deterministic UI reducers.A client falls past the replay horizon.Cursor gaps, replay payload size.
Checkpointed agent workInterrupted runs should reuse finished work.Effects aren’t idempotent; schemas drift.Resume rate, repeated side effects.
Evidence / presentation splitRe-render without losing sources.Evidence IDs aren’t stable.Unresolved references per answer.
Isolated read mirrorReads dominated by repeated hydration.The version misses a dependency.Mirror hits, sync cost, disk use.
Bounded specialist delegationParallel, inspectable research.No finish reserve; overlapping writes.Specialist time against the reserve.
Dual-path rolloutMeasure 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.