designpattern.fyi

The Blueprint for Modern Software Architecture

A curated catalog of clean, reusable, and interactive design patterns.

"AI can generate the code, but you design the system. Use proven guardrails to cut the bloat, and foundational logic to scale."

Whether you are steering Agentic AI or structuring microservices, stop reinventing the wheel. Master the trade-offs, apply architectural discipline, and build software that lasts.

/
743 Patterns
13 Categories
59 Sub-Categories

Interactive Tools

Practical tools to help you think systematically, build better AI agents, and master prompt engineering.

πŸ€– Agentic AI & Human-in-the-Loop

The Complete Agentic AI Reference

Every aspect of designing, securing, and governing AI agents β€” balancing autonomous execution with human oversight, guardrails, and responsible control at every layer.

Explore Software Engineering Foundations

πŸ›‘οΈ

The Guardrails

SOLID, DRY, YAGNI, KISS, Code Smells, and OWASP Security - principles that keep your code clean, maintainable, and secure.

  • SOLID Principles
  • DRY, YAGNI & KISS
  • Code Smells
  • AI Security Threat Landscape
  • OWASP Security Top 10
  • OWASP LLM Top 10
  • OWASP Agentic AI Top 10
  • OWASP AIVSS
  • OWASP Citizen Development
  • Guardrails ACS

Architectural Primitives for Non-Deterministic Software

Software engineering is shifting from a deterministic paradigm to a probabilistic one β€” two foundational primitives constrain how that non-determinism gets executed

Treating an LLM as a magical black box produces brittle, unscalable code. Instead of deploying a single, massive prompt to handle all logic, high-performance systems decouple execution into a routing layer that picks the cheapest correct path, and a self-correcting validation layer that guarantees type safety before anything reaches downstream systems.

🧭

Semantic Routing

Inbound payloads are evaluated by low-latency, specialized routers using text embeddings or compact, fine-tuned models. The router determines intent and structurally directs the payload to the most cost-effective execution path, isolating simple extraction tasks from deep reasoning workflows and dropping system latency and compute costs.

Inbound Payload β†’ Embedding Router β†’ Cheap Path or Deep Reasoning Path
πŸ”

Validator-Corrector Loops

Rather than wrapping API responses in generic error handling, output parsing is structured as a closed-loop state machine. A deterministic code layer β€” a Pydantic schema validator, for example β€” catches the exact exception, formats it into an atomic correction log, and feeds it back to the model as a targeted system prompt before data updates any downstream system.

LLM Output β†’ Schema Validator β†’ Invalid β†’ Re-prompt β†’ Type-Safe Output

Agentic AI Pattern

πŸ‘οΈ

Perceive

Gather information from the environment through sensors, tools, and inputs

🧠

Plan

Formulate a strategy and break down complex tasks into actionable steps

⚑

Act

Execute planned actions using available tools and capabilities

πŸ”

Observe

Monitor the results of actions and assess their impact on the environment

πŸ”„

Iterate

Refine approach based on observations and continue the cycle until goals are met

πŸ‘οΈ

Perceive

Gather information from the environment through sensors, tools, and inputs

🧠

Plan

Formulate a strategy and break down complex tasks into actionable steps

⚑

Act

Execute planned actions using available tools and capabilities

πŸ”

Observe

Monitor the results of actions and assess their impact on the environment

πŸ”„

Iterate

Refine approach based on observations and continue the cycle until goals are met

Real-World Use Case

Automated B2B Invoice Reconciliation

A price mismatch doesn't have to trigger a generic system failure β€” an agentic loop can resolve it, with a hard checkpoint before anything touches the ledger.

  1. PerceiveIngests the mismatched invoice payload.
  2. PlanDecides it must look up the original Purchase Order and cross-reference vendor contract histories.
  3. ActExecutes internal database lookups via highly restricted API tools.
  4. ObserveIdentifies that a temporary vendor discount was omitted from the invoice text.
  5. HITL GatewayBefore moving to the final iteration to update the ledger, the state machine hits a hard checkpoint. It serializes the agent's complete execution trace into an immutable schema, presents it to a financial auditor for authorization, and freezes execution until explicit human approval is received.

Knowledge Format Specification

Open Knowledge Format (OKF) β€” A minimal, interoperable format for knowledge representation in agentic AI systems

