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.
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
Connects models to external APIs, databases, and workflows via standardized schemas and iterative reasoning loops.
Analogy: Service orchestration + USB-C peripheral bus
Indexes proprietary documents into semantic vectors and lexical indices, retrieving and reranking grounded context at query time.
Analogy: Read-only search index + query planner
Holds system instructions, conversation state, retrieved chunks, and tool schemas inside the model's active attention budget.
Analogy: Process RAM & L1/L2 CPU cache
Stateless transformer inference engines predicting tokens conditioned on probabilities, sampling parameters, and weights.
Analogy: Stateless CPU / Inference runtime