How Phases Are Organized in the AI Engineering from Scratch Curriculum

The rohitg00/ai-engineering-from-scratch repository structures its curriculum into 20 sequential phases numbered 00 through 19, using a deterministic folder hierarchy under phases/<NN>-<phase-name>/ that enforces a machine-readable progression from environment setup to capstone projects.

Understanding how phases are organized in this curriculum is essential for navigating the repository’s learning path. The repository implements a strict hierarchical convention that groups lessons into numbered phases, ensuring each stage builds upon the mathematical and engineering foundations established in previous sections.

Sequential Phase Structure (00–19)

The curriculum divides content into 20 sequential phases, each serving as a major milestone in the AI engineering journey.

Directory Naming Convention

Phases reside in the root phases/ directory and follow the pattern phases/<NN>-<phase-name>/, where <NN> is a zero-padded two-digit number (e.g., 00, 01, 19). This numeric prefix ensures deterministic sorting across file systems. For example:

  • phases/00-setup-and-tooling/ – Environment configuration and tooling
  • phases/01-math-foundations/ – Linear algebra and calculus fundamentals
  • phases/19-capstone-projects/ – Final integration projects

Phase-to-Phase Dependencies

The ordering is intentional: Phase 0 establishes development environments, Phase 1 covers mathematical foundations, and subsequent phases progress through deep learning cores, multimodal models, tool protocols, and agent engineering (Phases 13–14). Each phase assumes completion of previous material, creating a scaffolded learning trajectory documented in the root README.md.

Lesson Hierarchy Within Phases

Every phase contains multiple lessons following an identical subfolder structure that mirrors the phase-level naming convention.

Consistent Subfolder Pattern

Inside each phase directory, lessons use the pattern phases/<NN>-<phase-name>/<NN>-<lesson-name>/. The lesson number resets per phase (starting at 01), while maintaining the zero-padded, hyphenated format. A concrete example from the source code:

import subprocess

# Execute a lesson from Phase 1 (Math Foundations)

subprocess.run([
    "python",
    "phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py"
])

Standardized Lesson Components

Every lesson directory contains four mandatory components:

  • code/ – Runnable implementations (Python, TypeScript, Rust, or Julia)
  • docs/en.md – Narrative explanation and theoretical background
  • outputs/ – Generated artifacts including prompts, skills, agents, and MCP servers
  • quiz.json – Structured assessment data

To list all lessons within a specific phase using the command line:

ls phases/03-deep-learning-core/

# Returns: 01-the-perceptron  02-multi-layer-networks  ...  13-debugging-neural-networks

The quiz.json file follows a standardized schema:

{
  "lesson": "01-linear-algebra-intuition",
  "title": "Linear Algebra Intuition",
  "questions": [
    {"stage":"pre","question":"What is a vector?","options":["..."],"correct":0,"explanation":""}
  ]
}

Curriculum Navigation and Documentation

The repository provides multiple entry points for understanding the phase organization.

Root README as Curriculum Map

The top-level README.md contains a collapsible “Contents” section enumerating all phases and their lessons with direct hyperlinks. This serves as the primary navigation interface, mapping phase numbers to conceptual areas (e.g., Phase 3 – Deep Learning Core, Phase 13 – Agent Engineering).

AGENTS.md and Contribution Guidelines

The AGENTS.md file functions as the curriculum’s operating manual, explicitly defining the folder conventions and contribution rules. This document ensures that community additions maintain the strict organizational hierarchy required by the automated validation scripts.

Automated Validation and Structure

Consistency across 20 phases is enforced through automation. The scripts/audit_lessons.py utility validates that every lesson directory contains the required code/, docs/, outputs/, and quiz.json components, and that naming conventions follow the <NN>-<name> pattern. This prevents structural drift as the curriculum evolves.

Summary

  • The curriculum contains 20 sequential phases (00–19) organized under phases/<NN>-<phase-name>/ with zero-padded numeric prefixes.
  • Lessons follow a nested hierarchy using phases/<NN>-<phase-name>/<NN>-<lesson-name>/, each containing standardized code/, docs/en.md, outputs/, and quiz.json files.
  • The progression moves from setup and math foundations through deep learning, multimodal systems, and agent engineering to final capstone projects.
  • Documentation in README.md and AGENTS.md provides the canonical reference for the organizational structure.
  • scripts/audit_lessons.py automatically validates folder and file conformity across all phases.

Frequently Asked Questions

How many phases are in the AI Engineering from Scratch curriculum?

The curriculum contains exactly 20 phases, numbered 00 through 19. Phase 00 covers setup and tooling, Phase 01 covers math foundations, and Phase 19 contains capstone projects, with intermediate phases covering deep learning, multimodal models, and agent engineering.

What is the folder structure for lessons within a phase?

Lessons reside in phases/<NN>-<phase-name>/<NN>-<lesson-name>/ where the first <NN> is the phase number and the second <NN> is the lesson number within that phase (resetting to 01 for each phase). Every lesson must contain four subdirectories/files: code/, docs/en.md, outputs/, and quiz.json.

How does the curriculum ensure consistent organization across all phases?

The repository uses scripts/audit_lessons.py to programmatically validate that each phase and lesson follows the required naming conventions and contains all mandatory files. Additionally, AGENTS.md documents the strict layout rules for contributors.

Where can I find the overview of all phases and their lessons?

The root README.md file contains a comprehensive “Contents” section that lists all 20 phases and their respective lessons with clickable links to each lesson’s docs/en.md file and code directory.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →