Learn it. Build it. Ship it for others.
概要
This curriculum closes that gap. 503 lessons. 20 phases. ~320 hours. Python, TypeScript, Rust, Julia. Every lesson ships a reusable artifact: a prompt, a skill, an agent, an MCP server. Free, open source, MIT. You don't just learn AI. You build it. End-to-end. By hand. 150,639 readers · 241,669 page views in the last 30 days · as of 2026-06-07 Most AI material teaches in scattered pieces. A paper here, a fine-tuning post there, a flashy agent demo somewhere else. The pieces rarely line up. You ship a chatbot but can't explain its loss curve. You hook a function to an agent but can't say what attention does inside the model that's calling it. This curriculum is the spine. 20 phases, 503 lessons, four languages: Python, TypeScript, Rust, Julia. Linear algebra at one end, autonomous swarms at the other. Every algorithm gets built from raw math first. Backprop. Tokenizer. Attention. Agent loop.
README
From the creator of Agent Memory - #1 Persistent memory ⭐ which naturally works with any agents or chat assistants.
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
84% of students already use AI tools. Only 18% feel prepared to use them professionally. This curriculum closes that gap.
503 lessons. 20 phases. ~320 hours. Python, TypeScript, Rust, Julia. Every lesson ships a reusable artifact: a prompt, a skill, an agent, an MCP server. Free, open source, MIT.
You don’t just learn AI. You build it. End-to-end. By hand.
150,639 readers · 241,669 page views in the last 30 days · as of 2026-06-07
How this works
Most AI material teaches in scattered pieces. A paper here, a fine-tuning post there, a flashy agent demo somewhere else. The pieces rarely line up. You ship a chatbot but can’t explain its loss curve. You hook a function to an agent but can’t say what attention does inside the model that’s calling it.
This curriculum is the spine. 20 phases, 503 lessons, four languages: Python, TypeScript, Rust, Julia. Linear algebra at one end, autonomous swarms at the other. Every algorithm gets built from raw math first. Backprop. Tokenizer. Attention. Agent loop. By the time PyTorch shows up, you already know what it’s doing under the hood.
Each lesson runs the same loop: read the problem, derive the math, write the code, run the test, keep the artifact. No five-minute videos, no copy-paste deploys, no hand-holding. Free, open source, and built to run on your own laptop.
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
The shape of the curriculum
Twenty phases stack on top of each other. Math is the floor. Agents and production are the roof. Skip ahead if you already know the lower layers, but don’t skip and then wonder why something at the top is breaking.
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#fafaf5','primaryTextColor':'#1a1a1a','primaryBorderColor':'#3553ff','lineColor':'#3553ff','fontFamily':'JetBrains Mono','fontSize':'12px'}}}%%
flowchart TB
P0["Phase 0 — Setup & Tooling"] --> P1["Phase 1 — Math Foundations"]
P1 --> P2["Phase 2 — ML Fundamentals"]
P2 --> P3["Phase 3 — Deep Learning Core"]
P3 --> P4["Phase 4 — Vision"]
P3 --> P5["Phase 5 — NLP"]
P3 --> P6["Phase 6 — Speech & Audio"]
P3 --> P9["Phase 9 — RL"]
P5 --> P7["Phase 7 — Transformers"]
P7 --> P8["Phase 8 — GenAI"]
P7 --> P10["Phase 10 — LLMs from Scratch"]
P10 --> P11["Phase 11 — LLM Engineering"]
P10 --> P12["Phase 12 — Multimodal"]
P11 --> P13["Phase 13 — Tools & Protocols"]
P13 --> P14["Phase 14 — Agent Engineering"]
P14 --> P15["Phase 15 — Autonomous Systems"]
P15 --> P16["Phase 16 — Multi-Agent & Swarms"]
P14 --> P17["Phase 17 — Infrastructure & Production"]
P15 --> P18["Phase 18 — Ethics & Alignment"]
P16 --> P19["Phase 19 — Capstone Projects"]
P17 --> P19
P18 --> P19
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
The shape of a lesson
Each lesson lives in its own folder, with the same structure across the entire curriculum:
phases/-/-/
├── code/ runnable implementations (Python, TypeScript, Rust, Julia)
├── docs/
│ └── en.md lesson narrative
└── outputs/ prompts, skills, agents, or MCP servers this lesson produces
Every lesson follows six beats. The Build It / Use It split is the spine — you implement the algorithm from scratch first, then run the same thing through the production library. You understand what the framework is doing because you wrote the smaller version yourself.
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#fafaf5','primaryTextColor':'#1a1a1a','primaryBorderColor':'#3553ff','lineColor':'#3553ff','fontFamily':'JetBrains Mono','fontSize':'13px'}}}%%
flowchart LR
M["MOTTOone-line core idea"] --> Pr["PROBLEMconcrete pain"]
Pr --> C["CONCEPTdiagrams & intuition"]
C --> B["BUILD ITraw math, no frameworks"]
B --> U["USE ITsame thing in PyTorch / sklearn"]
U --> S["SHIP ITprompt · skill · agent · MCP"]
Getting started
Three ways in. Pick one.
Option A — read. Open any completed lesson on aiengineeringfromscratch.com or expand a phase under Contents. No setup, no cloning.
Option B — clone and run.
git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
cd ai-engineering-from-scratch
python phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py
Option C — find your level (recommended). Skip ahead intelligently. Inside Claude, Cursor, Codex, OpenClaw, Hermes, or any agent with the curriculum skills installed:
/find-your-level
Ten questions. Maps your knowledge to a starting phase, builds a personalized path with hour estimates. After each phase:
/check-understanding 3 # quiz yourself on phase 3
ls phases/03-deep-learning-core/05-loss-functions/outputs/
# ├── prompt-loss-function-selector.md
# └── prompt-loss-debugger.md
Prerequisites
- You can write code (any language; Python helps).
- You want to understand how AI actually works, not just call APIs.
Built-in agent skills (Claude, Cursor, Codex, OpenClaw, Hermes)
| Skill | What it does |
|---|---|
/find-your-level |
Ten-question placement quiz. Maps your knowledge to a starting phase and produces a personalized path with hour estimates. |
/check-understanding |
Per-phase quiz, eight questions, with feedback and specific lessons to review. |
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Every lesson ships something
Other curricula end with “congratulations, you learned X.” Each lesson here ends with a reusable tool you can install or paste into your daily workflow.
Install the lot with
python3 scripts/install_skills.py. Real tools, not homework. By the end of the curriculum, you have a portfolio of 503 artifacts you actually understand because you built them.
FIG_002 · A worked sample
Phase 14, lesson 1: the agent loop. ~120 lines of pure Python, no dependencies.
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Contents
Twenty phases. Click any phase to expand its lesson list.
Phase 0: Setup & Tooling 12 lessons
Get your environment ready for everything that follows.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | Dev Environment | Build | Python |
| 02 | Git & Collaboration | Learn | — |
| 03 | GPU Setup & Cloud | Build | Python |
| 04 | APIs & Keys | Build | Python |
| 05 | Jupyter Notebooks | Build | Python |
| 06 | Python Environments | Build | Shell |
| 07 | Docker for AI | Build | Docker |
| 08 | Editor Setup | Build | — |
| 09 | Data Management | Build | Python |
| 10 | Terminal & Shell | Learn | — |
| 11 | Linux for AI | Learn | — |
| 12 | Debugging & Profiling | Build | Python |
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
The toolkit
Every lesson produces a reusable artifact. By the end you have:
outputs/
├── prompts/ prompt templates for every AI task
└── skills/ SKILL.md files for AI coding agents
Install them with npx skills add. Plug them into Claude, Cursor, Codex,
OpenClaw, Hermes, or any agent that reads a SKILL.md / AGENTS.md directory.
Real tools, not homework.
Install every course skill into your agent
The repo ships 388 skills and 99 prompts under phases/**/outputs/.
Recommended: install via skills.sh. No clone, no Python, detects your agent’s skills directory automatically:
npx skills add rohitg00/ai-engineering-from-scratch # every skill
npx skills add rohitg00/ai-engineering-from-scratch --skill agent-loop # one skill
npx skills add rohitg00/ai-engineering-from-scratch --phase 14 # one phase
skills writes to whichever directory your agent picks up: .claude/skills/,
.cursor/skills/, .codex/skills/, OpenClaw’s skills folder, Hermes’s bundle
path, or any SKILL.md-aware tool. One command, every agent.
Advanced: offline / custom layout via scripts/install_skills.py. Requires
cloning the repo. Useful when you need tag filters, dry-runs, or a non-default
layout:
python3 scripts/install_skills.py # every skill, default --layout skills (nested)
python3 scripts/install_skills.py --layout skills # same as above, explicit
python3 scripts/install_skills.py --type all # skills + prompts + agents
python3 scripts/install_skills.py --phase 14 # one phase only
python3 scripts/install_skills.py --tag rag # filter by tag
python3 scripts/install_skills.py --layout flat # flat files
python3 scripts/install_skills.py --dry-run # preview without writing
python3 scripts/install_skills.py --force # overwrite existing files
`` is the skills directory for your agent (examples:
~/.claude/skills/, ~/.cursor/skills/, ~/.config/openclaw/skills/,
.skills/, or any path your agent reads).
By default the script refuses to overwrite an existing destination and exits
with code 1 after listing every colliding path. Use --dry-run to preview
collisions or --force to overwrite. Every non-dry-run run writes a
manifest.json in the target with the full inventory grouped by type and
phase. Pick the layout your agent reads:
--layout |
Path written |
|---|---|
skills |
//SKILL.md (nested convention, supported by Claude / Cursor / Codex / OpenClaw / Hermes) |
by-phase |
/phase-NN/.md |
flat |
/.md |
Drop the agent workbench into your own repo
The Phase 14 capstone ships a reusable Agent Workbench pack (AGENTS.md, schemas, init / verify / handoff scripts). Scaffold it into any repo with:
python3 scripts/scaffold_workbench.py path/to/your-repo # full pack + seeds
python3 scripts/scaffold_workbench.py path/to/your-repo --minimal # skip docs/
python3 scripts/scaffold_workbench.py path/to/your-repo --dry-run # preview only
python3 scripts/scaffold_workbench.py path/to/your-repo --force # overwrite
You get the seven workbench surfaces wired up, a starter task_board.json,
and a fresh agent_state.json at schema_version: 1. From there: edit the
task, edit AGENTS.md, run scripts/init_agent.py, hand the contract to
your agent. The pack source lives at
phases/14-agent-engineering/42-agent-workbench-capstone/outputs/agent-workbench-pack/.
Browse the entire course as JSON
scripts/build_catalog.py walks every phase, every lesson, every artifact on
disk and writes catalog.json at the repo root. One file, every course truth.
python3 scripts/build_catalog.py # writes /catalog.json
python3 scripts/build_catalog.py --stdout # to stdout, do not touch repo
python3 scripts/build_catalog.py --out path/to/file.json
The catalog is filesystem-derived, not README-derived, so counts always match what is actually on disk. Use it for site builds, downstream tooling, or to verify the README counts have not drifted. Schema is documented at the top of the script.
A GitHub Action (.github/workflows/curriculum.yml) rebuilds catalog.json
on every PR and fails the build if the committed file is stale. After editing
any lesson, run python3 scripts/build_catalog.py and commit the result, or
CI will reject the PR. The same workflow runs audit_lessons.py in
warn-only mode (so existing drift does not block contributors).
Smoke-check every lesson’s Python code
scripts/lesson_run.py byte-compiles every .py file under each lesson’s
code/ directory. Default mode is syntax-check only — no execution, no API
keys, no heavy ML deps required. Catches the regressions contributors
introduce most often (bad indentation, broken f-strings, stray edits).
python3 scripts/lesson_run.py # syntax-check the whole curriculum
python3 scripts/lesson_run.py --phase 14 # one phase only
python3 scripts/lesson_run.py --json # JSON report on stdout
python3 scripts/lesson_run.py --strict # exit 1 if any lesson fails
python3 scripts/lesson_run.py --execute # actually run, 10s timeout per lesson
--execute runs each lesson’s code/main.py (or the first .py file) with a
10-second timeout. Lessons whose entry file starts with a # requires: pkg1, pkg2 comment listing non-stdlib deps are skipped with reason needs .
The script is opt-in and not wired into CI.
Stdlib only, Python 3.10+. Set LINK_CHECK_SKIP=domain1,domain2 to override
the default skip-list (twitter.com, x.com, linkedin.com,
instagram.com, medium.com — domains that aggressively block automated
HEAD/GET).
Where to start
| Background | Start at | Estimated time |
|---|---|---|
| New to programming and AI | Phase 0 — Setup | ~306 hours |
| Know Python, new to ML | Phase 1 — Math Foundations | ~270 hours |
| Know ML, new to deep learning | Phase 3 — Deep Learning Core | ~200 hours |
| Know deep learning, want LLMs and agents | Phase 10 — LLMs from Scratch | ~100 hours |
| Senior engineer, only want agent engineering | Phase 14 — Agent Engineering | ~60 hours |
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Why this matters now
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Contributing
| Goal | Read |
|---|---|
| Contribute a lesson or fix | CONTRIBUTING.md |
| Fork for your team or school | FORKING.md |
| Lesson template | LESSON_TEMPLATE.md |
| Track progress | ROADMAP.md |
| Glossary | glossary/terms.md |
| Code of conduct | CODE_OF_CONDUCT.md |
Before submitting a lesson, run the invariant check:
python3 scripts/audit_lessons.py # full curriculum
python3 scripts/audit_lessons.py --phase 14 # single phase
python3 scripts/audit_lessons.py --json # CI-friendly output
Exit code is non-zero when any rule fails. Rules (L001–L010) validate directory
shape, docs/en.md presence + H1, code/ non-emptiness, quiz.json schema
(rejects the legacy q/choices/answer keys that caused issue #102), and
relative links inside lesson docs.
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Sponsor the work
Free, MIT-licensed, 503 lessons. The curriculum is maintained on sponsorship alone. Cash only.
Reach (verified 2026-05-14): 55,593 monthly visitors · 90,709 page views · 7.5K stars · Twitter/X is the #1 acquisition channel.
Current sponsors: CodeRabbit · iii
| Tier | $/mo | What you get |
|---|---|---|
| Backer | $25 | Name in BACKERS.md |
| Bronze | $250 | Text-only row in README sponsor block + launch-day tweet |
| Silver | $750 | Small logo in README + listed as one supported provider in API lessons |
| Gold | $2,000 | Medium logo in README + sponsor page + quarterly X / LinkedIn co-feature |
| Platinum | $5,000 | Hero logo above the fold + one dedicated integration lesson, max 1 partner |
Full rate card, hard rules, pricing anchors, and reach data: SPONSORS.md. Sign up via GitHub Sponsors.
░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒░░░▒▒▒
Star history
If this manual helped you, star the repo. It keeps the project alive.
License
MIT. Use it however you want — fork it, teach it, sell it, ship it. Attribution appreciated, not required.
Maintained by Rohit Ghumare and the community.
@ghumare64 · aiengineeringfromscratch.com · Report / Suggest
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add rohitg00/ai-engineering-from-scratch