πŸ“¦

Knowledge Bundle

A self-contained directory tree of knowledge documents β€” the unit of distribution. Organizes concepts hierarchically. Preferred distribution is a Git repository (history, attribution, diffs, PR reviews for free).

πŸ“„

Concept

A single unit of knowledge β€” one markdown file. Can represent tables, APIs, metrics, runbooks, or any knowledge unit. File path within the bundle (minus .md) is the Concept ID.

🏷️

Frontmatter

YAML metadata block at the top of each file. Only required field is `type` β€” a free-form string. Consumers must tolerate unknown types gracefully. Additional custom fields are always valid.

πŸ”—

Cross-Linking

Standard markdown links between concepts build the knowledge graph. Prefer absolute bundle-relative paths (/path/to/concept.md) for stability. Broken links are valid β€” link to a not-yet-written concept is not malformed.

πŸ“‹

Index & Log Files

Reserved filenames with defined meaning. index.md provides progressive disclosure of available concepts. log.md tracks chronological change history (newest first, ISO 8601 dates). Both can appear at any directory level.

Agent Knowledge Packaging

Agent Skills β€” Portable, version-controlled packages of specialized knowledge for AI agents

πŸ“

Skill Structure

A folder with SKILL.md (required), plus optional scripts/, references/, and assets/ directories. The directory name must exactly match the name field in frontmatter.

πŸ”„

Progressive Disclosure

Three-level loading system: Discovery (~100 tokens at startup), Activation (<5,000 tokens on-demand), Execution (on-demand). Install 50 skills for only ~5,000 tokens startup cost.

πŸ“

SKILL.md

The heart of every skill. YAML frontmatter contains name and description (the semantic trigger). Body contains instructions, gotchas, checklists, and validation loops. Keep under 5,000 tokens.

⚑

Scripts Directory

Executable code for deterministic operations. The agent runs tested code instead of regenerating it each session. Scripts accept CLI args, emit structured JSON, never consume context until called.

πŸ“š

References Directory

Deep documentation loaded on-demand. Each file focuses on one topic. Tell the agent exactly when to load each file in SKILL.md. Heavy reference docs never touch context unless called.

🌐

Ecosystem

Open standard at agentskills.io (Dec 2025) adopted by Claude, Cursor, GitHub Copilot, Gemini CLI, and 20+ platforms. 1,525+ community skills via Antigravity library. Official repos from Notion, Vercel, Supabase, Microsoft.

Agent Persistent Context

Agent Memory β€” Multi-tiered persistent context retention and state management for autonomous AI agents

⚑

Working Memory

Immediate in-context workspace (the active context window). Ephemeral, fast, and token-bounded. Holds the current conversation thread, active tool outputs, and short-term reasoning traces.

πŸ“œ

Episodic Memory

A timestamped record of specific experiences, user interactions, and decisions. Preserves instance-specific contexts (the who, what, when, and why) to prevent loss of task continuity across session boundaries.

🧠

Semantic Memory

Abstracted, generalized facts, domain concepts, organizational rules, and user preferences. Evolved and updated over time with active conflict resolution to maintain factual consistency.

βš™οΈ

Procedural Memory

Standard operating procedures, routing workflows, coding standards, and skill sets (such as SKILL.md libraries). Allows the agent to execute complex rules automatically without reasoning from scratch.

πŸ•ΈοΈ

Vector & Graph Stores

The physical execution layer. Vector stores handle fast fuzzy semantic similarity, while temporal graph stores manage entity relationships and multi-hop reasoning over time.

Loop Engineering

Design autonomous systems that prompt AI agents β€” replacing manual prompting with recursive, goal-driven architectures

⏰

Automations

Heartbeat loops, cron schedules, and goal-driven execution that surface work automatically

🌳

Worktrees

Git worktrees for parallel agent isolation, preventing file collisions in concurrent workflows

πŸ“š

Skills

Codified project knowledge that compounds understanding across sessions

πŸ”Œ

Connectors

MCP-based plugins for real tool integration β€” issue trackers, databases, APIs, and Slack

πŸ€–

Subagents

Separate maker from checker β€” specialized agents for exploration, implementation, and verification

πŸ’Ύ

State/Memory

Persistent memory that remembers what was tried and what remains across sessions

