
Build Your First AI Agent in Python: Local, No API Key, One tool-using agent in plain Python with Ollama and qwen2.5:3b: tools, the loop, a stop rule, and a test that scores it.
Course Description
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.
