Hands down the best LangGraph tutorial I've seen. I'd love to see a video where you break down how to create a customer service chatbot that can do generic replies based on internal policy documents (RAG) as well as use different tools to fetch customer information.
LangGraph teams examples are pretty advanced for a beginner like me, your approach of using simple functions without llms explained things a lot simpler. Huge respect for that!
Misbah, this is a wonderful introduction to LangGraph. I feel I found a gold mine in your channel among the noisy UA-cam space of LangChain tutorials. Thank you very much!
I know some langchain. I wanted to learn langgraph. This is best fucking video. Simple yet great. People should donate at least few $, when we see useful video like this.
Thank you for a very informative video - I really liked how the concepts are developed on top of each other and explained from simple to more complex! I have a question about ToolInvocation: 19:35 - A SINGLE tool is bound to the model 21:50 - Passing the arguments to ToolInvocation: - What if there was more than one tool bound to the model? - Does LLM make the right tool selection? - How do we ensure that the right tool is invoked?
Excellent work. When every other video used the documentation to explain, your ground up approach is what made me to understand the concepts. Pls continue the same style for your other videos as well
Thanks for this good introduction to LangGraph, it's very approachable from the beginning. 10 minutes in and I'm getting nauseous from zooming in and out though (watching on my TV, stated at a reasonable distance)
Really nice explanation. Thanks. This obvs needs to be changed to accommodate open-source models that don't honour function calls, but not so hard to customise it to make that work
Awesome and very well explained. Usually prefer the js version of langchain but also a good foundation to transfer from python to javascript. Thank you!
Very good explanation on Langgraph. Thank you so much OpenAI API isn't free though. Would be even better if you have a version of this tutorial that uses another LLM, like Gemini or Lllama3. For those of us that just wants to learn.
Great step by step breakdown! Finally I can make abit sense of langraph. But the conditional edge section is still abit confusing. why the need to bind and then calling out the toolexecutor again. What does each of these do?
Hi, First of all: THANKS, great video. But I have a funny remark/question. I saved each version of the code I build along with you. At 16:42 in the video you came up with the actual temperature in Vegas. I wrote exactly the same code but I tested with the city "Bouillon" (in Belgium). I tested more than once, just slightly changing the wording (like adding uppercase, a final stop to a sentence ...) then reverting to exactly what you wrote. Even that results in (small) differences in the output (which is strange). - in my slightly different wording, I got as a result "The current temperature in Bouillon is not available". - when I aligned to you, I got a much richer answer (which I didn't ask for in fact), please see for yourself the "debugging" transcript (below) - when I retested this last (strongly aligned to your formulation) version on the city of "Buggenhout" (other region of Belgium), I didn't get no cultural explanations, like I got for the city of "Bouillon" - how weird is that? For not being able to give me a temperature for Bouillon the soft makes up some other info as an apology, but not for "Buggenhout"? It may seem funny, but how trustworthy is this approach? You insisted on being concise, no? (or should we have insisted on returning only temperature and nothing else?) Finally I tested with "Las Vegas", and there I got the expected result, like you did. My conclusion is that the weather API only covers United States and not Europe? But despite that fact, it's an interesting experiment, don't you think so? Kind regards - Marc. -------------------------------- "debugging" transcript when testing the tool with a European city (and in particular "Bouillon") instead of one in the US ----------------------------------------------- The current temperature in Bouillon is not available as it may vary depending on the time of year and weather conditions. It is recommended to check a reliable weather website or app for the most up-to-date information. Output from node 'agent': --- {'messages': ['What is the temperature in Bouillon?', 'Bouillon']} --- Output from node 'tool': --- {'messages': ['What is the temperature in Bouillon?', 'Bouillon', 'In Bouillon, the current weather is as follows: Detailed status: overcast clouds Wind speed: 7.4 m/s, direction: 175° Humidity: 86% Temperature: - Current: 8.92°C - High: 8.92°C - Low: 8.92°C - Feels like: 5.43°C Rain: {} Heat index: None Cloud cover: 100%']} --- Output from node 'responder': --- The current temperature in Bouillon is not available as the specific location is not provided. Bouillon is a city in Belgium known for its medieval castle and scenic views along the Semois River. For the most accurate and up-to-date temperature in Bouillon, it is recommended to check a reliable weather website or app. --- Output from node '__end__': --- The current temperature in Bouillon is not available as the specific location is not provided. Bouillon is a city in Belgium known for its medieval castle and scenic views along the Semois River. For the most accurate and up-to-date temperature in Bouillon, it is recommended to check a reliable weather website or app. ---
Thank you so vey much for this tutorial. It's much better than what the langchain's channel is doing. But, kill me, I still do not understand how conditional edges work. I still do not understand how/why the app or the llm decided to run the weather retrieval? Why exactly the model decides to use the OpenWeatherMapQueryRun tool in function 1? So the flow of the code only depends on whether the model somehow decided if tool was called or not? If we are only relying on the decision making of the model on whether to call a tool or not, without prompting it or anything like that, how can the code graph execute reliably? I can imagine a dozen of ambiguous questions where the model will not be able to decide whether to use tool or not or which tool to use. Imagine we have a tool to find out what the temperature is and another tool that tells whether it is raining or not. Then the question "What is the weather in Las Vegas?" will not yield predictable results. We probably would need to add some kind of intermediary node that would ask if the user is asking about temperature or precipitation. For that just the presence of "function_call' in additional kwargs would not be enough... I am sorry, I am just so extremely confused with langchain and the logic of their classes. Thank you so very much in advance for the response!
Thanks for sharing knowledge in the simplest way ^^ I just wanna ask you about if i use chat_HF how i can convert tools to be bind in model ? because there is no function for convert to hf_function !
It doesn't, but for someone like me, that started using CrewAI before I got comfortable with LangChain, this is a very good way for me to get a better understanding of how I would use LangChain to build something like CrewAI. This is the best introduction to LangGraph that I have ever seen, and I am thankful for that, because using a graph to model collaboration of LLMs seems like a very powerful pattern.
up to minute 19:21 everything is perfect and (for me) flawless. From “Understanding Conditional Edges in LangGraph” onwards it became chaotic. The constant zooming in and out makes my head hurt. These notebooks are basically disgusting and because of the constant scrolling up and down is impossible to follow 😥
The documentation on LangChain/LangGraph is horrible for beginners. Thank you so much your video was much more helpful. Too bad the TS library isn't very typesafe and contains a bunch of python concepts in the source (like kwargs)
Thanks! Excellent introduction and steps.... Best if you can reduce the frequent zooming in-out-in... makes me dizzy when it is overdone and I can't continue to watch anything further. I know it is fun but I feel like vomiting after 20mins into the video.
Thanks for your nice explanations. But the zoom-in zoom-out is pretty annoying. specially when watch on 1.5x plus speed. I couldn't tolerate to the end and skipped most parts.
Great explanation. Things to improve: consider zooming in and out less as it is quite distracting. Speak slowly as you are going fast and for people utterly new to this it may be too fast. You have literally no pause in speaking. At no point do you have silence, if only for a second, to give the viewer time to reflect a little. Your delivery is hence very monotonous. All of this combined hinders the otherwise great content you provide. I'm subscribing nonetheless :)
OK, with regards to the bug I mentioned before ... I found out that [_arg1] had to be [__arg1] ... When I run the application, now I get another error: raise InvalidUpdateError( langgraph.channels.base.InvalidUpdateError: Invalid state update, expected dict with one or more of ['messages'], got I'm going to have a good sleep and maybe tomorrow I'll figure out what I might have done wrong. Of course, having the correct source code would help enormously. (by the way: where do we find the theoretical foundation for all these primitives used in the code, because the last version was a serious jump, I kind of get the big picture, but I miss a few smaller steps) Thanks, Marc
Here is a corrected version of the function2: def function_2(state): messages = state['messages'] print("messages: ", messages) last_message = messages[-1] # this has the query we need to send to the tool provided by the agent print("last_message: ", last_message) parsed_tool_input = json.loads(last_message.additional_kwargs["function_call"]["arguments"]) print("parsed_tool_input: ", parsed_tool_input) # Check if 'args' exists and is not empty if 'args' in parsed_tool_input and parsed_tool_input['args']: tool_input = parsed_tool_input['args'][0] else: raise ValueError("Missing or empty 'args' in parsed tool input") # We construct an ToolInvocation from the function_call and pass in the tool name and the expected str input for OpenWeatherMap tool action = ToolInvocation( tool=last_message.additional_kwargs["function_call"]["name"], tool_input=tool_input, ) # We call the tool_executor and get back a response response = tool_executor.invoke(action) # We use the response to create a FunctionMessage function_message = FunctionMessage(content=str(response), name=action.tool) # We return a list, because this will get added to the existing list return {"messages": [function_message]}
this is by far the simplest tutorial i have seen for langgraph
Hands down the best LangGraph tutorial I've seen. I'd love to see a video where you break down how to create a customer service chatbot that can do generic replies based on internal policy documents (RAG) as well as use different tools to fetch customer information.
The way explained solved my everydoubt in langgraph and I can understand the whole flow of langgraph. Thanks !!!
One of the best explanations on lang graph. Period.
Br. Nisbah this is the simplest, clear and concise explanation. JAK.
Excellent! The most didactic class on UA-cam! Thank you. ❤
Excellent explanations! Breaking it down to the simple cases in the beginning really helped me to grasp the concepts behind LangGraph!
LangGraph teams examples are pretty advanced for a beginner like me, your approach of using simple functions without llms explained things a lot simpler. Huge respect for that!
Thanks!
This is best introduction to langgraph so far. Thanks!
Best introductory video on LangGraph! Thank you!
Misbah, this is a wonderful introduction to LangGraph. I feel I found a gold mine in your channel among the noisy UA-cam space of LangChain tutorials. Thank you very much!
Thank you so much 🙂
EXCELLENT Tutorial. Perfect for grasping the concept. Thank you very much for putting the work into it!
You're very welcome!
the best langgrpah introduction tutorial ever! the Langgraph staff should replace their messy getting started with this clean one :)
I know some langchain. I wanted to learn langgraph. This is best fucking video. Simple yet great. People should donate at least few $, when we see useful video like this.
Thanks a lot!
Thank you for a very informative video - I really liked how the concepts are developed on top of each other and explained from simple to more complex!
I have a question about ToolInvocation:
19:35 - A SINGLE tool is bound to the model
21:50 - Passing the arguments to ToolInvocation:
- What if there was more than one tool bound to the model?
- Does LLM make the right tool selection?
- How do we ensure that the right tool is invoked?
This is the best LangGraph tutorial.
Thank you for sharing.
Really great stuff! Best breakdown of langgraph on UA-cam I’ve seen
Very clear and easy to understand. I liked how you started you explain each feature as you went alot. It really helped. thank you
Thanks. Finally someone explains one by one.. 👍
Excellent work. When every other video used the documentation to explain, your ground up approach is what made me to understand the concepts. Pls continue the same style for your other videos as well
Thanks for this good introduction to LangGraph, it's very approachable from the beginning.
10 minutes in and I'm getting nauseous from zooming in and out though (watching on my TV, stated at a reasonable distance)
Really nice explanation. Thanks. This obvs needs to be changed to accommodate open-source models that don't honour function calls, but not so hard to customise it to make that work
Really excellent way of teaching, thank you for your time. Appreciate it.
Awesome and very well explained. Usually prefer the js version of langchain but also a good foundation to transfer from python to javascript. Thank you!
Thanks for this video. It is really one of the best explanations I've come across.
🙏🙏
Very impressive way of explanations
great video, congrats.
will be nice to see 'ai sql agents' consulting muti-tables to respond an questions.
best video on LangGraph
Thank you lot
Thanks a lot for your effort and commitment. Great video!
Very good explanation on Langgraph. Thank you so much
OpenAI API isn't free though. Would be even better if you have a version of this tutorial that uses another LLM, like Gemini or Lllama3. For those of us that just wants to learn.
really unbelievable i wish you all the bests bro
Phenomenal explanation. Thank you.
Very nice explanation, step by step make is easy to follow
Great step by step breakdown! Finally I can make abit sense of langraph. But the conditional edge section is still abit confusing. why the need to bind and then calling out the toolexecutor again. What does each of these do?
unbelievable tutorial, thank you
Hi,
First of all: THANKS, great video. But I have a funny remark/question.
I saved each version of the code I build along with you. At 16:42 in the video you came up with the actual temperature in Vegas.
I wrote exactly the same code but I tested with the city "Bouillon" (in Belgium).
I tested more than once, just slightly changing the wording (like adding uppercase, a final stop to a sentence ...) then reverting to exactly what you wrote.
Even that results in (small) differences in the output (which is strange).
- in my slightly different wording, I got as a result "The current temperature in Bouillon is not available".
- when I aligned to you, I got a much richer answer (which I didn't ask for in fact), please see for yourself the "debugging" transcript (below)
- when I retested this last (strongly aligned to your formulation) version on the city of "Buggenhout" (other region of Belgium), I didn't get no cultural explanations, like I got for the city of "Bouillon" - how weird is that? For not being able to give me a temperature for Bouillon the soft makes up some other info as an apology, but not for "Buggenhout"?
It may seem funny, but how trustworthy is this approach? You insisted on being concise, no? (or should we have insisted on returning only temperature and nothing else?)
Finally I tested with "Las Vegas", and there I got the expected result, like you did. My conclusion is that the weather API only covers United States and not Europe?
But despite that fact, it's an interesting experiment, don't you think so?
Kind regards - Marc.
-------------------------------- "debugging" transcript when testing the tool with a European city (and in particular "Bouillon") instead of one in the US -----------------------------------------------
The current temperature in Bouillon is not available as it may vary depending on the time of year and weather conditions. It is recommended to check a reliable weather website or app for the most up-to-date information.
Output from node 'agent':
---
{'messages': ['What is the temperature in Bouillon?', 'Bouillon']}
---
Output from node 'tool':
---
{'messages': ['What is the temperature in Bouillon?', 'Bouillon', 'In Bouillon, the current weather is as follows:
Detailed status: overcast clouds
Wind speed: 7.4 m/s, direction: 175°
Humidity: 86%
Temperature:
- Current: 8.92°C
- High: 8.92°C
- Low: 8.92°C
- Feels like: 5.43°C
Rain: {}
Heat index: None
Cloud cover: 100%']}
---
Output from node 'responder':
---
The current temperature in Bouillon is not available as the specific location is not provided. Bouillon is a city in Belgium known for its medieval castle and scenic views along the Semois River. For the most accurate and up-to-date temperature in Bouillon, it is recommended to check a reliable weather website or app.
---
Output from node '__end__':
---
The current temperature in Bouillon is not available as the specific location is not provided. Bouillon is a city in Belgium known for its medieval castle and scenic views along the Semois River. For the most accurate and up-to-date temperature in Bouillon, it is recommended to check a reliable weather website or app.
---
Bro, it's epic! 😀 Learned a lot!
really appreciate the zoom in and zoom out. given that i can watch it on the go, using my iphone.
I love the explanation , thank you , you the best
very clear explanations . Thank you
Great job explaining.Thank you!
Excellent!
Great work. Very Nice explanation
Simply supperb..Thanks a lot man
Glad you liked it
What a great explanation!!
Nice explanation...............So nice....
follow your style! very clear
Thank you for the great explanation. Really simplified the entire process. Mind sharing the software you used to do the recording (its really smooth)?
which tool do you use to create the flow diagrams?
Very nice explanation! Thank you so much
Glad it was helpful!
Great Explained fundamentals
This is so good, thank you!!
You're so welcome!
Thank you so vey much for this tutorial. It's much better than what the langchain's channel is doing. But, kill me, I still do not understand how conditional edges work. I still do not understand how/why the app or the llm decided to run the weather retrieval?
Why exactly the model decides to use the OpenWeatherMapQueryRun tool in function 1? So the flow of the code only depends on whether the model somehow decided if tool was called or not? If we are only relying on the decision making of the model on whether to call a tool or not, without prompting it or anything like that, how can the code graph execute reliably? I can imagine a dozen of ambiguous questions where the model will not be able to decide whether to use tool or not or which tool to use. Imagine we have a tool to find out what the temperature is and another tool that tells whether it is raining or not. Then the question "What is the weather in Las Vegas?" will not yield predictable results. We probably would need to add some kind of intermediary node that would ask if the user is asking about temperature or precipitation. For that just the presence of "function_call' in additional kwargs would not be enough... I am sorry, I am just so extremely confused with langchain and the logic of their classes.
Thank you so very much in advance for the response!
Great ! Thank you
wow, it's really helpful!! Thanks!!
Great content. No LangGraph content since this video? Why? It got you good views. My like, sub and comment which is very rare :D
By far the best LangGraph Tutorial. But the zoom in/out too much, it makes me dizzy.
Hi please what is the name of your vscode theme
Thanks for the video, it's very helpful.
May I ask you what software you are using for recording/editing your videos?
Thanks for sharing knowledge in the simplest way ^^
I just wanna ask you about if i use chat_HF how i can convert tools to be bind in model ? because there is no function for convert to hf_function !
Simple & helpfull. TNX alot
Most welcome!
Nice video. Could you share the notebook?
very helpful thank you
Glad it was helpful!
What pc (gpu) needed to run the example?
You could run on collab, or any pc. No GPU needed.
How is it better than autogen and crew ai ??
What additional features or functionality does it provide ??
This helps you build agent in a graph format. They all have their own benefits.
It doesn't, but for someone like me, that started using CrewAI before I got comfortable with LangChain, this is a very good way for me to get a better understanding of how I would use LangChain to build something like CrewAI. This is the best introduction to LangGraph that I have ever seen, and I am thankful for that, because using a graph to model collaboration of LLMs seems like a very powerful pattern.
Can you please post the Notebook link, thanks.😀
Oops just added 😅
I wish I saw this video sooner. LangChain's docs has always been dreadful to be honest. But now I can't wait to give LangGraph a spin.
🙌🙌
Isn't it better just to use crew ai or autogen ? Langgraph seems very complex to use
The goal of this video is to help go through the complex parts. Hope it helps.
up to minute 19:21 everything is perfect and (for me) flawless.
From “Understanding Conditional Edges in LangGraph” onwards it became chaotic.
The constant zooming in and out makes my head hurt. These notebooks are basically disgusting and because of the constant scrolling up and down is impossible to follow 😥
Excellent tutorial. Why don't you create an advanced LangGraph Course on Udemy?. I am sure many people will surely subscribe to your course.
10/10 on the beard it makes you very wise for your age ngl
The documentation on LangChain/LangGraph is horrible for beginners. Thank you so much your video was much more helpful. Too bad the TS library isn't very typesafe and contains a bunch of python concepts in the source (like kwargs)
Thanks! Excellent introduction and steps.... Best if you can reduce the frequent zooming in-out-in... makes me dizzy when it is overdone and I can't continue to watch anything further. I know it is fun but I feel like vomiting after 20mins into the video.
Thanks for your nice explanations. But the zoom-in zoom-out is pretty annoying. specially when watch on 1.5x plus speed. I couldn't tolerate to the end and skipped most parts.
Great explanation. Things to improve: consider zooming in and out less as it is quite distracting. Speak slowly as you are going fast and for people utterly new to this it may be too fast. You have literally no pause in speaking. At no point do you have silence, if only for a second, to give the viewer time to reflect a little. Your delivery is hence very monotonous. All of this combined hinders the otherwise great content you provide. I'm subscribing nonetheless :)
Subscribed +=1
I would really like to finish watching this, but all the unnecessary zooming in and out moves are giving me a headache…
Will minimize them for the next vids
make a udemy courses ...pls
Might look into it, thanks!
good content by very irritating to have the screen zoom in and zoom out a thousand times every minute. !!! 😡💩😤
OK, with regards to the bug I mentioned before ... I found out that [_arg1] had to be [__arg1] ...
When I run the application, now I get another error:
raise InvalidUpdateError(
langgraph.channels.base.InvalidUpdateError: Invalid state update, expected dict with one or more of ['messages'], got
I'm going to have a good sleep and maybe tomorrow I'll figure out what I might have done wrong.
Of course, having the correct source code would help enormously.
(by the way: where do we find the theoretical foundation for all these primitives used in the code, because the last version was a serious jump,
I kind of get the big picture, but I miss a few smaller steps)
Thanks, Marc
Here is a corrected version of the function2:
def function_2(state):
messages = state['messages']
print("messages: ", messages)
last_message = messages[-1] # this has the query we need to send to the tool provided by the agent
print("last_message: ", last_message)
parsed_tool_input = json.loads(last_message.additional_kwargs["function_call"]["arguments"])
print("parsed_tool_input: ", parsed_tool_input)
# Check if 'args' exists and is not empty
if 'args' in parsed_tool_input and parsed_tool_input['args']:
tool_input = parsed_tool_input['args'][0]
else:
raise ValueError("Missing or empty 'args' in parsed tool input")
# We construct an ToolInvocation from the function_call and pass in the tool name and the expected str input for OpenWeatherMap tool
action = ToolInvocation(
tool=last_message.additional_kwargs["function_call"]["name"],
tool_input=tool_input,
)
# We call the tool_executor and get back a response
response = tool_executor.invoke(action)
# We use the response to create a FunctionMessage
function_message = FunctionMessage(content=str(response), name=action.tool)
# We return a list, because this will get added to the existing list
return {"messages": [function_message]}