rohitg00/ai-engineering-from-scratch
AI Engineering from Scratch is a free, open-source (MIT-licensed) educational curriculum created by Rohit Ghumare that teaches learners how to build AI systems end-to-end by hand, rather than merely calling APIs. The project is substantial in scope: it comprises 503 lessons organized into 20 sequential phases, representing roughly 320 hours of study, with implementations spanning four programming languages — Python, TypeScript, Rust, and Julia. The curriculum's core thesis addresses a stated gap: while 84% of students already use AI tools, only 18% feel prepared to use them professionally. It aims to close that gap by teaching not just usage but underlying construction. The pedagogical philosophy is that most AI material is fragmented — scattered papers, fine-tuning posts, and flashy demos that never line up — so this curriculum acts as a coherent "spine," building every algorithm from raw math first (backpropagation, tokenizers, attention, agent loops) before introducing production frameworks like PyTorch or scikit-learn. Each lesson follows a consistent six-beat loop: MOTTO (core idea), PROBLEM (concrete pain), CONCEPT (diagrams and intuition), BUILD IT (raw math, no frameworks), USE IT (the same thing in a production library), and SHIP IT (a reusable artifact). The distinctive "Build It / Use It" split ensures learners understand what frameworks do because they first wrote a smaller version themselves. The curriculum's phases stack from mathematical foundations up to autonomous systems. Phase 0 covers setup and tooling; Phase 1 math foundations; Phase 2 ML fundamentals; Phase 3 deep learning core; Phases 4–6 vision, NLP, and speech/audio; Phase 7 transformers; Phase 8 generative AI; Phase 9 reinforcement learning; Phase 10 LLMs from scratch; Phase 11 LLM engineering; Phase 12 multimodal; Phase 13 tools and protocols; Phase 14 agent engineering; Phase 15 autonomous systems; Phase 16 multi-agent systems and swarms; Phase 17 infrastructure and production; Phase 18 ethics and alignment; and Phase 19 capstone projects. Regarding the "agents" query, agents are a central pillar of the upper curriculum: learners build the agent loop by hand (Phase 14, lesson 1 ships ~120 lines of pure Python with no dependencies), progress to autonomous systems (Phase 15) and multi-agent swarms (Phase 16), and build MCP servers end-to-end in Phase 13. The creator also authored Agent Memory, described as the #1 persistent memory tool that works with any agents or chat assistants. A defining feature is that every lesson ships a reusable artifact — a prompt, a skill, an agent, or an MCP server — so learners finish with a portfolio of 503 practical tools they genuinely understand. Prompts can be pasted into any AI assistant, skills drop into Claude, Cursor, Codex, OpenClaw, Hermes, or any agent reading SKILL.md, agents deploy as autonomous workers, and MCP servers plug into any MCP-compatible client. There are three onboarding paths: reading lessons on the website, cloning and running the repository directly, or using the recommended built-in agent skills. Two named skills stand out: `/find-your-level`, a ten-question placement quiz that maps knowledge to a starting phase with hour estimates, and `/check-understanding <phase>`, an eight-question per-phase quiz with feedback. The entire course also compiles into a six-volume book series (Foundations, Deep Learning, Language, Large Language Models, Agents, and Production), with EPUB and PDF editions built by CI from the same lesson sources and attached to every GitHub release. Each lesson lives in its own folder with code, docs, and outputs subdirectories. In terms of maturity and trending significance, the project shows strong traction: statistics cite 150,639 read