Patterns
Software design and architecture patterns explained with real, runnable examples.
203 results
Agent Tool Selection Pattern
Dynamically select which tools an LLM agent can use based on the task context. Reduce token usage...
Embedding Cache Pattern
Cache LLM embeddings to reduce API calls and cost. Store embeddings with a content hash key and...
Human-in-the-Loop Pattern
Pause LLM agent execution for human approval before high-impact actions. Route decisions to a...
LLM Fallback Pattern
Fall back to alternative LLM providers or models when the primary fails. Handle rate limits,...
LLM Guardrails Pattern
Validate LLM inputs and outputs with rules, classifiers, and content filters. Prevent prompt...
LLM Router Pattern
Route queries to different LLM models based on complexity, cost, and latency requirements. Classify...
Prompt Chaining Pattern
Chain multiple LLM calls where each step's output feeds the next step's input. Break complex tasks...
RAG Hybrid Search Pattern
Combine keyword (BM25) and semantic (vector) search to improve retrieval accuracy in RAG pipelines....
Ambassador: Offload Cross-Cutting Concerns to a Proxy
How to offload cross-cutting concerns to a proxy ambassador. Covers connection pooling, retry...
Anti-Corruption Layer: Isolate Legacy with Adapters
How to isolate legacy systems with translation adapters. Covers ACL facade, domain translation,...
Backends for Frontends: Dedicated Backend per Client Type
How to create dedicated backends per client type. Covers BFF for web, mobile, and desktop. Covers...
Compute Resource Consolidation Pattern
Combine workloads into fewer compute resources to reduce cost, improve utilization, and simplify...
External Configuration Store Pattern
Centralize application configuration outside of deployment artifacts to support live updates and...
Gateway Routing Pattern
Route requests to multiple backend services through a single entry point that handles cross-cutting...
Health Endpoint Monitoring Pattern
Expose lightweight health endpoints so orchestrators, load balancers, and monitoring tools can...
Leader Election Pattern
Coordinate a single active instance among multiple distributed nodes to avoid conflicts and...
Modular Monolith: Single Deployable with Module Boundaries
How to build a modular monolith with strict internal module boundaries. Covers module isolation,...
Multi-Tenant Data Isolation Pattern
Isolate tenant data in shared infrastructure using row-level security, schema-per-tenant, or...
Pipes and Filters Pattern: Composable Data Pipelines
Chain processing steps with independent filters connected by pipes. A pattern for data...
Sidecar Pattern: Extend Services with Companion Containers
How to extend services with companion containers for cross-cutting concerns. Covers sidecar...
No results found.