Loading video player…

Building an AI Agent With LangGraph and Python (Overview)

LangGraph is a versatile Python framework designed for stateful, cyclic, and multi-actor Large Language Model (LLM) applications. LangGraph builds upon its parent library, LangChain, and allows you to build sophisticated workflows that can handle the complexities of real-world LLM applications. Throughout this LangGraph video course, you’ll build a complete email-processing agent from the ground up.

By the end of this video course, you’ll understand that:

  • You can use LangGraph to build LLM workflows by defining state graphs with nodes and edges.
  • LangGraph expands LangChain’s capabilities by providing tools to build complex LLM workflows with state, conditional edges, and cycles.
  • LLM agents in LangGraph autonomously process tasks using state graphs to make decisions and interact with tools or APIs.
  • You can use LangGraph independently of LangChain, although they’re often used together to complement each other.

Follow along with the full video course to gain hands-on experience with LangGraph, including setting up workflows and building a LangGraph agent that can autonomously parse emails, send emails, and interact with API services.

While you’ll get a brief primer on LangChain in this video course, you’ll benefit from having prior knowledge of LangChain fundamentals. You’ll also want to ensure you have intermediate Python knowledge, specifically in object-oriented programming concepts like classes and methods.

Download

Course Slides (.pdf)

3.4 MB
Download

Sample Code (.zip)

24.5 KB

00:00 Hey, hello, and welcome to this video course that will show you how you can be building an AI agent with LangGraph and Python. Why should you be taking this course?

00:11 Well, I hope you agree that being able to build AI agents is a crucial skill that you should be adding to your AI toolkit. Also, this course will take you through a real-life example of a working agent, one that deals with email content.

00:28 In this LangGraph course, you’ll learn that LangGraph provides a framework for LLM agents, and so agents autonomously process tasks. Now, LangGraph allows you to build complex LLM workflows with conditional edges and cycles, which is great for modeling agents, and then LangGraph allows you to define state graphs with state, nodes, and edges.

00:53 Is there any useful knowledge you should have before tackling this course? Well, the agent you’ll be building uses an OpenAI LLM. Now, if you want to actually run the code, you’ll need an OpenAI API key, which at the time of recording wasn’t free.

01:11 Now, for completeness, whereas the course doesn’t cover this because of time constraints, it is actually possible to use a free LLM. At the time of recording, Google provided free models.

01:22 So if you don’t want to pay for an API key, there is an alternative route for you. Of course, without a key, you can still download the code and study it, you just won’t be able to run it.

01:35 Also, you’ll need to set up a virtual environment and persist your environment variable that holds your API key. I can show you how to get the API key and set up your environment if that’s a conundrum at the moment.

01:51 The agent uses something called a LangChain chain, and you’ll cover that very briefly. But if you want to fully grasp what’s happening there, you’d benefit from knowing the LangChain basics.

02:02 You should be familiar with OOP, in particular classes and inheritance. And then lastly, the code uses the built-in Logger class of the standard library, mainly to manage the output on screen, really, but it is quite intuitive, so I won’t spend any time on logger.

02:19 I’d rather spend time on the LangGraph agent. So if not logger, what will I be covering? Well, first I’ll be introducing agents, workflows, and state graphs.

02:30 Then I’ll help you on your way setting up your environment to then fully focus on building your agent. That’s what’s on offer today. My name is Steven Loyens.

02:41 I will be your tutor for this video course, and I’m very keen to get going, so I will see you in the next lesson.

Become a Member to join the conversation.