Phase 5 of 7 · 16 topics
AI engineering
Turn foundation models into real products: retrieval, evaluation, agents and deployment. This is the core of most AI engineer jobs.
Phases 1 to 4 teach you how the engine works. Phase 5 teaches you to build the car around it: steering (prompts), fuel (data and retrieval), a dashboard (evaluation) and brakes (safety).
Core resources for this phase
-
Book
AI Engineering (Chip Huyen) Paid
The main text for this phase.
-
Blog
Your AI Product Needs Evals (Hamel Husain) Free
The clearest guide to evaluation, the most important AI engineering skill.
-
Course
Made With ML (Goku Mohandas) Free
Takes a model to production: testing, serving, CI/CD.
Topics, in order
-
5.1 Prompting: clear instructions, examples, structured output
-
Read
Claude docs
Worth it: The official guide, with concrete before-and-after prompts for clarity, examples, structure and long documents. Practical and short.
-
Read
AI Engineering, Ch 5 (prompt engineering)
Chip Huyen · book you own
-
Read
-
5.2 Structured outputs and function calling
-
Read
Claude docs
-
Read
json-schema.org
-
Read
AI Engineering, Ch 2 (sampling and structured outputs)
Chip Huyen · book you own
-
Read
-
5.3 Embeddings and semantic search
-
Watch
Cosine Similarity, Clearly Explained
StatQuest (Josh Starmer)
-
Read
Embeddings: What they are and why they matter
Simon Willison
Worth it: A clear, practical tour of embeddings with real examples of related-content search, clustering and code. The best single read on using them.
-
Read
Sentence Transformers docs
-
Watch
-
5.4 Vector databases and approximate nearest-neighbour search
-
Read
Hierarchical Navigable Small Worlds (HNSW)
Pinecone Learn · illustrated
Worth it: Clear diagrams of the layered graph and the greedy search, plus how the tuning knobs change speed and recall.
-
Code
Meta AI · GitHub wiki
-
Paper
Efficient and robust approximate nearest neighbor search using HNSW graphs (2016)
Malkov and Yashunin · arXiv · optional
-
Read
-
5.5 RAG: chunking, retrieval and re-ranking
-
Read
Introducing Contextual Retrieval
Anthropic
Worth it: Shows, with measured results, why chunks lose context and how adding context plus hybrid search and re-ranking cuts retrieval failures. Directly useful for building RAG.
- Read
-
Read
AI Engineering, Ch 6 (RAG and agents)
Chip Huyen · book you own
-
Read
-
5.6 Context engineering: long context and memory
-
Read
Effective context engineering for AI agents
Anthropic
Worth it: A practical guide to treating context as a limited budget: what to keep, compact, retrieve just in time, and hand to sub-agents. Written for building real agents.
-
Read
AI Engineering, Ch 5 (context length and context efficiency)
Chip Huyen · book you own
-
Paper
Lost in the Middle: How Language Models Use Long Contexts (2023)
Liu et al. · arXiv · optional
-
Read
-
5.7 Evaluation: test sets, LLM-as-judge, error analysis
-
Read
Hamel Husain
Worth it: The most practical guide to evaluating LLM products: unit-test-style checks, LLM judges, and reading traces, from real client work.
- Read
-
Read
AI Engineering, Ch 3–4 (evaluation)
Chip Huyen · book you own
-
Read
-
5.8 Agents and tool use
-
Read
Anthropic
Worth it: Clear diagrams of the main patterns, from simple workflows to full agents, with advice on when each is worth it. The best starting point for building agents.
-
Read
Lilian Weng
-
Read
AI Engineering, Ch 6 (the agents half)
Chip Huyen · book you own
-
Read
-
5.9 MCP: connecting models to tools and data
-
Read
Introduction to the Model Context Protocol
modelcontextprotocol.io
Worth it: The official docs, with architecture diagrams and quick-starts for building a server and a client. Short, clear, and exactly what you need to build your own.
-
Read
Introducing the Model Context Protocol
Anthropic
-
Code
GitHub
-
Read
-
5.10 Choosing between prompting, RAG and fine-tuning
-
Read
AI Engineering, Ch 7 (finetuning: when to finetune)
Chip Huyen · book you own
- Read
-
Read
-
5.11 Dataset engineering for fine-tuning
-
Read
AI Engineering, Ch 8 (dataset engineering)
Chip Huyen · book you own
-
Paper
LIMA: Less Is More for Alignment (2023)
Zhou et al. · arXiv · optional
-
Paper
Self-Instruct: aligning language models with self-generated instructions (2022)
Wang et al. · arXiv · optional
-
Read
-
5.12 Serving: APIs, Docker, latency and cost
-
Read
fastapi.tiangolo.com
-
Read
docs.docker.com
-
Read
Made With ML: serving and deployment lessons
Goku Mohandas · free
-
Read
-
5.13 Caching, model routing and cost control
-
Read
Claude docs
-
Read
AI Engineering, Ch 10 (AI engineering architecture: caches, routers and gateways)
Chip Huyen · book you own
-
Read
AI Engineering, Ch 9 (inference optimisation)
Chip Huyen · book you own
-
Paper
RouteLLM: Learning to Route LLMs with Preference Data (2024)
Ong et al. · arXiv · optional
-
Read
-
5.14 Observability: tracing and debugging LLM apps
- Read
-
Read
OpenTelemetry docs
-
Read
AI Engineering, Ch 10 (monitoring and observability)
Chip Huyen · book you own
-
5.15 Safety: guardrails and prompt injection
-
Read
Simon Willison
Worth it: From the person who named the attack: real exploits against real products, and an honest account of why it is so hard to fix. The essential read on LLM security.
- Read
-
Read
-
5.16 ML system design: pipelines, training vs serving, drift
-
Read
Data Distribution Shifts and Monitoring
Chip Huyen
Worth it: The clearest explanation of the kinds of drift, how to detect them and what to monitor, from the author of the standard book on ML systems.
- Read
-
Read
Designing Machine Learning Systems (whole book)
Chip Huyen · paid
-
Read
Go deeper (optional)
-
Book
Designing Machine Learning Systems (Chip Huyen) Paid
The standard book for ML system design interviews.
-
Notes
Stanford CS329S: Machine Learning Systems Design Free
Free course notes on the same topics.
-
Docs
The simplest way to put a model behind an API.