Level 5: AI Engineer
AI Engineer, in 34 missions, adds a second language and then puts AI models to work. Python covers the same ground as JavaScript did, faster: decisions, strings, lists, functions, dictionaries, comprehensions, files and errors, the standard library and classes.
Last updated
What does AI Engineer cover?
Building with AI teaches what a working AI feature needs: the messages a chat model expects, prompts kept as versioned templates, JSON output that is validated and retried a limited number of times, streaming, retrieval and search by meaning, tools and agents with a step limit and a log, scoring prompts against test cases, cost, and defending against prompt injection with a human approval step. Exercises use a stand-in model inside the page, so no AI account or key is needed.
The last unit is building with an AI coding partner: saying what done looks like before asking for code, writing tests that judge the result, reading every line, spotting invented functions, fixing security mistakes, and handing over with an honest note of what was checked.
Python
A second language: syntax, functions, collections, files and using other people's code.
13 missions. By the end: Small Python programs that read, transform and write data.
First steps
Write a Python program that stores values in variables and prints them in a sentence.
20 min
How Python runs your program
Explain how Python reads a program, why indentation matters, and read a traceback from the bottom up.
30 min
Decisions
Write Python that chooses what to do with `if`, `elif` and `else`, and combines conditions.
25 min
Strings in depth
Slice, search, clean and format strings, and build output with f-strings.
35 min
Lists and loops
Store values in a list and work through them with `for`, `range` and `while`.
25 min
Functions
Write Python functions with parameters, return values, default values and docstrings.
25 min
Dictionaries
Store and look up named values in dictionaries, and work with lists of dictionaries.
25 min
Comprehensions and sorting
Transform and filter with comprehensions, and sort by any rule using a key function.
35 min
Working with data
Turn JSON text into Python data and back, and filter and sort it.
25 min
Files and errors
Read and write text files, and handle the errors that can happen with try and except.
40 min
Modules and the standard library
Import from the standard library and use random, datetime, collections and pathlib.
40 min
Classes and dataclasses
Model a thing with a class or a dataclass, with methods that work on its data.
40 min
Project: a report script
Build a Python script that turns a list of records into a formatted summary report.
30 min
Big build chapter, about 75 minutes
The report
A Python program that turns the big build's raw data into a report a person can act on.
Building with AI
Calling models from code, structured output, retrieval, agents, evaluation and approvals.
13 missions. By the end: A design and working pieces of an AI feature with a human approval step.
Calling a model from code
Build the list of messages a chat model expects and keep a conversation going from code.
25 min
Inside a model call
Explain what is sent to a model and what comes back: the endpoint, the key, the messages, the settings and the usage numbers.
35 min
Prompts as code
Keep prompts as named, versioned templates and fill them with variables from code.
25 min
Getting data back, not prose
Ask a model for JSON, parse it, validate it and retry a limited number of times when it is wrong.
30 min
Streaming an answer
Show an answer as it arrives, with loading, cancel and error states.
40 min
Giving the model your information
Find the passage that matches a question, put it in the prompt and report which passage the answer came from.
30 min
Embeddings and search by meaning
Explain embeddings, measure how close two meanings are, and build a search that matches by meaning.
40 min
Tools and agents
Run a loop in which a model asks for tools, with a step limit and a log of everything it did.
30 min
Does it actually work
Score a prompt against a set of test cases and compare two versions with numbers, not a feeling.
25 min
What an AI job costs
Estimate what an AI job costs and how long it takes, from tokens, price and rate limits.
30 min
Cost, speed and choosing a model
Choose a model for a job by quality, speed and price, and cut cost with caching and shorter prompts.
40 min
Safety and approvals
Defend an AI feature against prompt injection with data handling, least privilege and a human approval gate.
30 min
Project: a reply drafter
Build a reply drafter with a template, validated JSON output, a retry limit and a human approval step.
30 min
Big build chapter, about 100 minutes
An assistant with a safety catch
An AI feature for the big build that never trusts the model's reply and never sends without a person's approval.
Building with an AI coding partner
The working method of a developer who builds with an AI coding assistant and stays responsible for the result.
8 missions. By the end: A small feature built with an AI coding assistant that they specified, tested, reviewed line by line and handed over with an honest note.
Say what done looks like first
Turn a vague request into a short spec with rules, examples and edge cases before asking for code.
30 min
Tests are the judge
Write a few small checks before asking for code, and use them to accept or reject what the assistant gives you.
35 min
Read every line
Review assistant-written JavaScript line by line, find the flaw and fix it.
35 min
Made-up functions
Spot a method or option an assistant invented, check it against what the language really does, and replace it with one that exists.
35 min
Safe by review
Find and fix three security mistakes that are common in assistant-written code: typed text put into the page as HTML, a secret written in the code, and SQL built by joining strings.
40 min
One small change at a time
Ask for one small change, read the diff, and reject changes you did not ask for.
35 min
When it goes round in circles
Give an assistant the exact error and the smallest failing example, and recognise when to stop asking and read the code yourself.
30 min
It is your code now
Explain assistant-written code in your own words, say what you checked and what you did not, and write a short handover note.
30 min
Big build chapter, about 85 minutes
Review before it ships
A feature an AI coding assistant wrote, reviewed by you: checked against the rule, fixed, made safe and handed over with a review note.