AI Engineering · Mental Model

How Modern AI Systems Fit Together

Think of a production AI application as a 5-layer stack. Click any layer below to jump directly into the matching terms, engineering analogies, and code snippets.

Browse Full Glossary →6-Week Roadmap
05
Reliability Layer
Structured Outputs, Guardrails & Evals

Enforces JSON schemas, validates safety/PII policies, traces latency & cost, and runs automated regression evals before deployment.

Analogy: TypeScript types + CI/CD test suite + Datadog

5 concepts →
04
Action Layer
Tool Calling, AI Agents & MCP

Connects models to external APIs, databases, and workflows via standardized schemas and iterative reasoning loops.

Analogy: Service orchestration + USB-C peripheral bus

5 concepts →
03
Knowledge Layer
Embeddings, Vector DBs & RAG

Indexes proprietary documents into semantic vectors and lexical indices, retrieving and reranking grounded context at query time.

Analogy: Read-only search index + query planner

6 concepts →
02
Working Memory
Tokens & Context Window

Holds system instructions, conversation state, retrieved chunks, and tool schemas inside the model's active attention budget.

Analogy: Process RAM & L1/L2 CPU cache

4 concepts →
01
Compute Layer
LLMs (Gemini, Claude, GPT)

Stateless transformer inference engines predicting tokens conditioned on probabilities, sampling parameters, and weights.

Analogy: Stateless CPU / Inference runtime

3 concepts →