
A real run: the agent checks a 120 EUR hotel night against a made-up company policy with two tools and answers VERDICT: WITHIN. What an agent is (a model, tools, a loop), the expense-check job used through the course, and the plan. Every run was recorded for real on 28 November 2026.
Install Ollama and qwen2.5:3b (1.9 GB, no GPU, no key), run the 18 offline tests, read the 46-line client, and see what a plain model call does with a question about your company (the real answer is in the video). Includes the error you get when Ollama is not running, and the fix.
A tool is a Python function plus a description. See the exact tool call qwen2.5:3b sends back, run it with a small safety layer, and learn why the model never runs anything itself.
About a dozen lines that turn a tool request into an answer, the four messages that are the agent's whole memory, and the finished run_agent function with a system message and a fixed verdict line.
Add a currency tool with fixed course rates. The model calls both tools in the same step (parallel tool calling) and gets two real claims right. Why two right answers prove less than they seem.
A broken tool on purpose, three stop rules (an answer, the same call twice, a step budget), a clean give-up with VERDICT: UNKNOWN, and tests with a fake model that prove the rules without Ollama.
Ten expense questions with answers worked out by code, a scorer that reads the verdict line and the tools used, and the real result: 5 of 10, with the right tools every time. The two kinds of failure, case by case.
A first fix that failed (dependent tool calls fired in parallel, with made-up dollar amounts), then the fixes that held: one tool that converts and compares in code, invented arguments dropped, no guessing after an error, and a verdict written by code: 10 of 10. Then four new questions (0 of 4, then 2 of 4) and the 0.5B model. One correction to the narration: only the parking question (case 12, filed as taxi) is the model's reading. The missed "two nights" (case 13) was a gap in our v2 tool, which had no way to take a number of nights; the model's own answer says "for two nights".
Your turn: fix the per-night total and the wrong-category answers with code, then run all 14 questions and four holdout questions written after the fix was frozen (a small sample, written by the same author as the fix). Our solution and its real scores are in the video and in the course files (agent_v3).
This course contains the use of artificial intelligence.
Build one real, tool-using AI agent in plain Python, run it on a free local model, and test it with code. No API key, no paid account, no GPU, no framework.
The job is one you would see at work: an expense assistant that checks a claim against a company policy, such as "A hotel night cost 120 EUR. Is that within policy?". The agent asks for tools, our code runs them, and the loop continues until it can answer WITHIN, OVER or UNKNOWN.
What you build, step by step
A plain model call with Ollama and qwen2.5:3b, and why it cannot answer questions about your company
One tool: a Python function plus a description, and the exact tool call the model sends back
The agent loop: run the tool, send the result back, repeat until the model answers
A second tool, and how the model chooses and combines tools
Stop rules: an answer, the same call twice, a step budget, and a clean give-up instead of a guess
A 10-question test scored by code, and the details of every failure
What breaks, and fixes you can trust because code makes the decisions
Real runs, honest numbers. Everything you see was recorded on 28 November 2026 on a 2-core cloud machine with no GPU. The first version of the agent used the right tools in 10 of 10 test questions and still got only 5 of 10 verdicts right. After the fixes in lessons 8 and 9, the same free model scored 14 of 14 on our test questions and 4 of 4 on four holdout questions written after the fix was frozen (a small sample). The course shows the failures as well as the fixes, because that is how you learn to build agents that work.
Real AI, tested for real: every result is measured, nothing is made up.
Who this is for: Python beginners and developers who want to understand how an AI agent really works by building and testing a small one, before moving on to frameworks and production tools. You need basic Python and a computer with about 4 GB of free memory.
The course files (standard-library Python plus offline tests) are shown in every lesson. The policy, the exchange rates and every claim are made up for the course.
Ollama, Qwen and Alibaba Cloud are trademarks of their owners; this course is not affiliated with or endorsed by them.