Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
LangChain 20 Drills: Build AI Agents with create_agent & RAG
14 students

LangChain 20 Drills: Build AI Agents with create_agent & RAG

End "I hear about AI agents but can't build one." 20 drills from LLM calls to tools, RAG and memory, in-browser.
Created byM Sakai
Last updated 8/2026
English

What you'll learn

  • Initialize an LLM with `init_chat_model`, use `invoke`, `stream`, and system prompts as needed, and understand why the return value is an AIMessage, not text.
  • Inject variables with prompt templates and receive replies as typed data via `with_structured_output` and Pydantic, designing output your program can use.
  • Write your own tools with `@tool`, understand how the docstring becomes the LLM's instructions, and assemble agents that wield them with `create_agent`.
  • Build an agent with multiple tools, read tool_calls from the message history to trace what it thought and called, and chase the cause when it doesn't work.
  • Understand every RAG stage—loading, splitting, embedding, and similarity search over a vector store—and build a QA bot over your notes or internal documents.
  • Wrap RAG retrieval in `@tool` and integrate it into an agent, letting the agent decide whether to search or calculate—a structure close to real-world work.
  • Give a chatbot memory with `checkpointer` and `thread_id`, isolating history per user, and explain why an LLM forgets a conversation in the first place.
  • Merge tools, RAG, memory, and structured output into one conversational mini AI assistant that searches, calculates, and closes with a JSON summary report.

Course content

8 sections • 49 lectures • 2h 55m total length
  • Introduction and Course Structure7:24
  • Link to the CodeSandbox for the exercise0:10
  • Official CodeSandbox Link0:11

Requirements

  • Able to read and write basic Python (variables, functions, classes, `import`, list comprehensions, `with` statements). No library knowledge needed.
  • A PC with an internet connection and a modern browser (Chrome recommended) is all you need. We use CodeSandbox, so there is no Python install or setup at all.
  • Able to obtain one Gemini API key in Google AI Studio (free tier, no credit card). Section 0 walks you through the steps.
  • No AI or LLM development experience required. Having used something like ChatGPT is plenty. No mathematical background in machine learning is needed either.

Description

This course contains the use of artificial intelligence.

"I keep hearing about AI agents. I can run the demos. But the moment I try to shape my own idea, I freeze." — This course exists to get you out of exactly that state.

LangChain is a common layer that lets you write against any LLM the same way. And in 1.x, agent development has been consolidated into a single function: create_agent. Hand it a model, some tools, and memory, and you get an agent that decides on its own to call a tool, remembers the conversation, and searches documents when it needs to. This course builds those parts up one at a time, hands on, through 20 practical drills.

Learning follows a roadmap of 7 chapters. Once Section 0 has your environment ready, Section 1 nails the foundation: calling an LLM, streaming, and system prompts. Section 2 covers prompt templates and the technique that pays off most in real work—structured output, receiving the LLM's reply as a Python type (Pydantic) instead of a string—carried all the way through to building your own review analyzer.

Section 3 is the peak of the course: tools and agents. The "magic" that agents look like to so many learners is taken apart, starting from how a @tool decorator's docstring becomes the LLM's instructions. You'll build an agent that picks between a calculator and a unit converter with create_agent, then peek into the message history to see what the agent thought and which tool it called—the basics of debugging.

Section 4 covers RAG (answering by searching) end to end. Loading and splitting documents, similarity search over embeddings and a vector store, a QA bot that answers questions about fictional company rules, and finally wrapping retrieval in @tool to integrate it into an agent—the "it clicked!" moment where Section 3 and RAG connect. In Section 5 you give a chatbot conversational memory (checkpointer and thread_id) so it remembers the name you just gave it, and in the final Section 6 you merge every part into a conversational mini AI assistant that searches, calculates, and emits a structured report.

No environment setup required. Using CodeSandbox, you run everything from your first LLM call through RAG and agents in the browser alone. No Python install either. And the Gemini free tier alone carries you to the finish (no credit card required). Without paying for a single API, you can run all 20 drills with your own hands.

Not just becoming able to run samples, but becoming able to design your own agents. That is the goal of this course.

Who this course is for:

  • Engineers and learners who can write Python but don't know how to build AI agents or LLM apps, and aren't sure where to start.
  • Those who have touched the ChatGPT API but bounced off LangChain because old articles and v1 contradict each other—or who want to start now.
  • Anyone who knows the words RAG and AI agent but wants to actually get hands on and understand how they work from the mechanics up.
  • Individual developers and students who want to experience AI development end to end on the free tier, without paying for an API.
  • Those who want a solid LangChain 1.x foundation before moving on to more advanced agent development such as LangGraph or CrewAI.