{
  "$schema": "./recipes.schema.json",
  "title": "Pattern Recipes",
  "description": "Named cross-category compositions: real systems compose many patterns at once. Each recipe lists the patterns that together produce a recognisable kind of system. Members carry a role: 'core' patterns define the recipe and removing one breaks the shape; 'hardening' patterns add safety, observability, or correctness; 'optional' patterns are common variations or upgrades.",
  "last_analysis_date": "2026-04-30",
  "roles": {
    "core": "Removing this pattern breaks the recipe.",
    "hardening": "Adds safety, robustness, observability, or cost control on top of the core shape.",
    "optional": "Common variation or upgrade; not required for the recipe to be itself."
  },
  "recipes": [
    {
      "id": "modern-coding-agent",
      "name": "Modern Coding Agent",
      "description": "An agent that reads, writes, and runs code in a sandbox, calling tools and (optionally) sub-agents while a human approves the destructive parts. The shape that powers Cursor, Claude Code, OpenHands, Aider, Codex CLI.",
      "members": [
        {"pattern": "react", "role": "core"},
        {"pattern": "tool-use", "role": "core"},
        {"pattern": "code-as-action", "role": "core"},
        {"pattern": "code-execution", "role": "core"},
        {"pattern": "agent-computer-interface", "role": "core"},
        {"pattern": "step-budget", "role": "hardening"},
        {"pattern": "subagent-isolation", "role": "hardening"},
        {"pattern": "sandbox-isolation", "role": "hardening"},
        {"pattern": "approval-queue", "role": "hardening"},
        {"pattern": "decision-log", "role": "hardening"},
        {"pattern": "mcp", "role": "optional"},
        {"pattern": "agent-skills", "role": "optional"},
        {"pattern": "todo-list-driven-agent", "role": "optional"}
      ]
    },
    {
      "id": "production-rag",
      "name": "Production RAG",
      "description": "Retrieval-grounded generation built to be defensible: hybrid retrieval, reranking, contextualised chunks, citations rendered to the user, and verification before the answer ships.",
      "members": [
        {"pattern": "agentic-rag", "role": "core"},
        {"pattern": "hybrid-search", "role": "core"},
        {"pattern": "cross-encoder-reranking", "role": "core"},
        {"pattern": "contextual-retrieval", "role": "core"},
        {"pattern": "citation-streaming", "role": "core"},
        {"pattern": "chain-of-verification", "role": "hardening"},
        {"pattern": "eval-harness", "role": "hardening"},
        {"pattern": "confidence-reporting", "role": "hardening"},
        {"pattern": "crag", "role": "optional"},
        {"pattern": "hyde", "role": "optional"},
        {"pattern": "raft", "role": "optional"}
      ]
    },
    {
      "id": "voice-agent-stack",
      "name": "Voice Agent Stack",
      "description": "A low-latency conversational agent over a phone or microphone, with handoff to humans, mid-utterance cancellation, and per-call session boundaries. The shape behind LiveKit, Pipecat, Vapi, Retell.",
      "members": [
        {"pattern": "multilingual-voice-agent", "role": "core"},
        {"pattern": "tool-use", "role": "core"},
        {"pattern": "stop-cancel", "role": "core"},
        {"pattern": "session-isolation", "role": "core"},
        {"pattern": "conversation-handoff", "role": "hardening"},
        {"pattern": "salience-triggered-output", "role": "hardening"},
        {"pattern": "bidirectional-impulse-channel", "role": "optional"},
        {"pattern": "code-switching-aware-agent", "role": "optional"}
      ]
    },
    {
      "id": "sovereign-deployment",
      "name": "Sovereign / Regulated Deployment",
      "description": "An agent stack that satisfies data-residency and audit requirements: weights, inference, tools, and logs all sit inside an operator-controlled boundary, with provenance and incident response wired in.",
      "members": [
        {"pattern": "sovereign-inference-stack", "role": "core"},
        {"pattern": "open-weight-cascade", "role": "core"},
        {"pattern": "provenance-ledger", "role": "hardening"},
        {"pattern": "lineage-tracking", "role": "hardening"},
        {"pattern": "constitutional-charter", "role": "hardening"},
        {"pattern": "approval-queue", "role": "hardening"},
        {"pattern": "kill-switch", "role": "hardening"},
        {"pattern": "incident-response-runbook", "role": "hardening"},
        {"pattern": "sandbox-escape-monitoring", "role": "hardening"},
        {"pattern": "decision-log", "role": "hardening"}
      ]
    },
    {
      "id": "long-running-autonomous-agent",
      "name": "Long-Running Autonomous Agent",
      "description": "An agent that operates over hours to weeks, surviving restarts and accumulating memory while remaining safe. The shape behind Devin, Manus, Sparrot, durable LangGraph runs.",
      "members": [
        {"pattern": "agent-resumption", "role": "core"},
        {"pattern": "five-tier-memory-cascade", "role": "core"},
        {"pattern": "cross-session-memory", "role": "core"},
        {"pattern": "step-budget", "role": "hardening"},
        {"pattern": "decision-log", "role": "hardening"},
        {"pattern": "compensating-action", "role": "hardening"},
        {"pattern": "append-only-thought-stream", "role": "hardening"},
        {"pattern": "constitutional-charter", "role": "hardening"},
        {"pattern": "salience-triggered-output", "role": "optional"},
        {"pattern": "memgpt-paging", "role": "optional"},
        {"pattern": "todo-list-driven-agent", "role": "optional"}
      ]
    },
    {
      "id": "multi-agent-debate",
      "name": "Multi-Agent Debate",
      "description": "Two or more agents argue toward a better answer than any single agent would produce, with a frozen rubric to score the result. The shape behind debate-style alignment work and 'committee of critics' setups.",
      "members": [
        {"pattern": "debate", "role": "core"},
        {"pattern": "inner-critic", "role": "core"},
        {"pattern": "frozen-rubric-reflection", "role": "core"},
        {"pattern": "llm-as-judge", "role": "hardening"},
        {"pattern": "best-of-n", "role": "hardening"},
        {"pattern": "camel-role-playing", "role": "optional"}
      ]
    },
    {
      "id": "browser-computer-use-stack",
      "name": "Browser & Computer-Use Stack",
      "description": "An agent that drives a real GUI: planning a task, grounding actions in pixels or DOM, and asking permission before destructive clicks. The shape behind OpenAI Operator, Anthropic Computer Use, Browser Use, Stagehand, MultiOn.",
      "members": [
        {"pattern": "computer-use", "role": "core"},
        {"pattern": "browser-agent", "role": "core"},
        {"pattern": "tool-use", "role": "core"},
        {"pattern": "dual-system-gui-agent", "role": "hardening"},
        {"pattern": "approval-queue", "role": "hardening"},
        {"pattern": "sandbox-isolation", "role": "hardening"},
        {"pattern": "step-budget", "role": "hardening"},
        {"pattern": "session-isolation", "role": "optional"}
      ]
    },
    {
      "id": "memory-architecture",
      "name": "Memory Architecture",
      "description": "How long-running agents structure what they remember: tiered short-to-long-term cascade, compaction across the window, paging, and reasoning carry-forward across tool calls.",
      "members": [
        {"pattern": "five-tier-memory-cascade", "role": "core"},
        {"pattern": "memgpt-paging", "role": "core"},
        {"pattern": "context-window-packing", "role": "core"},
        {"pattern": "episodic-summaries", "role": "hardening"},
        {"pattern": "cross-session-memory", "role": "hardening"},
        {"pattern": "append-only-thought-stream", "role": "hardening"},
        {"pattern": "reasoning-trace-carry-forward", "role": "optional"}
      ]
    },
    {
      "id": "multi-agent-coordination",
      "name": "Multi-Agent Coordination",
      "description": "Several agents collaborate under a coordinator, with explicit hand-offs and a shared protocol. The shape behind LangGraph supervisor, OpenAI Swarm, AutoGen group chat, Bedrock multi-agent orchestrators.",
      "members": [
        {"pattern": "supervisor", "role": "core"},
        {"pattern": "orchestrator-workers", "role": "core"},
        {"pattern": "handoff", "role": "core"},
        {"pattern": "inter-agent-communication", "role": "core"},
        {"pattern": "subagent-isolation", "role": "hardening"},
        {"pattern": "agent-as-tool-embedding", "role": "optional"},
        {"pattern": "blackboard", "role": "optional"}
      ]
    },
    {
      "id": "safety-hardening",
      "name": "Safety Hardening",
      "description": "The minimum set of constraints to put around any production agent before it touches the world: budgets, gates, charters, kill-switches, approvals.",
      "members": [
        {"pattern": "step-budget", "role": "core"},
        {"pattern": "kill-switch", "role": "core"},
        {"pattern": "approval-queue", "role": "core"},
        {"pattern": "constitutional-charter", "role": "core"},
        {"pattern": "cost-gating", "role": "hardening"},
        {"pattern": "rate-limiting", "role": "hardening"},
        {"pattern": "sandbox-escape-monitoring", "role": "hardening"},
        {"pattern": "refusal", "role": "hardening"},
        {"pattern": "compensating-action", "role": "hardening"},
        {"pattern": "tool-output-poisoning", "role": "optional"}
      ]
    },
    {
      "id": "eval-and-observability",
      "name": "Eval & Observability",
      "description": "How you keep an agent honest in production: harness, judge, decision log, provenance, shadow rollouts.",
      "members": [
        {"pattern": "eval-harness", "role": "core"},
        {"pattern": "eval-as-contract", "role": "core"},
        {"pattern": "decision-log", "role": "core"},
        {"pattern": "agent-as-judge", "role": "hardening"},
        {"pattern": "llm-as-judge", "role": "hardening"},
        {"pattern": "confidence-reporting", "role": "hardening"},
        {"pattern": "provenance-ledger", "role": "hardening"},
        {"pattern": "lineage-tracking", "role": "hardening"},
        {"pattern": "shadow-canary", "role": "optional"}
      ]
    },
    {
      "id": "structured-output-stack",
      "name": "Structured Output Stack",
      "description": "Get typed, schema-conformant data out of the model and verify it. The shape behind Outlines, Instructor, Pydantic AI, DSPy.",
      "members": [
        {"pattern": "structured-output", "role": "core"},
        {"pattern": "tool-use", "role": "core"},
        {"pattern": "dspy-signatures", "role": "optional"},
        {"pattern": "chain-of-verification", "role": "hardening"}
      ]
    },
    {
      "id": "streaming-ux-stack",
      "name": "Streaming UX Stack",
      "description": "User-perceivable real-time output: tokens streamed as they arrive, citations attached as they resolve, the user can stop at any time and the agent can interrupt the user when something matters.",
      "members": [
        {"pattern": "citation-streaming", "role": "core"},
        {"pattern": "stop-cancel", "role": "core"},
        {"pattern": "salience-triggered-output", "role": "hardening"},
        {"pattern": "bidirectional-impulse-channel", "role": "optional"}
      ]
    },
    {
      "id": "planning-loops",
      "name": "Planning Loops",
      "description": "Different ways to structure 'think then act': linear ReAct, plan-then-execute, parallel DAG planning, tree search with backtracking, and the outer/inner planner+executor split.",
      "members": [
        {"pattern": "react", "role": "core"},
        {"pattern": "plan-and-execute", "role": "core"},
        {"pattern": "rewoo", "role": "optional"},
        {"pattern": "llm-compiler", "role": "optional"},
        {"pattern": "lats", "role": "optional"},
        {"pattern": "outer-inner-agent-loop", "role": "optional"},
        {"pattern": "todo-list-driven-agent", "role": "optional"}
      ]
    },
    {
      "id": "routing-and-fallback",
      "name": "Routing & Fallback",
      "description": "How requests get to the right model or specialist and how the system stays up when one upstream breaks. The shape behind LangChain fallbacks, model routers, provider cascades.",
      "members": [
        {"pattern": "routing", "role": "core"},
        {"pattern": "fallback-chain", "role": "core"},
        {"pattern": "circuit-breaker", "role": "hardening"},
        {"pattern": "provider-fallback", "role": "hardening"},
        {"pattern": "graceful-degradation", "role": "hardening"},
        {"pattern": "mixture-of-experts-routing", "role": "optional"},
        {"pattern": "open-weight-cascade", "role": "optional"}
      ]
    },
    {
      "id": "reflection-and-self-correction",
      "name": "Reflection & Self-Correction",
      "description": "Patterns where the model reviews its own work before shipping it: scoped rubric reflection, self-refine, deterministic post-checks, process rewards.",
      "members": [
        {"pattern": "reflection", "role": "core"},
        {"pattern": "reflexion", "role": "core"},
        {"pattern": "self-refine", "role": "core"},
        {"pattern": "frozen-rubric-reflection", "role": "hardening"},
        {"pattern": "inner-critic", "role": "hardening"},
        {"pattern": "deterministic-llm-sandwich", "role": "hardening"},
        {"pattern": "process-reward-model", "role": "optional"},
        {"pattern": "best-of-n", "role": "optional"},
        {"pattern": "chain-of-verification", "role": "optional"}
      ]
    }
  ]
}
