Building an AI agent with langGraph (step by step tutorial)

MLOps.community · Intermediate ·🤖 AI Agents & Automation ·1y ago

Key Takeaways

This video tutorial demonstrates building an AI agent using LangGraph, a graph-based approach to orchestrate workflows, and integrating it with Plaid for credit card data access and Streamlit for application development.

Full Transcript

Hi, I'm Annie with the MLOps community and I am going to talk about how to pick a topic and build your first agent. So, if you've been hearing about agents and you don't know how to get started, but you'd like to dip your toes in the water, um this is a great start start tutorial for that. One of the first things that you need to do to develop an agent is find a problem that requires an agent framework. Even though you can incorporate rag and chat bots into your agent, one of the most important features is that you're giving the AI specific roles and those roles are making decisions at different points in your framework. There are many different frameworks for building agents but for the purpose of this tutorial I chose langraph. So langraph uses a graphbased approach to orchestrate workflows. Langraph also allows for fine grained control of your agent and it also gets you to a place where you could have an agent that is ready to be deployed. So I liked both of those features. That's why I chose to build my agent in Lingraph. First, I took the Langraph Academy course called Intro to Langraph. It's actually free at the time of recording this video, which is super useful and resourceful. Now, you can watch the entire training, but I would definitely focus on modules 1 through 4 just to get yourself started. These modules build upon each other and show you different features that Lang graph offers in order to be able to build an agent such as what states are in an agent, how to incorporate memory into your agent, and then also how to incorporate something like human in the loop. The module that I would definitely focus on once you make it through the videos in one through three is module four and especially this research assistant because Lang graph academy gives you this really great example of a an agent that you can use as a baseline or foundation to create your own agent and really understand what the agents are doing and how the code works. works. So then I reviewed the code from the langraph tutorial that built the research assistant AI agent. This was really cool because they set up several different roles like assistants and experts to basically interview each other on topics and then write an academic paper. So, this was a great um example of an agent and the code is really clearly laid out once you've sort of gotten familiar with the structure of langraph. I ended up deciding to take pieces of this code, especially the parts where the nodes and edges are built, and then build my agent off of that example code. So then I needed to think of, okay, what do I want my agent to do? I came up with an idea that would require the agent to perform several tasks, not just something that, you know, a chatbot could answer on the fly. And then I also wanted to use a data source that wasn't publicly available so that the the agent would have to get to know some data that it wasn't trained on. So, I chose my credit card data, which is thankfully not publicly available. I also wanted the agent to do something silly. So, I decided that I would create an agent that is a passive aggressive budget coach that is coaching me on all the credit card purchases that I make in my statement. So with a little bit of help from cursor, I took the research assistant agent code and then I sort of morphed it into a different agent that was focused on coaching me on my budget. As you can see, this is set up very similarly to the code from the research assistant. So first I I create the classes for the nodes that are going to be in my agent such as grabbing the transaction data um analyzing the transaction data and then interacting with the budget coach through using LLMs. Then I defined what the budget coach would do. So, pulling down transactions, analyzing them, and then looking at them against my monthly budget, and then coming up with some snarky comments about where I'm at with my budget thus far. I also determined that the agent would alert me when I reached a certain percentage of my budget. So lastly, I set up the nodes and edges of the agent so that the workflow of the agent would flow from analyzing the transactions, generating the summary for the transactions and then sending an alert. Langraph has this really nice feature called Langraph Studio where you can actually view the graph structure of your agent. So this sort of outlines the start of the agent. It analyzes your transactions, generates a summary, and then it ends. And it will send an alert based on certain conditions. In this case, if I've spent up to 80% of my monthly budget, you can check out my code for this in a GitHub repo that is posted in the description of this video. One other quick thing, credit card companies won't provide individuals with APIs to access their credit card data. So, I subverted this by using Plaid, which you can basically use Plaid to log into your credit card account and pull data from your statements that way. Plaid has a really convenient Python library that allows you to do this. And the thing that you need for it is first of all to get a plaid account and then to log in and uh basically grab their API key which will allow you to be able to log into your bank account. For the purpose of this tutorial, I'm just using the sandbox environment in Plaid, which contains fake credit card data. Uh, which that's where this username and password is for. Um, you can grab API keys under this keys section, which I won't do right here because it will reveal my keys. But there's a key for both the sandbox environment and the production environment. and the production environment will allow you to get your actual credit card data from your accounts and you can log into that. I didn't want to put my credit card data on this video. So, uh, for now we're using some fake data. So then I set up a a specific script that uses the Plaid Python library to pull down transactions for the past 30 days and then it categorizes those transactions based on the descriptions in the transactions. And this feeds back to the agent itself. Lastly, I really wanted to be able to see my agent in an application so that I could sort of maybe use a little bit of human in the loop with it. So, I created a Streamlit app that made this budget coach come alive and that's what's running right here. So, if you can see now that I'm running this locally, um, okay, welcome to your passive your passive aggressive budget coach. I'll analyze your spending habits and provide some constructive feedback. So, great. And so, I have this set to 5,000 because I want for the purpose of this example to show you what it does when you're at 80% of your budget. Um, so this is using fake data. You can click here and it will show a spending summary. Um, this takes a little bit to run, but it also sends out this alert to my email. And this says, uhoh, spending alert. Your budget was 5,000, but you're almost reaching that 5,000, and this is how much you have remaining. And then it gives its uh sarcastic kind of snarky comments about things that I've spent money presumably on. Apparently I spent $300 on a pair of sneakers. So yeah, I think this is kind of the overall goal of the budget coach. I think my next steps for this agent would be to use more of the human in the loop features that Langraph offers to just play around with changing states and also to deploy it on more than just a local machine. Now that you've seen me walk through setting up my own agent, you can try this for yourself. go through the Lang graph tutorial or just skim through it if you don't have a ton of time and then use some of the langraph code available in this tutorial to think of your own idea and just spin up a prototype of your your first agent. And stay tuned in to the MLOps community for more rad content on agents.