AI Token Economy

From first principles to full production β€” every layer of cost, craft, and strategy in the age of agentic AI

πŸ’°

Token Economics

Understand the atomic unit of AI work and how pricing models impact your bottom line

⚑

Cost Optimization

Prompt engineering, context management, and caching strategies to reduce token usage by 30-50%

🏒

Enterprise Strategy

Vendor selection, TCO analysis, and building internal AI expertise for scalable adoption

πŸ“Š

Risk Management

Cost monitoring, quality controls, and governance frameworks for production AI systems

Optimizing Token Usage Practices

Three-layer reference for token optimization across AGENTS.md, CLAUDE.md and friends across five coding agent tools

βš™οΈ

Layer 1: Agent/Platform Mechanics

System-level configuration: prompt caching, MCP setup, toolset scope, and model routing

🎯

Layer 2: Agent Operation

Session discipline: subagent delegation, compaction strategy, and usage monitoring

πŸ—οΈ

Layer 3: Codebase Architecture

Code organization: SRP, coupling, file size, and hierarchical structure for minimal context

πŸ› οΈ

Tool-Specific Guides

Implementation patterns for Claude Code, Codex CLI, Antigravity CLI, Devin CLI, and Cursor

Data Protection & Privacy

Masking, Anonymization, Tokenization, Pseudonymization, PII Redaction, and Synthetic Data Generation β€” with pre/post LLM hooks and agent-native implementation patterns

🎭

Masking ↩️ Reversible

Replace sensitive values with structurally consistent placeholders while preserving format for testing and analytics

πŸ”’

Anonymization πŸ”’ Irreversible

Irreversible removal or transformation of personal data so individuals cannot be re-identified, even with additional sources

πŸ”‘

Tokenization ↩️ Reversible

Replace sensitive values with random tokens stored in a secure vault, enabling controlled reversibility and strong compliance

🏷️

Pseudonymization ↩️ Reversible

Replace identifiers with artificial aliases while maintaining separate keys for re-identification under strict governance

🚫

PII Redaction πŸ”’ Irreversible

Permanent, irreversible removal of sensitive information from documents, ideal for legal publishing and erasure requests

πŸ§ͺ

Synthetic Data

Generate statistically faithful test data with zero real PII exposure for prompt engineering, QA, and model training

Agentic Resource Discovery

ARD β€” An open, federated specification for publishing, discovering, and cryptographically verifying AI capabilities across organizational boundaries

πŸ“‹

Catalogs

Static JSON manifest files (ai-catalog.json) hosted at your organization's domain at a well-known path. Domain ownership becomes the cryptographic foundation for identity and trust.

πŸ”

Registries

Searchable, dynamic services that crawl published catalogs, index their entries, and expose a REST search API. Registries are the 'search engines' of the agentic web.

🏷️

URN Identifiers

Globally unique identifiers following the format urn:ai:<publisher>:<namespace>:<agent-name>. Domain-anchored format provides nomenclature stability and cross-network uniqueness.

πŸ”

Trust Manifest

Cryptographic identity and compliance metadata. Separates discovery identifier (URN) from runtime authentication identity (SPIFFE ID, DID, or HTTPS FQDN).

⚑

REST API

Standard HTTP REST interface for search. POST /search for semantic search, POST /explore for faceted aggregation. Universal baseline enables federation between registries.

🌐

Federation

Connect individual registries into a global network. Client controls federation mode: auto (registry merges results), referrals (client follows), or none (single registry only).

Fleet Engineering

The emerging discipline of managing large-scale deployments of autonomous AI agents as a unified operational system β€” from orchestration to observability

🎯

Orchestration Layer

The control plane responsible for task decomposition, agent selection, dependency management, and state tracking. Frameworks include LangGraph, Microsoft AutoGen, and Anthropic's multi-agent patterns.

πŸš€

Deployment & Versioning

Prompt versioning tracked in version control with testing before promotion. Model versioning for different agent types. Blue/green or canary deployments for safe rollouts.

πŸ“Š

Observability & Monitoring

Purpose-built tooling for tracing full reasoning chains, tool calls, and agent handoffs. Span and step logging, latency/cost tracking, and automated evaluation metrics at runtime.

⚑

Resource & Rate Limit Management

