We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

Build an AI Agent in Python

Build a tiny coding agent that can read files, edit code, run Python, and loop on feedback.

What you'll learn in this Python course

Write a toy agentic code editor in Python, similar to Claude Code or Cursor's Agent Mode. Understand how agents work from scratch by using free models on OpenRouter (via the OpenAI SDK) to create an LLM-powered code agent. You'll use function calling and feedback loops to build an agent that can find and fix bugs in a real project!

Chapter List

1
LLMs
Learn how LLMs work and send prompts to LLMs on OpenRouter using the OpenAI Python SDK
2
Functions
Write the functions your AI agent will need to modify files and run Python code
3
Function Calling
Give your AI agent the ability to call functions based on its system prompt and context window
4
Agents
Give your tool a proper feedback loop to make it truly "agentic" and fix a real bug

Join 18,907 students in the Build an AI Agent in Python course

Read reviews of their learning experiences

Built a mini Claude Code from scratch and it actually worked — 10/10, would let my code get fixed by a chatbot again.

(5/5)
Ahmad Dardouk profile image

Ahmad Dardouk

Palestinian Territories

A great hands-on course! Building an AI coding agent from scratch helped me understand AI agents, function calling, and how to connect different tools into a real project. Very practical and rewarding.

(5/5)
sara abu arra profile image

sara abu arra

Palestinian Territories

very useful and new informations thank you !

(4/5)
Areej Salah profile image

Areej Salah

Palestinian Territories

I liked it very much

(5/5)
çetin erdem profile image

çetin erdem

Dubai

I’ve wanted to learn how to build an AI agent for a long time, so I’m genuinely happy to have finally done it through this course. What I really enjoyed is that it wasn’t just about learning the theory — I got to actually build an AI agent step by step and understand how the different pieces work together. By the end of the course, I felt like I had built something real and professional, which made the experience even more rewarding. Definitely one of the courses I’m happiest to have completed

(5/5)
Leen Salahat profile image

Leen Salahat

Palestinian Territories

niiice

(5/5)
Maxwell McInnis profile image

Maxwell McInnis

Canada

Working with an Ai first hand was confusing but this lesson made it easy to understand. Was amazing!

(5/5)
Tsundere Dev profile image

Tsundere Dev

United States

The trickiest part for me was to make the correct enough sequence of words so that an agent finally fixes the gosh darn calculator!

(5/5)
Robert Johnson profile image

Robert Johnson

Nowhere

Very nice project, I learn how an agent works, thanks.

(5/5)
Doğan Can profile image

Doğan Can

Türkiye

Showing 1-9 of 762

or view more reviews

Mediocrity doesn't cut it anymore

The only way to become a great developer is to write a lot of code

Avoid tutorial hell

by writing a ton of code

Stay motivated with

a game-like curriculum

Build portfolio projects

to prove your skills

Delve deeper

into foundational concepts

Learn flexibly online

without interrupting your life

For 1% the price of college

to minimize your financial risk

Frequently asked Questions

Got questions? We've got answers

Yes! It's free to create an account and start learning. You'll get all the immersive and interactive features for free for a few chapters. After that, if you still haven't paid for a membership, you'll be in read-only (content only) mode.