AI Engineering From Scratch: Learn AI Engineering
rohitg00/ai-engineering-from-scratchLearn AI Engineering! Learn it. Build it. Ship it for others.
Evaluate and collect.
What the project says.
Implement model internals, retrieval pipelines, and agent runtimes. Test them, inspect failures, and keep the code and evaluation results. Start learning · Choose a path · Try a lab · Build a project · Browse the curriculum Free, open source, MIT. Learn on the website, with a coding agent, or by running local code. 542 lessons. 20 phases. Python, TypeScript, Rust, Julia, Go. Turn your coding agent into a tutor with one command: Read in your language 🇬🇧 English · 🇨🇳 简体中文 · 🇹🇼 繁體中文(台灣) · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇵🇹 Português · 🇧🇷 Português (Brasil) · 🇪🇸 Español · 🇩🇪 Deutsch · 🇫🇷 Français · 🇮🇹 Italiano · 🇳🇱 Nederlands · 🇵🇱 Polski · 🇨🇿 Čeština · 🇷🇴 Română · 🇭🇺 Magyar · 🇬🇷 Ελληνικά · 🇸🇪 Svenska · 🇩🇰 Dansk · 🇳🇴 Norsk · 🇫🇮 Suomi · 🇷🇺 Русский · 🇺🇦 Українська · 🇹🇷 Türkçe · 🇮🇱 עברית · 🇸🇦 العربية · 🇮🇷 فارسی · 🇮🇳 हिन्दी · 🇧🇩 বাংলা · 🇵🇰 اردو · 🇹🇭 ไทย · 🇻🇳 Tiếng Việt · 🇮🇩 Bahasa Indonesia · 🇵🇭 Tagalog Sponsors Your support keeps every lesson free and open source. See all supporters · Become a sponsor Why build it from scratch A framework call hides the part that breaks. When a loss turns into NaN or an agent repeats the same tool call, the person who wrote the small version knows where to look. Most lessons have you write that small version first and run it, then show where production tools do the same work. Text version - 01 · THE PROBLEM : An LLM returns text. It cannot act. - 02 · BUILD IT : A ReAct loop in stdlib Python. - 03 · USE IT : Where agent SDKs run the same loop. - 04 · SHIP IT : skill-agent-loop.md, ready for your agent. Learning paths Route Starting lesson --- --- Model foundations Setup and tooling LLM systems Prompt engineering Agents and delivery The agent loop Compare career paths · Prerequisites and study time Gradient descent Twenty starting points follow gradient descent on a quadratic loss. The graph shows their positions and mean loss after each update. Adjust the learning rate in the lesson · Compare GD, momentum, and Adam in code Projects Three projects with staged starters, reference implementations, and local graders. Run commands from the repository root after setup. Starters fail until you implement the stages. 01 · Retrieval Evaluation Lab · Python · Ranking metrics and regression checks A candidate improves mean NDCG while one query ranks its most relevant evidence lower. Build a query-by-query comparison that reports the regression and can fail a release check. Use Python 3.10+. Review RAG and model evaluation. Implement ranking validation, precision and recall, rank-sensitive metrics, then system comparison. Keep: a reproducible comparison with per-query deltas and the judgments used to score them. Metrics describe those judgments; they do not establish answer correctness. Start the project · Inspect the reference · Run on your own inputs 02 · Agent Trace Debugger · TypeScript · Trace parsing and timing A supplied trace still takes 100 ms, but total token usage rises by 200 and one span starts failing. Separate overlapping child work from parent execution time, then produce a report that exposes the change. Use Node.js 22.18+ and Python 3 for the grader. Implement JSONL parsing, parent validation, interval arithmetic, then an inspectable timeline. Keep: the input trace, an HTML timeline, and a JSON regression report. Preserve exclusive per-span token counts so parent and child usage are not counted twice. Start the project · Inspect the reference · Explore timing interactively 03 · Tool Call Firewall · Rust · Role checks and approval receipts A write changes after review, or an approval is replayed. Validate the call envelope, check the caller's role and path, then consume an approval bound to the exact request and content. Use Rust and Python 3.10+. Review tool schema design and security boundaries. The caller application supplies identity; the model proposes an operation. Keep: an audit receipt showing the requested operation and the policy deci...
Continue the conversation.
Comments, one-level replies, owner highlights, and discussion notifications are included with ORYNT membership.
Sign in with GitHub