API rate limit management with backoff and retry logic. Compute scheduling for parallel execution. Token budget allocation and cost attribution per agent/team/task.

πŸ”„

Agent Lifecycle Management

Spawning, execution, checkpointing, termination, and failure recovery. Long-running agents save intermediate states for resumption after interruption.

πŸ‘€

Human-in-the-Loop Checkpoints

Explicit checkpoints for human review before irreversible actions, low-confidence decisions, scope changes, and scheduled audits for long-running agents.

πŸ”’

Security & Isolation

Prompt injection defense with input sanitization. Principle of least privilege for tool access. Agent sandboxing in isolated containers/VMs. Comprehensive audit trails.

βœ…

Evaluation & Quality Assurance

Unit evaluation with standardized benchmarks. Integration evaluation for multi-agent pipelines. Online evaluation with automated scoring. Regression testing before deployments.

☸️

Cloud Native Ecosystem

Leveraging Kubernetes, containers, service meshes, and cloud-native observability stacks as the infrastructure layer for AI agent fleets. Includes orchestration, scaling, security, and GitOps patterns.

Explainable AI (xAI)

Building institutional-grade xAI frameworks for advanced LLM agents in regulated environments β€” from thinking traces to memory observability

πŸ”

Thinking Traces

Capture Chain-of-Thought reasoning paths for safety monitoring and goal drift detection in clinical decision support

🧠

Memory Observability

Audit multi-tier memory operations to track context provenance and prevent error propagation across clinical workflows

πŸ“Š

Trajectory Diagnostics

Move beyond feature attribution to audit complete execution graphs for regulatory compliance and clinical validation

βœ…

Causal Validation

Automated counterfactual evaluation to verify that captured reasoning is causally linked to clinical outcomes

AI Adoption Guiding Principles

A strategic framework for AI adoption from traditional machine learning to agentic AI in healthcare, airlines, and insurance

πŸ“Š

Traditional ML

Structured prediction & inference β€” answering "What is likely to happen?"

πŸ€–

Generative AI

Language understanding & generation β€” answering "What should this look like?"

🎯

Agentic AI

Autonomous multi-step orchestration β€” answering "What should I do next?"

πŸ₯

Healthcare

Clinical risk scoring to autonomous care coordination and prior authorisation workflows

✈️

Airlines

Revenue management to dynamic mass disruption re-accommodation and autonomous turnaround orchestration

πŸ›‘οΈ

Insurance

Actuarial pricing to autonomous subrogation recovery and straight-through claims processing

Scaling Agentic AI in Healthcare Lakehouse

Cloud-agnostic healthcare architecture for scaling autonomous AI agents across enterprise data platforms β€” from Bronze to Platinum layers

πŸ₯

5-Tier Medallion

Bronze to Platinum architecture for raw ingest, operational state, analytics, semantic spine, and agent control plane

πŸ”

Privacy Hooks

Pre-LLM and Post-LLM hooks for PII redaction, tokenization, pseudonymization, masking, and synthetic data generation

πŸ”„

HITL & Autonomous

Dynamic orchestration between fully autonomous execution and human-in-the-loop clinical guardrails

☁️

Cloud-Agnostic

Kubernetes-native deployment across AWS, Azure, GCP, OpenShift, and on-premises without vendor lock-in

Ontological Engineering in AI

Formal, machine-checkable models of concepts, relationships, and constraints for grounding agentic AI systems and LLMs

πŸ—οΈ

Formal Ontologies

Building, validating, and maintaining reusable, verifiable artifacts using RDF, OWL, and SHACL schemas.

🧠

Neuro-Symbolic AI

Combining statistical language fluency with symbolic precision for accountability and provenance.

πŸ•ΈοΈ

Knowledge Graphs

Grounding LLMs on verified relational context via GraphRAG, MemGraphRAG, and semantic layers.

πŸ€–

LLM-Augmented

Bootstrapping term extraction and relation mapping using multi-agent specialization pipelines.

Securing AI Agents

Google DeepMind's comprehensive framework for defending systems against potentially misaligned AI agents

πŸ›‘οΈ

AI Control Roadmap

A tiered, measurable framework for defending systems against misaligned agents

βš–οΈ

Gram Framework

Empirical evaluation framework for measuring sabotage propensity in models

🌐

