How the AI Engineering from Scratch Curriculum Phase Progression Works: A 20-Phase Blueprint
The AI Engineering from Scratch curriculum phase progression is organized as a linear 20-phase spine from setup and math foundations to production autonomous agents, with prerequisites visually mapped in README.md and enforced by CI builds and an interactive /find-your-level skill.
The rohitg00/ai-engineering-from-scratch repository structures every lesson as a stepping stone in a larger engineering journey. Understanding the AI Engineering from Scratch curriculum phase progression reveals how mathematical fundamentals are deliberately sequenced before deep learning, and how deep learning is solidified before you architect multi-agent swarms.
How the AI Engineering from Scratch Curriculum Phase Progression Is Structured
At the heart of the repository is a directed, dependency-respecting sequence of 20 phases. Each phase is self-contained inside its own folder under phases/NN-<phase-slug>/ and follows a uniform layout with code/, docs/, and outputs/ subdirectories.
The exact ordering is visualised in the top-level README.md inside a Mermaid flowchart at lines 58-80. The phases are:
- Phase 0 – Setup & Tooling: basic environment, git, Docker, etc.
- Phase 1 – Math Foundations: linear algebra, calculus, probability, optimisation.
- Phase 2 – ML Fundamentals: classic algorithms (linear regression, trees, SVMs).
- Phase 3 – Deep Learning Core: perceptron → back-prop → mini-framework → PyTorch/JAX.
- Phase 4 – Computer Vision: pixels → CNNs → video → world-models.
- Phase 5 – NLP: tokenisation, embeddings, transformers, LLM basics.
- Phase 6 – Speech & Audio: waveforms, ASR, TTS, audio-LLMs.
- Phase 7 – Transformers Deep Dive: self-attention, multi-head, BERT/GPT, scaling.
- Phase 8 – Generative AI: GANs, diffusion, video/audio/3D generation.
- Phase 9 – Reinforcement Learning: DP, Q-learning, policy-gradients, RLHF.
- Phase 10 – LLMs from Scratch: tokenisers, pre-training, distributed training, quantisation.
- Phase 11 – LLM Engineering: prompt engineering, RAG, tool-calling, evaluation.
- Phase 12 – Multimodal AI: vision-language models, audio-language, embodied agents.
- Phase 13 – Tools & Protocols: the Model Context Protocol (MCP), tool schemas, security.
- Phase 14 – Agent Engineering: agent loops, memory, planning, orchestration, production runtimes.
- Phase 15 – Autonomous Systems: multi-agent collaboration, debate, failure-mode analysis.
- Phase 16 – Multi-Agent & Swarms: hierarchical swarms, consensus, scaling.
- Phase 17 – Infrastructure & Production: MCP gateways, auth, observability.
- Phase 18 – Ethics & Alignment: safety gates, evaluation, alignment techniques.
- Phase 19 – Capstone Projects: end-to-end agents, safety gates, multimodal agents.
Build It / Use It Pedagogy
Every phase enforces a strict Build It / Use It split. First you implement the algorithm from raw math or scratch code; then you run the identical logic through a production library like PyTorch, JAX, or a custom MCP server.
This dual-track approach is reflected in lesson files such as phases/14-agent-engineering/01-the-agent-loop/code/agent_loop.py. The raw loop is built by hand before being packaged into the reusable outputs/skill-agent-loop.md artifact, which you can later register with scripts/install_skills.py.
How the Curriculum Enforces Phase Order
README Phase Diagram and CI Enforcement
The top-level README.md encodes the exact progression in a Mermaid flowchart located at lines 58-80. The site generator in site/build.js parses the markdown links to each phase's lesson list; if a link is missing or out of order, the CI build breaks.
This programmatic check guarantees that the public documentation never drifts from the intended prerequisite chain. Additionally, scripts/audit_lessons.py ensures every lesson contains the required code/, docs/, outputs/, and tests directories while validating that phase dependencies are respected.
Skill-Based Placement with /find-your-level
Instead of forcing every learner to start at Phase 0, the repository ships a dedicated Claude skill defined in .claude/skills/find-your-level/SKILL.md. Invoking /find-your-level presents ten multiple-choice questions, evaluates the answers, and returns a personalized path with hour estimates.
Run the assessment inside any compatible agent session:
# Inside a Claude, Cursor, Codex, OpenClaw or Hermes session that has the curriculum skills installed:
/find-your-level
The skill outputs a routing decision such as:
Your knowledge maps to Phase 3 – Deep Learning Core.
Recommended path: 3.1 → 3.2 → … → 19 (≈ 320 h)
This mechanism encourages learners to skip ahead intelligently while still honoring the prerequisite chain defined by the spine.
Running Lessons and Reusing Artifacts
Individual lessons are executable directly from the cloned repository. For example, the first lesson of Phase 3 implements a perceptron from scratch and is located at phases/03-deep-learning-core/01-the-perceptron/code/main.py.
git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
cd ai-engineering-from-scratch
python phases/03-deep-learning-core/01-the-perceptron/code/main.py
The lesson prints training progress and exits with status 0, satisfying the test harness invoked by python -m unittest discover …. After completing a lesson, you can register reusable skills with:
python3 scripts/install_skills.py
Once registered, the artifact can be invoked as /agent-loop <query> in any supported agent platform.
Key Files That Define and Enforce Progression
Several files work together to keep the curriculum coherent:
README.md(lines 58-80): Holds the Mermaid phase diagram that visually defines the curriculum's progression.site/build.js: Parses phase markdown links to generatesite/data.js; missing links break the CI build..claude/skills/find-your-level/SKILL.md: Implements the interactive placement quiz.scripts/install_skills.py: Registers reusable artifacts produced by lessons.scripts/audit_lessons.py: Validates lesson structure and dependency compliance.phases/14-agent-engineering/01-the-agent-loop/code/agent_loop.py: Exemplifies the Build It / Use It output that ships a reusable skill atoutputs/skill-agent-loop.md.
Summary
- The curriculum is a linear 20-phase spine from basic tooling to advanced autonomous systems.
- Each phase lives in
phases/NN-<phase-slug>/with a uniformcode/,docs/,outputs/structure. - A Build It / Use It split ensures you implement algorithms from scratch before using production frameworks.
- Phase order is visually documented in the
README.mdMermaid chart and programmatically enforced bysite/build.jsandscripts/audit_lessons.py. - The
/find-your-levelskill lets learners skip ahead intelligently while respecting the prerequisite chain.
Frequently Asked Questions
How many phases are in the AI Engineering from Scratch curriculum?
The repository defines 20 phases, numbered 0 through 19, beginning with Setup & Tooling and ending with Capstone Projects. Each phase is self-contained inside phases/NN-<phase-slug>/ and builds on the mathematical foundations laid by the previous phase.
What is the Build It / Use It method?
The Build It / Use It method requires you to first implement an algorithm from raw math or scratch code, then execute the same logic through a production library such as PyTorch or JAX. This approach is baked into lesson structures like phases/14-agent-engineering/01-the-agent-loop/code/agent_loop.py, which produces both a raw agent loop and a reusable outputs/skill-agent-loop.md artifact.
How does the curriculum enforce phase order?
Progression is enforced in two ways. First, the Mermaid diagram in README.md (lines 58-80) explicitly maps the directed graph of dependencies. Second, the CI site generator site/build.js parses markdown links to each phase; missing or broken links fail the build, and scripts/audit_lessons.py audits lesson structure and dependency compliance.
Can I skip ahead without completing every phase?
Yes. The .claude/skills/find-your-level/SKILL.md skill provides an interactive /find-your-level command that asks ten assessment questions and maps your answers to an appropriate starting phase. It returns a personalized path with hour estimates, letting you skip earlier material while still following the prerequisite chain.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →