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.

Browse Lessons (read-only)

What will you learn?

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

Read reviews of their learning experiences

love it

(5/5)
Ibraheem Abdel Haq profile image

Ibraheem Abdel Haq

Palestinian Territories

I really enjoyed working in a larger system and learning more about some Python standard lib like os, dotenv, sys, argparse. The agent was cool, though running out of usage was a pain on the free plan. If you can afford it, get the low cost plan to remove blockers.

(4/5)
Tony Smyth profile image

Tony Smyth

Pittsburgh, USA

The Gemini SDK requires you to buy $15 worth of gemini credits... Also the Gemini SDK is way too complicated for this course

(2/5)
K Sy profile image

K Sy

Japan

It's great project to work on -- a little challenging but enjoy it

(5/5)
Ahd Kalboneh profile image

Ahd Kalboneh

Palestinian Territories

Great course to do and learn about AI in Agentic mode

(5/5)
Allan Raphael Liwanag profile image

Allan Raphael Liwanag

Philippines

As someone that hasn't worked on any agents professionally. This course helped me understand start to finish what problems these agents can potentially solve, why that is a good or bad thing, and how we can go about making sure it's done correctly on the back-end.

(5/5)
Desmond Phillips profile image

Desmond Phillips

United States

This was good stuff!

(5/5)
Stevan Freeborn profile image

Stevan Freeborn

Olathe, Kansas

not gonna lie, a lot of fun what you can do with AI in backend

(5/5)
Jisair C54 profile image

Jisair C54

United States

Great course. I found it a littel terrifying at first, thinking I was creating a gremlin in my PC to run amok. But the course guides you through the safety steps.

(5/5)
Ken Hilliard profile image

Ken Hilliard

New Zealand

Showing 1-9 of 647

Browse Lessons (read-only)

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.