Skill area · Building AI Apps & Agents

Build AI apps and agents with Python

Connect LLMs to your code, your data, and your tools

Real Python shows you how to call models like GPT and Claude from Python, ground their answers in your own documents with RAG, and build agents that use tools through MCP. Follow a guided path, practice with real code, and get help the moment you’re stuck.

What you’ll be able to do

From your first API call to agents that use tools

You don’t need to train a model to build useful AI software. These are the skills that turn an LLM into a working Python application.

Call LLMs from Python

Send prompts to hosted models or run open models locally, and get structured, validated output back.

OpenAIClaudeOllama

Ground answers in your data

Turn documents into embeddings, store them in a vector database, and retrieve the right context with RAG.

ChromaDBLlamaIndexRAG

Build agents

Give models tools, memory, and state so they can plan, act, and work through multi-step tasks.

Pydantic AILangGraphCrewAI

Connect tools with MCP

Write MCP servers that expose your data and functions to any LLM client, and test them from your terminal.

MCPFastMCP
Your roadmap

A clear path from API call to AI agent

Work through these stages in order. Together they make up the LLM Application Development With Python learning path, which mixes tutorials, video courses, quizzes, and exercises and tracks your progress as you go.

  1. 1

    Connect to LLM APIs

    Call hosted models like GPT and Claude, run open models on your own machine, and switch between providers with one API.

  2. 2

    Craft prompts and use frameworks

    Write prompts that get reliable results, then use LangChain to template prompts and chain model calls together.

  3. 3

    Add retrieval-augmented generation

    Convert documents into LLM-ready text, store embeddings in a vector database, and build a chatbot that answers from your own data.

  4. 4

    Build AI agents

    Create type-safe agents with structured output, then add state and control flow for multi-step workflows.

  5. 5

    Connect agents to tools with MCP

    Expose your data and functions through an MCP server, and build a client to test servers from your terminal.

  6. Python Coding With AI

    Put AI to work on your own code: choose an editor or terminal assistant like Cursor or Claude Code, brief it with context files, and review what it writes.

    21 resources · Take it anytime

Want to understand how the models themselves work? Explore Machine Learning With Python. New to Python itself? Start with Python Basics first.

Try it now

Give an LLM a tool it can call

This is a real exercise from the Connecting LLMs to Your Data With Python MCP Servers video course, and it’s the same tool from the example above. Write your function, register it on the server, and click Run Tests.

Loading exercise...

Running tests, hints, and solutions are included with a Real Python membership. Not a member yet? You can still read the task and write your solution before you join.

Learn it every way

Read it, watch it, test it, practice it

Every AI topic comes in the formats that help it stick. Mix them however you like.

Mentor AI

Agent not calling your tool? Ask right where you are

AI code fails in new ways: a tool the model never calls, a prompt that returns the wrong format, a retrieval step that pulls in the wrong documents.

Mentor AI sees the tutorial, lesson, or exercise you’re on and your code, and nudges you toward the fix one hint at a time, so you understand how the pieces fit together.

Meet Mentor AI →
The modern AI stack

Learn the tools AI developers actually use

Model APIs, frameworks, vector databases, and protocols, each with a hands-on tutorial or course.

Fresh from the library

New and updated for 2026

AI tools change fast. The Real Python team keeps publishing and refreshing AI content, so what you learn matches the libraries and models you’ll use at work.

See all AI content →

Questions and answers

Do I need to know Python before I start?

You should be comfortable with Python basics like functions, dictionaries, and installing packages. If you’re not there yet, the Python Basics learning path gets you ready.

Do I need a machine learning background?

No. Building AI apps is about calling existing models and wiring them into your code, not training models yourself. If you want to learn how models work under the hood, Machine Learning With Python covers that side.

Do I need paid API keys?

Not necessarily. Hosted APIs like OpenAI and Claude require an account, but you can also run open models on your own computer with Ollama and follow along without a paid key.

Which framework should I learn first?

Start by calling a model API directly so you understand what every framework does for you. Then pick up LangChain or LlamaIndex for RAG, and Pydantic AI or LangGraph for agents. The roadmap above follows that order.

Does this cover AI coding assistants too?

Yes. The Python Coding With AI learning path covers tools like Cursor, Claude Code, and GitHub Copilot, and how to brief and review the code they write.

What’s included in a membership?

Every Real Python membership includes all video courses, quizzes, coding exercises, and learning paths for AI and every other topic, along with Mentor AI as it rolls out.

Start building with AI

Get your free learning plan and follow the full AI roadmap, with courses, quizzes, coding exercises, and a mentor at your side.