Free Python for AI course
Learn Python from your first line of code to your first call to a language model, with nothing to install.
Build a bounded run loop, test it with scripted model responses, and recover interrupted work from an event log.
The harness turns proposals into timed, budgeted, authorized operations. Preserve a trace and durable operation identity so another process can resume safely and a keyless fixture can exercise the same policy.
A scripted adapter returns a typed proposal.
The loop checks authorization, remaining budget, and previous operation state.
The trace records the effect and yields a safe stopping or resumption point.
A scripted adapter returns a typed proposal.
The loop checks authorization, remaining budget, and previous operation state.
The trace records the effect and yields a safe stopping or resumption point.
Given A scripted adapter returns a typed proposal. and The trace records the effect and yields a safe stopping or resumption point., write down the missing step that connects them.
The loop checks authorization, remaining budget, and previous operation state.
Now take The loop checks authorization, remaining budget, and previous operation state. and the result above. Write an input and an implementation that could produce this trace.
A scripted adapter returns a typed proposal.. Check that your implementation produces the result shown above.
The process crashes after a note is saved but before the success event is appended. What should a recovering harness do?
Look up the original operation ID or retry through an idempotent interface with the same ID. Reconcile what was already committed before claiming success or making a new write.
Persist an intent with key W. The tool commits the note for W.
The event log lacks the tool result.
Two remaining steps are allowed. The same intent is unresolved.
What can a restarted harness infer from the log? How would you recover without adding a second note?
The log proves the intent was recorded, while the final outcome is still uncertain. Look up W at the tool boundary or retry with the same idempotency key before recording the recovered outcome. Count checking and retrying against the defined run limits.
A proposal is reversible until an effect commits. A durable operation ID and persisted event log let the harness reconcile the effect after a process interruption.
Use one scripted fixture where a note is stored and the process stops before logging completion. Predict what a fresh process should look up before it makes another write.
Provide a keyless test for success, a denied write, a budget stop, and safe recovery. Compare two harness revisions on the same inputs and present the trace and observed counts as evidence.
Arrange for the budget to run out during recovery. Explain whether lookup and re-execution have different costs and demonstrate that your policy bounds total effects.
Carry the loop's structured tool proposal into a registry boundary. The registry requires a text report ID before the tool can run.
Run the starter, predict the changed result, and then edit and run it again.
Replace numeric report ID 7 with the string R7. Check the result and count how many times the tool actually ran.
def read_report(report_id): return f"Report {report_id}" proposal = {"tool": "read_report", "arguments": {"report_id": 7}} registry = {"read_report": (str, read_report)} expected_type, operation = registry[proposal["tool"]] value = proposal["arguments"]["report_id"] if isinstance(value, expected_type): print(f"{operation(value)} | calls=1") else: print("Invalid arguments | calls=0")
Starter output
Invalid arguments | calls=0
Changed output
Report R7 | calls=1
Calling the function before checking the schema lets an invalid proposal reach the tool and can spend budget or change state.
Take the changed output into the next lesson and explain which part of the handoff the next lesson needs.
Begin with What an agent harness is. Each lesson offers these practice modes and a saved handoff.
Run keyless scenarios for confirmation, budget stops, and recovery after a durable write.
Use the campaign service starter from Software Lab. Follow each stage, collect the evidence, then move to the independent brief.
Model adapters, tool contracts, permissions, sessions, tracing, context and budgets, and regression testing.
One is free with no account, and a free account opens the rest.
Some lessons here build on earlier ones in the academy. The placement test can mark off what you already know, and you can open any of them first:
New to Python? Start with the free Python for AI course.
Finish every lesson and get staff approval on “Ship a recoverable report assistant” in My projects to earn the course certificate. Lessons you skip in the placement test count once you pass their phase's checkpoint.
Yes. There's nothing to pay, here or anywhere in the academy. A free account saves your progress and issues your certificate.
The lessons run in your browser. The downloadable service project uses a local Python environment.
About 11 hours in all, at your own pace. Your progress stays where you left it.
You completed the course and passed a staff-reviewed independent project, “Ship a recoverable report assistant”. See My projects for the brief, evidence requirements, and submission.
Or take the whole course: 575 lessons, from your first line of Python to production AI.
Learn Python from your first line of code to your first call to a language model, with nothing to install.
Learn to write prompts that work reliably, then test them like an engineer: clear instructions, examples, structured output, chains, evals and defenses against prompt injection.
Build retrieval-augmented generation step by step: embeddings, chunking, vector search, grounded answers with sources, and the measurements that tell you whether it works.
Learn how to build AI agents by building one: tools, the agent loop, MCP, permissions, context management and evals, ending with a coding agent that stops when its tests pass.
Go from counting letter pairs to a small GPT you train yourself: tokenizers, attention, transformer blocks and the GPT architecture, written line by line.
Go from your first line of code to working as a Python developer: projects, testing, data, databases, web apps and APIs, all in your browser.
Follow one prompt, "The cat sat", through a language model with every number shown: tokens to IDs, embeddings and positional waves, the attention matrix, the feed-forward layer, and the probability over the next word.
Confident wrong answers, miscounted letters, copying from the prompt, temperature, long prompts that dilute, and a model that never says "I don't know": each behavior reproduced on a tiny GPT with every number printed by code, then the mechanism behind it and the Phase 1 technique it justifies.
Read a model's weights, change them by hand and judge an edit someone else made: deltas, merging, low-rank edits, directions and fact edits on a tiny GPT in your browser. Then replay recorded sessions of an LLM reading, fixing and writing weights, check the published edit of a real open model, and ship a model of your own with its patch, verdict and card. Every number is printed by the lesson's own code, and the method's limits are taught with it.
Take a model from a notebook to a system that stays right: track and reproduce every run, search settings honestly, version data and models, promote through gates, keep training and serving in step, choose batch or online, catch drift, and retrain through a pipeline. Every number is measured by the lesson's own code.
Learn the math behind AI from arithmetic up: numbers, algebra, vectors and matrices, calculus, probability and statistics, each shown as numbers moving and checked in Python, ending with a network you build and train from the formulas.
Learn to make any letter of any formula the subject: layers undone in reverse order, fractions, a letter that appears twice, powers, roots, quadratics, logs, inequalities, trigonometry, vectors, matrices, calculus, probability, statistics and the formulas inside AI models, each checked in Python.
Design, test, deploy, and operate an HTTP API that another engineer can use.
Build a Model Context Protocol client and server, then verify the integration with a compatible host.
Never trained an AI? Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account. Teach it to write
A free account saves your progress across devices and issues your certificate when you finish.