🤖 AI-first catalog

Pattern Library

AI agent patterns, ML system architectures, and the classic foundations that power them — each with diagrams, working code, and interview prep.

0 / 58 learned

Explore patterns with diagrams, analogies, and code examples.

🔮 Emerging — 2026 & Beyond

Frontier patterns shaping AI engineering in 2026 and beyond — reasoning, multimodal, observability, and production ops

10 patterns
emergingadvanced

Harness Engineering

Design the execution environment, permissions, context budget, and constraints that make AI agents reliable in production — Agent = Model + Harness.

harnessexecution-environment
10 min
emergingintermediate

MCP (Model Context Protocol)

A universal open standard that lets AI agents connect to any tool, data source, or service through a single, consistent interface — the USB-C of AI integrations.

mcptool-use
11 min
emergingadvanced

Tree of Thought

Explore multiple reasoning branches simultaneously, evaluate them, and prune dead ends — like a chess engine for language.

reasoningplanning
7 min
emergingintermediate

Self-Consistency

Sample many independent reasoning paths and vote on the most common answer — reliability through redundancy.

reasoningensemble
6 min
emergingadvanced

Computer Use Agent

An LLM that perceives the screen, decides what to click or type, and executes actions — operating software like a human would.

agentui
6 min
emergingintermediate

LLM Observability

Trace every prompt, token, tool call, and cost in your AI pipeline — so you can debug, optimize, and trust what's running in production.

observabilitytracing
7 min
emergingintermediate

Evals-as-Code

Define, run, and version your LLM quality tests in code — so every model or prompt change is evaluated automatically before it ships.

evaluationtesting
8 min
emergingintermediate

Semantic Cache

Cache LLM responses by meaning, not exact text — so 'What's the refund policy?' and 'How do I get a refund?' both hit the same cached answer.

cachingperformance
7 min
emergingintermediate

Vision-Language Pattern

Ground language understanding in visual context — letting models see, describe, reason about, and act on images alongside text.

multimodalvision
6 min
emergingintermediate

Prompt Caching

Cache expensive prompt prefixes server-side so repeated context isn't re-processed on every request.

cachingcost-optimization
8 min

🤖 AI & Agents

How LLMs reason, act, remember, and collaborate in production

18 patterns
AI agentintermediate

Agent Handoffs

One agent transfers full conversational control to a specialized peer — the receiving agent takes over completely, with context, not just a subtask.

handoffsdelegation
9 min
AI agentbeginner

RAG

Prevent hallucinations and stale answers by retrieving real, relevant documents before the LLM generates a response.

retrievalgrounding
8 min
AI agentbeginner

Chain of Thought

Break down complex problems into step-by-step reasoning to improve answer quality.

reasoningstep-by-step
7 min
AI agentintermediate

ReAct

Combine reasoning and action: think through steps and execute tools to solve tasks.

reasoningaction
6 min
AI agentintermediate

Tool Use

Give LLMs the ability to call real functions — search the web, run code, query databases, and interact with APIs autonomously.

function-callingtools
9 min
AI agentadvanced

Multi-Agent

Coordinate multiple specialized agents working together to solve complex problems.

orchestrationspecialization
5 min
AI agentintermediate

Reflection

Generate, critique, and refine outputs iteratively to improve quality.

self-critiqueiterative-refinement
5 min
AI agentintermediate

Memory

Maintain context across interactions using short-term and long-term memory systems.

contextstate-management
5 min
AI agentintermediate

Guardrails

Validate inputs and outputs to ensure safety, quality, and compliance.

safetyvalidation
5 min
AI agentbeginner

Structured Output

Constrain LLM responses to a schema so downstream code can reliably parse and act on them.

json-modeschema
6 min
AI agentintermediate

Human-in-the-Loop

Pause agent execution and hand off to a human when confidence is low, stakes are high, or an action is irreversible.

safetyoversight
6 min
AI agentintermediate

Router

Classify incoming requests and direct them to the best-fit model, agent, or handler.

routingclassification
7 min
AI agentbeginner

Prompt Template

Separate prompt structure from dynamic content to build reusable, testable, and versionable LLM instructions.

promptingtemplates
7 min
AI agentintermediate

Context Management

Keep what's relevant in the limited context window and evict the rest — without losing coherence.

context-windowmemory
7 min
AI agentintermediate

Scatter-Gather

Fan out a task to multiple agents or tools in parallel, then synthesize their results into a single answer.

parallelismorchestration
7 min
AI agentintermediate

Fallback

Gracefully degrade when a model or tool fails — retry, switch providers, or return a safe default.

resiliencereliability
8 min
AI agentadvanced

Orchestrator-Worker

One coordinator plans and delegates; many stateless workers execute — then results flow back up.

orchestrationdelegation
8 min
AI agentbeginner

Streaming

Emit LLM tokens to the client as they're generated — don't wait for the full response.

ssestreaming
8 min

🏗️ ML Systems

How production ML systems are built, versioned, and monitored

8 patterns

🧱 Foundations — Creational

How objects are created — used in LLM clients, pipelines, and registries

5 patterns

🧱 Foundations — Structural

How objects are composed — used in AI API wrappers and middleware

7 patterns

🧱 Foundations — Behavioral

How objects communicate — used in agent callbacks and event systems

10 patterns
behavioralintermediate

Chain of Responsibility

Pass a request along a chain of handlers. Each handler decides either to process the request or pass it along the chain

handler-chainrequest-passing
6 min
behavioralintermediate

Command

Encapsulate a request as an object, allowing you to parameterize clients with different requests, queue them, and log them

encapsulationundo-redo
6 min
behavioralbeginner

Iterator

Provide a way to access the elements of an object sequentially without exposing its underlying representation

sequential-accessencapsulation
5 min
behavioralintermediate

Mediator

Define an object that encapsulates how a set of objects interact

centralized-controldecoupling
6 min
behavioralintermediate

Memento

Capture and externalize an object's internal state without violating encapsulation, allowing it to be restored later

state-captureundo-redo
6 min
behavioralbeginner

Observer

Define a one-to-many dependency where when one object changes state, all its dependents are notified automatically

event-drivenpublish-subscribe
4 min
behavioralintermediate

State

Allow an object to alter its behavior when its internal state changes

state-machinebehavior-modification
6 min
behavioralbeginner

Strategy

Define a family of algorithms, encapsulate each one, and make them interchangeable

interchangeablealgorithms
5 min
behavioralbeginner

Template Method

Define the skeleton of an algorithm in a base class, deferring some steps to subclasses

algorithm-structureinheritance
5 min
behavioraladvanced

Visitor

Represent an operation to be performed on elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates

double-dispatchoperation-separation
7 min