Visual Reference

Software Architecture

Visual reference for the architectural patterns that underpin AI systems - from RAG pipelines to agent loops, event-driven designs, and microservices.

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.

User Query
Embedder
Vector DB
Context
LLM

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.

Goal
loop
Reason
Act
Result

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.

Ingest
source
Transform
AI step
Validate
gate
Load
sink

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.

Producer A
Producer B
Event Bus
AI Consumer
Log Consumer

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.

API Gateway
LLM Svc
Embed Svc
Search Svc

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.

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

SOLID Principles

Single responsibility, Open/closed, Liskov substitution, Interface segregation, Dependency inversion.

DDD

Domain-Driven Design

Model software around the business domain. Ubiquitous language, bounded contexts, aggregates.

CAP

CAP Theorem

Distributed systems can guarantee only two of: consistency, availability, partition tolerance.

DRY

Don't Repeat Yourself

Every piece of knowledge must have a single, authoritative representation in a system.

12F

Twelve-Factor App

A methodology for building portable, scalable software-as-a-service applications.

YAGNI

You Aren't Gonna Need It

Don't add functionality until it is needed. Keeps codebases lean and easier to change.

PoLP

Principle of Least Privilege

Every component should have the minimum access rights needed to perform its function.

CQS

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.