LangGraph Deep Dive: Build Better Agents

preview_player
Показать описание
LangGraph is an agent framework from LangChain that allows us to develop agents via graphs. By building agents using graphs we have much more control and flexibility in our AI agent execution path.

In this video, we will build an AI research agent using LangGraph. Research agents are multi-step LLM agents that can produce in-depth research reports on a topic of our choosing through multiple steps.

We will see how we can build our own AI research agent using gpt-4o, Pinecone, LangGraph, arXiv, and Google via the SerpAPI.

📌 Code:

📖 Article:

🌲 Subscribe for Latest Articles and Videos:

👋🏼 AI Consulting:

👾 Discord:

#artificialintelligence #langchain #llm #python #rag

00:00 LangGraph Agents
02:04 LangGraph Agent Overview
04:46 Short History of Agents and ReAct
07:58 Agents as Graphs
10:18 LangGraph
12:41 Research Agent Components
14:30 Building the RAG Pipeline
17:28 LangGraph Graph State
18:56 Custom Agent Tools
19:10 ArXiv Paper Fetch Tool
21:22 Web Search Tool
22:42 RAG Tools
23:57 Final Answer Tool
25:10 Agent Decision Making
30:16 LangGraph Router and Nodes
33:00 Building the LangGraph Graph
36:52 Building the Research Agent Report
39:39 Testing the Research Agent
43:42 Final Notes on Agentic Graphs
Рекомендации по теме
Комментарии
Автор

Looking forward to this one. Especially with the new features LangChain has been bringing out in the past weeks. Exciting times to be building AI applications, for sure!

ward_jl
Автор

Your presentation is so good, I use it to listen to it in the background when I'm coding or doing other tasks. Then, when I watch the tutorial for good I find that I follow much better than if I would watch and follow right away.

MrMoonsilver
Автор

Great tutorial. 36:42 you can define the destination for the oracle node to restrict where it can go. For example def oracle(state) -> Literal['rag_search', ..., 'final_answer']:

NamTran-jdlp
Автор

James you are the best! This repository is very easy to install and works really well. Thanks!

amparocanaveras
Автор

Awesome, this is the video I need. I'll watch this carefully.
I've tried langgraph, and it felt really complex to manage the tools and workflows. Giving the description to trigger the tool is hard if you have similar steps in your workflow. Making the caller to use the exact response from the tool was also really hard. And thinking of scalability, like adding steps in between in the long term in a project with multiple people, feels it's going to be hard.
I tried also adding multi agents by passing a workflow as a node, and again, it was a bit hard to make everything work as expected. I was just following a simple flowchart with a few steps and forks. Even though I was able to make it work, it felt like I was doing everything so wrong.
Anyway, I hope your video put some lights on my way to understand this better

tiagoc
Автор

I always enjoy your video. I have a better understanding of LangGraph. As with your video, all of the demonstrations I have watched are one sentence or requests to the LLM.

Here are two examples of Requests.
I'm interested in what the best type of dog is for child. My daughter is five years old. We live in Minnesota, which is quite cold, so we need a dog that is good for cold weather. Please provide me with a few suggestions.

I am deeply intrigued by the various reasoning approaches to building my report writer research agent. I have discovered two approaches: Tree of Thought and Chain of Thought. I am eager to gain a good understanding of each.
Please provide me with a report that defines each strength and weakness for each. Make a recommendation as to which one would be good for building my research agent.

mrchongnoi
Автор

I'm currently having troubles to define a SQL Agent as a tool for my LangGraph Agent. Have anyone done or seen something that could help me?

LucasLima
Автор

Can anyone explain why this GPT researcher is any better than writing ONE prompt that tells the LLM how you want your output to look and tell it to go find the information? Is the answer given by this overly complicated code really that much better than feeding one prompt to o1 from OpenApI and linking your instructions to the Tavilis web search tool?

lenovo
Автор

Amazing!! Thanks James! Always explaining it really clear!

danielaguileragarcia
Автор

The font at the beginning is hard to read

yotubecreators
Автор

Have you tried to use this approach to build a team of agents that collaborate to solve a specific task from multiple different specific perspectives?

ZhenkaS
Автор

I used this approch but in my use case I used two tools for rag search and i want both tools run parellel and output of tools want to combine and pass to Oracle agent to generate final response but I facing issue of its calling always one tool and generating final output anyone can help for this scenario

shubhamsalokhe
Автор

I tried this approach to build agent for my use case with bedrock LLM, instead of Open Ai model i just introduced Bedrock LLM and keep all remaining things same but facing issue as :


Error raised by bedrock services : messages : final assistant content can not end up with white trailing space



May be this error is due to custom scratchpad can you guide me to resolve this error?

shubhamsalokhe
Автор

why does the graph always go to rag_seach first?

sushi
Автор

Really nice job! Really wanna have a walk through on how to stream the final answer as well.

reknine
Автор

Very nice content James ! Just discovering langgraph I have a question : in what which is It different from crew AI ?

deanosaureflex
Автор

Thanks for this video, great as usual. One thing I don't understand is what is breaking the "loop"/further gathering of information. Is it when the "Oracle" thinks it has "plenty of information" as stated in the system prompt? Or when does it stop?

Fiddelush
Автор

btw, what about using the semantic-router with langGraph ?

awakenwithoutcoffee
Автор

Thanks for this James. How do I switch from OPENAI KEY to GROQ KEY? Or even using Ollama?

raminderpalsingh
Автор

Can you please also make a video about human in the loop in depth. Thank you

hunzalamushtaq