Three Layers of Security

A framework to secure the entire agent ecosystem from deployment to market governance

βš›οΈ AI for Physical Science Β· SandboxAQ Β· July 2026

Large Quantitative Models (LQMs)

Neural networks trained on lab data and scientific equations β€” computing real-world numerical outcomes instead of generating language. The emerging layer beneath reasoning LLMs in enterprise AI stacks.

πŸ”¬

What LQMs Are

Physics-grounded models for precise numerical prediction

⚑

Physics-Grounded Data

Trained on quantum chemistry, molecular dynamics, and microkinetics β€” not internet text

πŸ“

Numerical Precision

Predicts adsorption energy, binding affinity, and toxicity risk with scientific accuracy

πŸ”—

LLM Tool Integration

Called as tools via MCP β€” reasoning LLMs (Claude, Gemini) orchestrate at the interface layer

πŸ“¦

Model Catalog

SandboxAQ's shipping LQMs β€” biopharma, materials & catalysis

πŸ§ͺ

AQCat Β· Catalysis

Adsorption-energy screening β€” live via Claude MCP; Google Cloud Marketplace Q3 2026

πŸ’Š

AQPotency Β· Drug Discovery

High-throughput drug-binder identification β€” Google Cloud Marketplace Q3 2026

🧬

AQCell Β· Cell Biology

Simulates cell response to drug candidates; flags liver toxicity and pathway activation

🏁

The Frontier Lab Race

Three labs, three strategies for AI in physical science

🟣

Anthropic Β· Claude Science

LQMs via MCP + 60+ scientific databases + sub-agent orchestration (June 30, 2026)

πŸ”΅

Google Β· Gemini for Science

Co-Scientist, AlphaFold, AlphaGenome + SandboxAQ LQMs via Cloud Marketplace

🟒

OpenAI Β· GPT-Rosalind

Fine-tuned LLM for life sciences reasoning β€” genomics, drug discovery, LifeSciBench

πŸ—οΈ

Enterprise Architecture Pattern

How LQMs slot into agentic AI platform stacks

πŸ—£οΈ

Reasoning Interface Layer

LLM (Claude, Gemini, GPT) handles natural-language orchestration and decision-making

βš™οΈ

Domain-Grounded Compute Tier

LQMs provide physics- or domain-constrained numerical ground-truth via MCP tool calls

⚠️

Open Challenges

Interpretability in regulated domains and data drift from abrupt physical-system shifts

πŸ“Š Enterprise AI Β· Zero-Shot Tabular Prediction Β· July 2026

Tabular Foundation Models (TFMs)

Zero-shot foundation models for spreadsheets and database tables β€” no per-dataset training, no hyperparameter tuning, no feature engineering. The next frontier of enterprise AI infrastructure.

🎯

What TFMs Are

Zero-shot prediction on structured tabular data

⚑

In-Context Learning

Models see the entire table as a single prompt and predict in one forward pass

πŸ”—

Alternating Attention

Row/column cross-attention respects tabular structure β€” orderless by design

πŸ—„οΈ

SQL-Native Distribution

Embedded directly in databases (BigQuery, Redshift, SAP HANA) as AI.PREDICT verbs

πŸ“¦

Model Catalog

Production TFMs from hyperscalers and enterprise vendors

πŸ”΅

Google Β· TabFM

Hybrid TabPFN + TabICL architecture; BigQuery AI.PREDICT integration (June 2026)

🟠

Amazon Β· Mitra

Bundled in AutoGluon; benchmarked on TabArena, TabRepo, TabZilla

🟒

SAP Β· RPT-1 / RPT-1.5

Trained on real enterprise data with semantic embeddings; €1B+ Prior Labs acquisition

🏁

Competitive Landscape

Hyperscalers vs. frontier labs: two different paradigms

🏒

Database-Embedded TFMs

Google, AWS, Microsoft, SAP β€” own the data platform, ship native SQL predictors

πŸ€–

Agentic Code Execution

Anthropic & OpenAI: LLMs write/run pandas/scikit-learn code instead of specialized models

πŸ”¬

Research Lineage

TabPFN (2022) β†’ TabICL (2025) β†’ TabFM (2026); SAP's ConTextTab adds semantic knowledge

πŸ—οΈ

Enterprise Architecture Impact