Original Description

🚀 Ready to build your first AI Agent? If you've heard about AI agents but don't know where to start, this tutorial is for you! Join Annie from the MLOps community as she guides you through picking a topic and building your very first agent using LangGraph. In this video, you'll learn: Why Use an Agent Framework: Understand the types of problems best suited for AI agents and why frameworks like LangGraph are powerful tools. Discover how agents use AI roles for decision-making. Getting Started with LangGraph: Learn why LangGraph was chosen for this tutorial, focusing on its graph-based workflow orchestration and fine-grained control, making your AI agents deployment-ready. Learning Resources: Leverage the free "Intro to LangGraph" course from LangGraph Academy (Modules 1-4 recommended) to grasp concepts like state, memory, and human-in-the-loop integration. Practical Example - Research Assistant: See how the LangGraph research assistant example provides a solid foundation for building your own AI agents. Building a Budget Coach Agent: Follow along as we build a unique, passive-aggressive budget coach AI agent. This example demonstrates: Defining tasks and roles for the agent. Using non-public data sources (like credit card data via the Plaid API sandbox). Setting up nodes and edges in LangGraph. Visualizing the agent's structure with LangGraph Studio. Handling data securely (using Plaid's sandbox environment). Integrating with Python libraries (Plaid). Creating an Interface: See how to bring your AI agent to life with a Streamlit application for interaction. Next Steps: Get ideas for enhancing your AI agent with human-in-the-loop features and deployment strategies. Whether you're new to AI agents or looking to explore frameworks like LangGraph, this video provides a practical walkthrough to get you started. Join the mlops community: mlops.commuity/join
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from MLOps.community · MLOps.community · 0 of 60

← Previous Next →
1 Our 1st MLOps Meetup // Luke Marsden // MLOps Meetup #1
Our 1st MLOps Meetup // Luke Marsden // MLOps Meetup #1
MLOps.community
2 Remote Collaboration as a Data Scientist
Remote Collaboration as a Data Scientist
MLOps.community
3 MLOps Manifesto with Luke Marsden from Dotscience
MLOps Manifesto with Luke Marsden from Dotscience
MLOps.community
4 MLOps lifecycle description
MLOps lifecycle description
MLOps.community
5 What Does Best in Class AI/ML Governance Look Like in Fin Services? // Charles Radclyffe // MLOps #2
What Does Best in Class AI/ML Governance Look Like in Fin Services? // Charles Radclyffe // MLOps #2
MLOps.community
6 Life purpose and too many spreadsheets
Life purpose and too many spreadsheets
MLOps.community
7 Explainability, Black boxes and EU white paper on reproducibility
Explainability, Black boxes and EU white paper on reproducibility
MLOps.community
8 Hierarchy of Machine Learning Needs // Phil Winder // MLOps Meetup #3
Hierarchy of Machine Learning Needs // Phil Winder // MLOps Meetup #3
MLOps.community
9 Automatically Retrain Machine Learning Models? Are best practices worth it?
Automatically Retrain Machine Learning Models? Are best practices worth it?
MLOps.community
10 Building an MLOps Team? Key ideas to keep in mind
Building an MLOps Team? Key ideas to keep in mind
MLOps.community
11 Hierarchy of MLOps Needs
Hierarchy of MLOps Needs
MLOps.community
12 Bare necessities for getting an ML model into production
Bare necessities for getting an ML model into production
MLOps.community
13 MLOps and Monitoring
MLOps and Monitoring
MLOps.community
14 How Phil Winder got into Data Science and Software Engineering
How Phil Winder got into Data Science and Software Engineering
MLOps.community
15 Provenance and Reproducibility in Machine Learning; what is it and why you need it?
Provenance and Reproducibility in Machine Learning; what is it and why you need it?
MLOps.community
16 Friction Between Data Scientists and Software Engineers
Friction Between Data Scientists and Software Engineers
MLOps.community
17 MLOps Problems in different size companies
MLOps Problems in different size companies
MLOps.community
18 ML tooling in large companies
ML tooling in large companies
MLOps.community
19 ML Platforms - The build vs buy question
ML Platforms - The build vs buy question
MLOps.community
20 ML Services Gateway at SurveyMonkey
ML Services Gateway at SurveyMonkey
MLOps.community
21 Message buses, Async and sync architecture
Message buses, Async and sync architecture
MLOps.community
22 MLOps #4: Shubhi Jain - Building an ML Platform @SurveyMonkey
MLOps #4: Shubhi Jain - Building an ML Platform @SurveyMonkey
MLOps.community
23 Hybrid Data Science Teams @SurveyMonkey
Hybrid Data Science Teams @SurveyMonkey
MLOps.community
24 How do you handle ML version control at SurveyMonkey
How do you handle ML version control at SurveyMonkey
MLOps.community
25 Doing ML with Personal Information
Doing ML with Personal Information
MLOps.community
26 Evolution of the ML feature store @SurveyMonkey
Evolution of the ML feature store @SurveyMonkey
MLOps.community
27 Developing a Machine Learning Feature Store
Developing a Machine Learning Feature Store
MLOps.community
28 Auto retrain ML models is not the question
Auto retrain ML models is not the question
MLOps.community
29 3 key parts to Machine Learning monitoring
3 key parts to Machine Learning monitoring
MLOps.community
30 MLOps Meetup #6: Mid-Scale Production Feature Engineering with Dr. Venkata Pingali
MLOps Meetup #6: Mid-Scale Production Feature Engineering with Dr. Venkata Pingali
MLOps.community
31 MLOps meetup #5 High Stakes ML: Active Failures, Latent Factors with Flavio Clesio
MLOps meetup #5 High Stakes ML: Active Failures, Latent Factors with Flavio Clesio
MLOps.community
32 MLOps: Airflow Pros and Cons
MLOps: Airflow Pros and Cons
MLOps.community
33 Specific challenges in Machine Learning
Specific challenges in Machine Learning
MLOps.community
34 Current State Of Machine Learning
Current State Of Machine Learning
MLOps.community
35 Humans in the Loop are a defining factor in Machine Learning
Humans in the Loop are a defining factor in Machine Learning
MLOps.community
36 Learning from real life Machine Learning failures
Learning from real life Machine Learning failures
MLOps.community
37 Survivorship Bias in machine learning tutorials
Survivorship Bias in machine learning tutorials
MLOps.community
38 Swiss Cheese model in Machine Learning
Swiss Cheese model in Machine Learning
MLOps.community
39 Resume driven development in Machine learning & software engineering
Resume driven development in Machine learning & software engineering
MLOps.community
40 Who has the highest standards in ML?
Who has the highest standards in ML?
MLOps.community
41 Venkata Pingali of Scribble Data Thoughts on the Current State of Machine Learning
Venkata Pingali of Scribble Data Thoughts on the Current State of Machine Learning
MLOps.community
42 Dependable data and being able to Trust in your Data with Venkata Pengali of Scribble Data
Dependable data and being able to Trust in your Data with Venkata Pengali of Scribble Data
MLOps.community
43 Speed, Trust, Evolution and Scale in MLOps
Speed, Trust, Evolution and Scale in MLOps
MLOps.community
44 More difficult transition for data scientists to become ML engineers
More difficult transition for data scientists to become ML engineers
MLOps.community
45 How many models in prod til I need a dedicated ML platform?
How many models in prod til I need a dedicated ML platform?
MLOps.community
46 Deeper thinking from data scientists around platform blackholes
Deeper thinking from data scientists around platform blackholes
MLOps.community
47 Checkpointing, metadata, and confidence in your data
Checkpointing, metadata, and confidence in your data
MLOps.community
48 Adjacent usecases and multistep feature engineering
Adjacent usecases and multistep feature engineering
MLOps.community
49 Standardization of Machine Learning tools like in Software Engineering with Venkata Pingali
Standardization of Machine Learning tools like in Software Engineering with Venkata Pingali
MLOps.community
50 Reproducability flaws in end to end Machine Learning debugging
Reproducability flaws in end to end Machine Learning debugging
MLOps.community
51 3rd wave of data scientists
3rd wave of data scientists
MLOps.community
52 MLOps meetup #7 Alex Spanos // TrueLayer 's MLOps Pipeline
MLOps meetup #7 Alex Spanos // TrueLayer 's MLOps Pipeline
MLOps.community
53 MLOps Meetup #8 Optimizing Your ML Workflow with Kubeflow 1.0
MLOps Meetup #8 Optimizing Your ML Workflow with Kubeflow 1.0
MLOps.community
54 Are Kubeflow and Airflow complementary?
Are Kubeflow and Airflow complementary?
MLOps.community
55 Why Kubeflow gained so much traction=open community
Why Kubeflow gained so much traction=open community
MLOps.community
56 Who decides the dirrection of Kubeflow
Who decides the dirrection of Kubeflow
MLOps.community
57 What do Kubeflow and Arrikto do and how do they work together?
What do Kubeflow and Arrikto do and how do they work together?
MLOps.community
58 Versioning your ML steps with Kubeflow
Versioning your ML steps with Kubeflow
MLOps.community
59 Machine Learning Lifecycles//Perception vs Reality
Machine Learning Lifecycles//Perception vs Reality
MLOps.community
60 Kubeflow vs SageMaker in Machine Learning
Kubeflow vs SageMaker in Machine Learning
MLOps.community

This video tutorial guides viewers in building their first AI agent using LangGraph, covering topics such as picking a problem, building a graph-based workflow, and integrating with external services like Plaid and Streamlit.

Key Takeaways
  1. Take the LangGraph Academy course to learn the basics
  2. Review the research assistant agent code
  3. Choose a problem and design a workflow
  4. Build the agent using LangGraph
  5. Integrate with Plaid for credit card data access
  6. Develop a Streamlit application
  7. Test and deploy the agent
💡 Using a graph-based approach like LangGraph can simplify the development of complex AI workflows and enable easier integration with external services.

Related Reads

📰
AI Was Supposed to Lift Everybody. Right Now, the Price Tag Says Otherwise.
AI agents can be prohibitively expensive, with some costing $300 for 2 hours of work, highlighting a significant pricing issue
Medium · AI
📰
MCP rug-pulls: how a "safe" AI tool turns malicious after you approve it
Learn how a 'safe' AI tool can turn malicious after approval and how to protect against MCP rug-pulls
Dev.to · Wes Ellis
📰
You Can’t Even Control Your Hermes Agent, So Stop Trying to Control Everything in Your Life
Learn to let go of control in life by understanding the limitations of controlling AI agents like Hermes
Medium · AI
📰
Can AMD break the CUDA Moat? AMD Advancing AI 2026
AMD aims to break NVIDIA's CUDA dominance with advancements in AI, but faces challenges in software quality and production ramps
Semi Analysis
Up next
Build Agentic AI End-to-End Real-Time Projects | 2026
Rajeev Kanth | BEPEC
Watch →