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,323 students in the Build an AI Agent in Python course

Read reviews of their learning experiences

I learned a lot! This is the best coding learning experience I've had in a minute. The instructions were just enough to get you to understand what you needed to do but leaving room to go out and learn on your on at the same time! Overall great learning experience.

(5/5)
Mohamed Elbana profile image

Mohamed Elbana

Egypt

Good course overall, though as usual frustrating to work in WSL

(4/5)
Adam Richardson profile image

Adam Richardson

United States

Fun course, it guides you through a very complex yet well designed course to eventually build your own ai-agent!

(5/5)
Max Yang profile image

Max Yang

United States

Great to follow through, slightly terrifying letting an AI project loose.

(5/5)
George Wallace profile image

George Wallace

Glasgow, Scotland

project really helps in giving insight on how these AI Code agents work and opens you up to the idea of building LLM agents for all kinds of things

(4/5)
Sajal Gupta profile image

Sajal Gupta

Chicago IL

I loved seeing this "agent" come to life but I definitely noticed the reduction in "hand-holding" compared to earlier courses. I felt lost a lot more often and had trouble understanding instructions or found them vague. It was fun overall, but could have benefitted from more "theory" I feel like.

(3/5)
Ismar Iljazovic profile image

Ismar Iljazovic

Zurich, Switzerland

Building an autonomous coding agent from scratch was a fantastic and genuinely exciting experience. Seeing the agent actually debug and fix code on its own by the end of the project felt rewarding and showcases how relevant this material is right now. That being said, the difficulty jump is brutal compared to the earlier Python basics. It really throws you into the deep end like a Spartan trial. Solving it felt almost impossible without pair programming alongside an LLM/assistant to understand

(5/5)
Jorbaty  profile image

Jorbaty

Kyiv, Ukraine

with this course , you also ending up being prompt engineer! but very deep and interesting course indeed!

(5/5)
Egide Tuyishime profile image

Egide Tuyishime

Rwanda

Interesting Course. But an option to do this course with a self hosted LLM would be great.

(3/5)
Max  profile image

Max

Germany

Showing 1-9 of 736

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.