Read alongside
The library
The book is written in its own words. These are the sources it leans on. Open-licence sources can be quoted with credit; the rest are summarised in our words and linked, never copied.
Open licence
- AI Agent book (English edition)
The closest thing to a first-principles agents textbook: context, tools, memory, planning, multi-agent, evaluation.
- 12-Factor Agents
Principles for production agents: own your prompts, own your context window, tools are structured output, small focused agents. Share-alike applies to quoted text.
- Hugging Face Agents Course
Unit 1 (what an agent is, the thought-action-observation loop), bonus units on fine-tuning for function calling and observability, unit 3 on agentic RAG.
- Hugging Face MCP Course
MCP architecture, building servers and clients, end to end.
Chapters 26
- Hugging Face LLM Course
Chapter 1 (transformers), 6 (tokenizers, BPE from scratch), 11 (fine-tuning, LoRA), 12 (reasoning and GRPO).
- Prompt Engineering Guide
A catalogue of prompting techniques with papers; read for breadth, not depth.
- GraphRAG documentation
How GraphRAG builds entity graphs and community summaries, and global vs local search.
Chapters 18
- AI Agents for Beginners
Lessons on trustworthy agents, agents in production and agent security.
- awesome-ai-engineer-interview
A question bank to drill against after the interview hub.
- Foundations of Large Language Models
A free textbook on pretraining, generative models, prompting and alignment. Read the chapter that matches the section.
- minbpe, nanoGPT and Neural Networks: Zero to Hero
Build a tokenizer and a GPT from scratch. The labs reuse the code ideas, not the videos.
Vendored pages
Full pages from the open-licence sources, fetched at a pinned commit and shown with author, licence and a link to the original. Run npm run setup to fetch them.
AI Agent book (English edition)
12-Factor Agents
Share-alike: this text is licensed CC BY-SA 4.0. Anything adapted from it must credit the author and be released under the same licence. Code samples are Apache-2.0.
- 1. Natural language to tool calls
- 2. Own your prompts
- 3. Own your context window
- 4. Tools are just structured outputs
- 5. Unify execution state and business state
- 6. Launch/Pause/Resume with simple APIs
- Tool definition for human interaction
- 8. Own your control flow
- 9. Compact Errors into Context Window
- 10. Small, Focused Agents
- 11. Trigger from anywhere, meet users where they are
- 12. Make your agent a stateless reducer
- Factor 13 - pre-fetch all the context you might need
Hugging Face Agents Course
- What are LLMs?
- Messages and Special Tokens
- What is an Agent?
- What are Tools?
- Understanding AI Agents through the Thought-Action-Observation Cycle
- Thought: Internal Reasoning and the ReAct Approach
- Actions: Enabling the Agent to Engage with Its Environment
- Observe: Integrating Feedback to Reflect and Adapt
- What is Function Calling?
- Let's Fine-Tune Your Model for Function-Calling
- AI Agent Observability and Evaluation
- Agentic Retrieval Augmented Generation (RAG)
- Creating Your Gala Agent
- Building and Integrating Tools for Your Agent
Hugging Face MCP Course
Hugging Face LLM Course
- How do Transformers work?
- Deep dive into Text Generation Inference with LLMs
- Normalization and pre-tokenization
- Byte-Pair Encoding tokenization
- WordPiece tokenization
- Unigram tokenization
- Building a tokenizer, block by block
- Chat Templates
- Supervised Fine-Tuning
- LoRA (Low-Rank Adaptation)
- Evaluation
- Introduction to Reinforcement Learning and its Role in LLMs
- Understanding the DeepSeek R1 Paper
- Advanced Understanding of Group Relative Policy Optimization (GRPO) in DeepSeekMath
- Implementing GRPO in TRL
Prompt Engineering Guide
GraphRAG documentation
Link only
- Building effective agents; Effective context engineering; Contextual Retrieval
The canonical posts on workflow vs agent patterns, tool design, context engineering and contextual retrieval. Link only; summarised in our own words.
- Evals FAQ and courses
Error analysis first: trace review, open and axial coding, validating LLM judges. Link only.
- AI Engineering
The best single book on the field. Chapter 6 is RAG and agents; chapters 3 and 4 are evaluation.
- Speech and Language Processing (3rd ed. draft)
Tokenization, embeddings, language models and information retrieval from the textbook that defined them. Link only.
- Simon Willison's weblog: prompt injection series
Where the lethal trifecta and the dual-LLM pattern were named. Link only.
Chapters 33
Best sources, chapter by chapter
- 01 What AI Engineering Is
- Chip Huyen Ch1 ; applied-llms.org applied-llms.org
- 02 Text as Numbers: Tokenization
- CS336 Lecture 1 and Assignment 1 ; Karpathy Zero to Hero karpathy.ai/zero-to-hero.html ; mlabonne §1
- 03 Embeddings and Vector Space
- SLP3 web.stanford.edu/~jurafsky/slp3 ; Chip Huyen Ch3 "Introduction to Embedding" ; Sentence-BERT arxiv.org/abs/1908.10084
- 04 Language Modeling and Sampling
- Chip Huyen Ch2 "Sampling" and Ch3 ; mlabonne §1
- 05 Transformer Intuition
- CS336 Lectures 2–4 ; Karpathy ; Raschka github.com/rasbt/LLMs-from-scratch ; Illustrated Transformer jalammar.github.io/illustrated-transformer ; CS224N web.stanford.edu/class/cs224n
- 06 Pretraining, Data and Scaling
- CS336 Lectures 5–9, 13–14 and Assignments 2–4 ; Chip Huyen Ch2 ; HF Ultra-Scale Playbook huggingface.co/spaces/nanotron/ultrascale-playbook
- 07 Post-Training and Alignment
- CS336 Lectures 15–17 and Assignment 5 ; mlabonne §3–5 ; InstructGPT arxiv.org/abs/2203.02155 ; DPO arxiv.org/abs/2305.18290
- 08 Reasoning Models and Test-Time Compute
- Chip Huyen Ch2 "Test Time Compute" ; mlabonne "Test-Time Compute" ; Berkeley F24 Denny Zhou ; DeepSeek-R1 arxiv.org/abs/2501.12948 ; Lilian Weng "Why We Think" lilianweng.github.io/posts/2025-05-01-thinking
- 09 Fine-Tuning in Practice
- Chip Huyen Ch7–8 ; mlabonne §3–4, §7 ; LoRA arxiv.org/abs/2106.09685 ; QLoRA arxiv.org/abs/2305.14314
- 10 Inference Mechanics
- Chip Huyen Ch9 ; CS336 Lecture 10 ; mlabonne LLM Engineer §6 ; PagedAttention arxiv.org/abs/2309.06180 ; kipply kipp.ly/transformer-inference-arithmetic ; "How to Scale Your Model" jax-ml.github.io/scaling-book
- 11 Serving, Model Selection and Economics
- Chip Huyen Ch4 and Ch10 ; mlabonne "Running/Deploying LLMs" ; Anthropic "Confidential Inference" ; RouteLLM arxiv.org/abs/2406.18665
- 12 Prompting Fundamentals
- Chip Huyen Ch5 ; FSDL "Learn to Spell" ; Berkeley F24 DSPy ; Anthropic prompt docs docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview ; Lost in the Middle arxiv.org/abs/2307.03172
- 13 Structured Output
- Chip Huyen Ch2 "Structured Outputs" ; mlabonne ; OpenAI Cookbook structured-output eval ; Outlines arxiv.org/abs/2307.09702
- 14 Multimodal and Realtime Voice
- Chip Huyen Ch6 "RAG Beyond Texts" ; mlabonne "Multimodal" ; Latent Space Vision/Voice sections (V, headings only).
- 15 Information Retrieval Foundations
- Manning *Introduction to IR* nlp.stanford.edu/IR-book ; SLP3 ; Chip Huyen Ch6 ; DPR arxiv.org/abs/2004.04906 ; ColBERT arxiv.org/abs/2004.12832
- 16 Vector Search and Indexing
- mlabonne "Vector Storage" ; HNSW arxiv.org/abs/1603.09320
- 17 RAG Pipelines
- Chip Huyen Ch6 ; mlabonne RAG ; FSDL askFSDL ; RAG paper arxiv.org/abs/2005.11401 ; Anthropic Contextual Retrieval anthropic.com/news/contextual-retrieval
- 18 Advanced and Agentic RAG
- mlabonne "Advanced RAG" ; Berkeley F24 Jerry Liu ; Anthropic multi-agent research system ; OpenAI Cookbook file and web search ; PromptLayer
- 19 Evals I: Methodology and Error Analysis
- Hamel Evals FAQ ; Chip Huyen Ch3–4 ; CS336 Lecture 12 ; Anthropic "infrastructure noise" ; Hamel "Your AI Product Needs Evals" hamel.dev/blog/posts/evals
- 20 Evals II: Judges, RAG/Agent Evals and Continuous Evaluation
- Hamel FAQ ; Chip Huyen Ch3 "AI as a Judge" ; Anthropic "Demystifying evals for AI agents" and "Eval awareness" ; Berkeley F25 Agent Evaluation ; OpenAI Cookbook tools-evaluation ; "Who Validates the Validators?" arxiv.org/abs/2404.12272 ; τ-bench arxiv.org/abs/2406.12045
- 21 Tool Use / Function Calling
- Anthropic "Writing effective tools" and "Advanced tool use" ; Chip Huyen Ch6 "Tools" ; OpenAI Cookbook function calling ; Toolformer arxiv.org/abs/2302.04761
- 22 The Agent Loop and Architectures
- Anthropic "Building effective agents" anthropic.com/engineering/building-effective-agents , plus the two harness posts ; Berkeley F24 Shunyu Yao and F25 Yann Dubois and Clay Bavor ; Chip Huyen Ch6 ; ReAct arxiv.org/abs/2210.03629 ; Lilian Weng lilianweng.github.io/posts/2023-06-23-agent ; 12-factor agents github.com/humanlayer/12-factor-agents
- 23 Memory
- Anthropic "The components of agent memory" ; Chip Huyen Ch6 "Memory" ; mlabonne ; MemGPT arxiv.org/abs/2310.08560 ; Generative Agents arxiv.org/abs/2304.03442
- 24 Planning and Reasoning in Agents
- Chip Huyen Ch6 "Planning" ; Berkeley F24 Denny Zhou and Yuandong Tian ; Tree of Thoughts arxiv.org/abs/2305.10601 ; Reflexion arxiv.org/abs/2303.11366
- 25 Multi-Agent Systems
- Anthropic multi-agent research system and parallel-Claudes C compiler ; Berkeley F25 Noam Brown and Oriol Vinyals ; Berkeley F24 AutoGen ; OpenAI Cookbook Agents SDK
- 26 MCP and Agent Protocols
- MCP spec modelcontextprotocol.io/specification ; Anthropic "Code execution with MCP", "Desktop Extensions", "Agent Skills" ; mlabonne "Agent Protocols" ; A2A a2a-protocol.org .
- 27 Context Engineering
- Anthropic "Effective context engineering" ; Chip Huyen Ch10 "Enhance Context" ; Lost in the Middle ; PromptLayer, "context engineering" as an interview topic .
- 28 Coding and Computer-Use Agents
- Anthropic Claude Code best practices, harness posts, auto mode, source control ; Berkeley F24 Graham Neubig ; SWE-bench arxiv.org/abs/2310.06770 ; OSWorld arxiv.org/abs/2404.07972
- 29 Guardrails and Safety
- Chip Huyen Ch10 "Guardrails" ; Hamel FAQ "Production" ; Berkeley F24 Ben Mann and Dawn Song
- 30 Observability
- Chip Huyen Ch10 "Monitoring and Observability" ; Anthropic postmortem and quality-report posts ; OTel GenAI opentelemetry.io/docs/specs/semconv/gen-ai ; OpenAI Cookbook trace-based improvement loop ; roadmap.sh FAQ names AI observability .
- 31 Cost and Latency Engineering
- Chip Huyen Ch4, Ch9, Ch10 ; Anthropic prompt caching docs docs.anthropic.com/en/docs/build-with-claude/prompt-caching ; RouteLLM .
- 32 Deployment and LLMOps
- Chip Huyen Ch10 ; FSDL LLMOps and "Launch in an Hour" ; mlabonne "Deploying" ; Anthropic "Scaling Managed Agents" ; Chip Huyen "Building a GenAI Platform" huyenchip.com/2024/07/25/genai-platform.html
- 33 Security: Prompt Injection and Agent Security
- Chip Huyen Ch5 "Defensive Prompt Engineering" ; mlabonne "Securing LLMs" ; Berkeley F25 Safety and Security ; Anthropic "Beyond permission prompts", "How we contain Claude", auto mode ; Simon Willison simonwillison.net/series/prompt-injection ; Greshake et al. arxiv.org/abs/2302.12173 ; CaMeL arxiv.org/abs/2503.18813 ; OWASP genai.owasp.org/llm-top-10
- 34 Product UX for AI and the Feedback Loop
- Chip Huyen Ch10 "User Feedback" ; FSDL "UX for Language User Interfaces" ; Google PAIR pair.withgoogle.com/guidebook ; Microsoft HAX microsoft.com/en-us/haxtoolkit/ai-guidelines .