How TFMs reshape ML infrastructure and data readiness

βš™οΈ

MLOps Compression

Multi-day hyperparameter sweeps β†’ single API call; democratizes predictive modeling

πŸ“Š

Data Readiness Bottleneck

Shifts from model quality to data-platform quality: schema governance, lineage, semantic layers

πŸ”„

Convergence Pattern

LLMs orchestrate TFMs as tools via MCP β€” natural division of labor between reasoning and prediction

Software Engineering Playbooks

Practical, End-to-End implementation guides for building Production-ready Software. Each playbook includes working code, architecture diagrams, and step-by-step instructions.

πŸ€–

Research Agent with Gateway

Build a production-ready AI research agent using Agent Gateway for unified traffic management, authentication, and observability across LLM providers.

Agent Gateway A2A Protocol Multi-Agent
πŸ”—

RAG Pipeline with Vector Database

Implement a complete Retrieval-Augmented Generation pipeline with vector embeddings, semantic search, and context injection for accurate AI responses.

RAG Vector DB Embeddings
πŸ”„

Multi-Agent Orchestration

Create a coordinated multi-agent system with specialized agents, task distribution, and result synthesis for complex problem-solving.

Orchestration Task Distribution Synthesis
1 / 2

Future References

Explore these resources for deeper learning on AI agent development, spec-driven development, and prompt engineering tools.

Spec-Driven Development

Comprehensive guide on Spec-Driven Development practices and methodologies.

Awesome Copilot

Curated list of GitHub Copilot resources, extensions, and best practices.

Promptfoo

Tool for testing, evaluating, and improving LLM prompts and applications.

Prompts.chat

Collection of prompt engineering resources and templates.

Agent Skills

Agent skills resources and documentation for building AI agent skills.

Awesome Skills

Curated list of awesome skill repositories and collections.

Agent Skills Topic

GitHub topic for discovering agent-related skills and repositories.

AI Agent Topic

Trendshift topic for discovering AI agents.

AI Skills Topic

Trendshift topic for discovering AI skills.

Agent Governance Toolkit

Agent governance toolkit.

Pattern Sources

Our patterns are curated from industry-leading sources with proper attribution and licensing compliance.

Refactoring.Guru

Classic GoF design patterns, code smells catalog, and refactoring techniques (https://refactoring.guru).

Enterprise Integration Patterns

65 messaging patterns for integrating enterprise applications by Gregor Hohpe and Bobby Woolf (CC BY 4.0).

Microservices.io

Comprehensive patterns for microservice architectures by Chris Richardson.

Agent Catalog Patterns

Patterns for agentic systems from agentpatternscatalog.org (CC BY 4.0).

OWASP Foundation

Security patterns from OWASP Top 10 for Web Applications, LLM Applications, and Agentic Applications (CC BY-SA 4.0).

Industry Research

ML/AI patterns from Microsoft, Google, Anthropic, and academic research.

AI Agent Patterns

Spec-driven development patterns from Claude, Gemini, OpenAI, and GitHub Copilot on github/spec-kit and OpenSpec.

Data Engineering Leaders

Data platform patterns from Martin Fowler (Data Mesh), Kimball Group (Dimensional Modeling), and cloud providers.

MLOps Best Practices

Data science patterns from MLflow, Great Expectations, and MLOps practitioners.

Streaming & Analytics

Real-time patterns from Confluent/Kafka, Apache projects, and serverless analytics platforms.

Academic Papers

Rigorous ML patterns from peer-reviewed research including data leakage prevention and active learning.

5-Day AI Agents Course

Intensive Vibe Coding Course With Google by Brenda Flynn et al. (2026) on Kaggle.

The Agent Loop

Foundational Agent Definition (Perceive + Act):
Russell, S. J., & Norvig, P. (1995). Artificial Intelligence: A Modern Approach. Prentice Hall. (Current edition: 4th Ed., Pearson, 2020)

Modern Iterative LLM Agent Loop:
Yao, S., Zhao, J., Yu, D., et al. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629.

Historical Context:
Incorporating AIMA's perceive/act model, Classical robotics' Sense-Plan-Act loop (Brooks, 1986), and ReAct's Thought→Action→Observation cycle.

Glossary A-Z Index

Quick navigation to agentic AI terminology and concepts