Software Architecture
Visual reference for the architectural patterns that underpin AI systems - from RAG pipelines to agent loops, event-driven designs, and microservices.
Common patterns
Architecture patterns for AI systems
These five patterns cover the majority of production AI architectures. Each card shows a simplified diagram and the contexts where that pattern fits best.
Retrieval-Augmented Generation (RAG)
Ground LLM responses in your own data. Queries are embedded, matched against a vector store, and retrieved context is injected into the prompt before generation.
Agent Loop Pattern
An LLM iteratively reasons about a goal, calls tools to take actions, observes the results, and continues until the goal is satisfied or a stop condition is reached.
AI Pipeline Pattern
Data flows linearly through a sequence of processing steps - ingestion, AI enrichment, validation gates, and loading into a destination store. Each step has a single responsibility.
Event-Driven AI Pattern
Events published to a central bus trigger AI processing consumers. Producers and consumers are decoupled - either side can scale or change independently.
Microservices AI Pattern
AI capabilities are exposed as independent services behind an API gateway. Each service owns one responsibility and scales independently - typical for larger AI platforms.
Building blocks
Software foundations
Architecture decisions only work when the underlying engineering is solid. These are the foundational topics every AI system builder needs.
Version Control
Git workflows for AI projects including prompt versioning, dataset tracking, and experiment branches.
Testing Strategy
How to test AI components - unit, integration, and evaluation-based testing for LLM outputs.
CI/CD Pipelines
Automated build, test, and deploy pipelines for AI services including model evaluation gates.
Security Principles
Prompt injection, data leakage, and access control patterns specific to AI systems.
API Design
RESTful and async API patterns for exposing AI services reliably - retries, streaming, rate limiting.
Observability
Structured logging, tracing, and metrics for AI systems - what to monitor and how to debug failures.
Cloud and Infra
Serverless, containers, and cloud services for running AI workloads - from dev to production.
Tool Comparisons
Side-by-side analysis of vector DBs, LLM platforms, orchestration frameworks, and cloud services.
Timeless principles
Core design principles
These principles predate AI but apply directly to AI system design. They are the vocabulary architects use when reviewing each other's work.
SOLID Principles
Single responsibility, Open/closed, Liskov substitution, Interface segregation, Dependency inversion.
Domain-Driven Design
Model software around the business domain. Ubiquitous language, bounded contexts, aggregates.
CAP Theorem
Distributed systems can guarantee only two of: consistency, availability, partition tolerance.
Don't Repeat Yourself
Every piece of knowledge must have a single, authoritative representation in a system.
Twelve-Factor App
A methodology for building portable, scalable software-as-a-service applications.
You Aren't Gonna Need It
Don't add functionality until it is needed. Keeps codebases lean and easier to change.
Principle of Least Privilege
Every component should have the minimum access rights needed to perform its function.
Command Query Separation
Methods that change state should not return data. Methods that return data should not change state.
See patterns in action
Architecture only makes sense in context. Explore how these patterns are applied in production solutions across different industries.