AI Engineering from Scratch: A Comprehensive Hands-On AI Curriculum

AI Engineering from Scratch: A Comprehensive Hands-On AI Curriculum

Summary

The "AI Engineering from Scratch" repository provides a free, MIT-licensed curriculum for mastering AI engineering from foundational math to advanced agent systems. It emphasizes a hands-on approach, guiding learners to build every algorithm from scratch before utilizing frameworks. With 435 lessons across 20 phases, this project equips students with the practical skills needed to professionally build and deploy AI solutions.

Repository Info

Updated on May 25, 2026
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

The "AI Engineering from Scratch" repository offers a comprehensive, free, and MIT-licensed curriculum designed to teach the fundamentals and advanced concepts of AI engineering. With the core philosophy "Learn it. Build it. Ship it for others.", this project aims to bridge the gap between theoretical knowledge and practical application. It addresses the critical need for professionals who can not only use AI tools but also understand and build them from the ground up. The curriculum spans 435 lessons across 20 phases, requiring approximately 320 hours, and utilizes multiple programming languages including Python, TypeScript, Rust, and Julia.

Installation

To get started with the hands-on lessons, you can clone the repository and run the code directly. No complex setup is required to begin exploring the examples.

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

Alternatively, you can simply read through any completed lesson on the official website without any local setup.

Examples

A unique aspect of this curriculum is that every lesson culminates in a reusable artifact, such as prompt templates, agent skills, autonomous agents, or Model Context Protocol (MCP) servers. For instance, in Phase 14, Lesson 1, learners build a minimal agent loop in pure Python. This foundational piece is then "shipped" as a reusable skill and a prompt for debugging agents. This approach ensures that theoretical understanding is immediately translated into practical, deployable tools.

def run(query, tools):
    history = [user(query)]
    for step in range(MAX_STEPS):
        msg = llm(history)
        if msg.tool_calls:
            for call in msg.tool_calls:
                result = tools[call.name](**call.args)
                history.append(tool_result(call.id, result))
            continue
        return msg.content
    raise StepLimitExceeded

This code snippet demonstrates a basic ReAct-style agent loop, which is then packaged as a skill:

---
name: agent-loop
description: ReAct-style loop for any tool list
phase: 14
lesson: 01
---

Implement a minimal agent loop that...

Why Use It

"AI Engineering from Scratch" stands out for several compelling reasons. It offers an unparalleled hands-on learning experience, guiding you to build every AI algorithm from raw mathematical principles before introducing frameworks. This comprehensive approach covers everything from linear algebra to advanced autonomous multi-agent systems, ensuring a deep, fundamental understanding. Each lesson delivers a practical, reusable tool, allowing you to build a portfolio of deployable artifacts. By focusing on building rather than just consuming APIs, the curriculum directly addresses the industry's demand for engineers who truly understand how AI works, preparing you for professional AI development. It is also completely free and open-source, making high-quality AI education accessible to everyone.

Links