
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Write a complete, working agent in about 20 lines of plain Python with no frameworks, using a five-part observe–decide–act loop and a final answer marker. Module 1 expands this into a reusable agent class with tools, memory, planning, and evaluation.
This course contains the use of artificial intelligence.
An AI agent is just an LLM in a loop that chooses its own next action. Once you can write that loop — about twenty lines of plain Python — every "agent framework" on the market stops being magic.
This course is the un-magic. You build your own agent framework from scratch, one concept at a time, and walk away understanding every line of it — and able to read LangChain, CrewAI, or AutoGen like an open book.
What you'll build, across nine short modules: the reusable agent loop with a correct stopping condition; tool use from scratch (parse, a registry and dispatch, and graceful handling when the model invents a tool); three kinds of memory — working, episodic, and semantic retrieval you build with your own cosine similarity in numpy; planning with ReAct, reflection-and-retry, and a real beam-search tree-of-thoughts; multi-agent systems with a coordinator and a delegation cap so it can never loop forever; evaluation — the part almost no course teaches — a harness, the three metrics that matter, a failure taxonomy, and regression diffs; production hardening with cost and step caps, structured logging, and tool guardrails; and a capstone that consolidates it into one clean API and builds a flagship agent end to end.
Honest about scope: "from scratch" means you build everything that turns a model into an agent. The one black box we keep is the language model and its embeddings, called through a thin wrapper. It's about 1,300 lines of pure Python — numpy and a provider client only. No LangChain, no vector database.
You need solid Python and to have called an LLM API once. You do not need any machine-learning math — the one bit, a dot product, is taught from scratch. By the end you won't just have working code; you'll have the judgment to design agents that don't burn money or fail silently, and you'll understand what every framework on the market is really doing.