LangGraph 101: it's better than LangChain

  Рет қаралды 58,721

James Briggs

James Briggs

Күн бұрын

LangGraph is a special LangChain-built library that builds intelligent AI Agents using graphs. Ie, agentic state machines. It allows us to build more powerful and flexible AI agents than what we can build using just the core library, LangChain.
In this video, we'll see how to build agents with LangGraph and OpenAI.
📌 Code:
github.com/pinecone-io/exampl...
🌲 Subscribe for Latest Articles and Videos:
www.pinecone.io/newsletter-si...
👋🏼 AI Consulting:
aurelio.ai
👾 Discord:
/ discord
Twitter: / jamescalam
LinkedIn: / jamescalam
#ai #langchain #artificialintelligence #nlp #chatbot #openai
00:00 Intro to LangGraph
00:52 Graphs in LangGraph
03:00 More Complex LangGraph Agent
08:12 LangGraph Graph State
14:00 LangGraph Agent Node
17:08 Forcing a Specific LLM Output
20:00 Building the Graph
23:23 Using our Agent Graph
28:32 LangGraph vs LangChain

Пікірлер: 101
@nelsonatp8957
@nelsonatp8957 2 ай бұрын
Hi James, thanks for the great content. I’m curious about why you went down the road of having the graph playing with the agent state and tools rather than just doing things directly in the langgraph nodes ? I’m seeing less and less examples from langchain using so called « agent » with langgraph and also tools, they only use it for Tavily because they have a langchain prebuilt tool, and i wonder what is your opinion on agents being soon obsolete ? And tools just used for built-in tools wrappers from langchain rather than custom tools
@irkedoff
@irkedoff 2 ай бұрын
Thank you for being thorough with very simple and less simple examples. It made it easy to understand and allowed me to run with the knowledge. 💜
@avidlearner8117
@avidlearner8117 Ай бұрын
100%!!!
@kubasmide223
@kubasmide223 2 ай бұрын
I have been patiently waiting for your video on langgaraph James. Thanks😊
@jamesbriggs
@jamesbriggs 2 ай бұрын
sorry for making you wait so long 😅
@law_wu
@law_wu 2 ай бұрын
Great video James! Motivates me to learn more about langgraph now after hearing about it's release a few months back.
@getcoai
@getcoai 2 ай бұрын
We have this on 2x watchlist. Thanks for making this. Still getting our heads around graph vs chain.
@awakenwithoutcoffee
@awakenwithoutcoffee 23 күн бұрын
same here. Have you guys come to a conclusion ? were building our agent pipelines and might switch to LangGraph
@justinhall4855
@justinhall4855 2 ай бұрын
Great content, as always. Very random note: ive been to bali so many times (i work in tech in Singapore) and id recognise a bali villa door handle anywhere! 😂😂😂 Enjoy!
@jamesbriggs
@jamesbriggs 2 ай бұрын
haha I am impressed
@maciejzieniewicz4301
@maciejzieniewicz4301 2 ай бұрын
I agree Graphs are excellent choice for Agents and also good for the cost reduction policy. Langgraph is quite complex though. If you want to play with easier solution you can check autogen graph, it is (for now) more generic in use, at least for a fast prototyping.Thanks for this video.
@ThubaMamba
@ThubaMamba Ай бұрын
Very precise walk-through. Thank you.
@victorsilva-jb2sf
@victorsilva-jb2sf 2 ай бұрын
Hi James, thanks for the content. I'm trying to use langgraph with Vertex AI with the Gemini-pro model. Do you have any suggestions on how to tackle this task? I'm trying to adapt the code you made.
@MirGlobalAcademy
@MirGlobalAcademy 2 ай бұрын
Thank you so much. I was waiting for this for long time.
@jakeparker918
@jakeparker918 Ай бұрын
Thanks for the video! This is my first exposure to LangGraph and it seems very useful. During your demo, why did the AI respond with a citation to the wikipedia page if it was supposed to be pulling from the simulated RAG? This part confused me, as I'd want to force it to only use data provided to it via RAG, etc.
@tallerdenyooh
@tallerdenyooh Ай бұрын
Building an e-commerce chatbot. And getting output to obey a specific format has been a huge road block because of the exact issue you mentioned. The agent just sometimes decides it doesn’t need to invoke any output formatting tool even with explicit instructions. Definitely trying this graph approach asap. Thanks!!!
@awakenwithoutcoffee
@awakenwithoutcoffee 23 күн бұрын
and has LangGraph helped you out ?
@stevechiou5760
@stevechiou5760 2 ай бұрын
Thank you for the video. I have a question about how "query_agent_runnable" decide is an error message or not? What's the criteria of the decision?
@imposternaruto
@imposternaruto 2 ай бұрын
i am really struggling to find a single example that doesn't use open ai function calling (llm.bind, convert_to_openai_ helper functions). can you PLEASE help me out. I specifically am looking for a single agent and multi agent architecture with detailed explanation on the state, interactions with runnables like chat history, geared towards RAG
@WhylerGame
@WhylerGame 2 ай бұрын
Someone may correct me but I think LangGraph's potential resides mainly in the cyclical graphs. For instance for making, self-reflective agent. When making Directed acyclic graph (DAG) pipelines (like you did), it's better to use chains (Langchain).
@diegocalderon3221
@diegocalderon3221 2 ай бұрын
Can you use the OpenAI() API in LangGraph to specify Ollama models?
@AndreiSheard
@AndreiSheard 2 ай бұрын
God bless your soul for doing this tutorial in Colab!! I'm using Crew AI in colab and my only hardware atm is a Ipad pro 2020 and a Samsung s23 ultra. Seriously: this is a boon for finding a solution for my...solution 💀
@JoanApita
@JoanApita 29 күн бұрын
Thank you! This is not simple or basic information; it is hugely valuable to us. Please keep posting more.
@lLvupKitchen
@lLvupKitchen 2 ай бұрын
Thanks for the video! As a noob, I’m lost between whether I should learn langgraph or autogen or agency swarm. I learned to use autogen but it seems to lack the minimum control I need to build something reliable. To learn everything…takes to much time for me as I’m totally new to the computer language, and want to build something that I need rather than learning the basics for multiple libraries. Will langgraph the go-to library for the time being? What would you recommend for people like me?
@RevMan001
@RevMan001 2 ай бұрын
Don't forget CrewAI
@Windchimesandrain
@Windchimesandrain 2 ай бұрын
thanks for this video ! not related to this but while using langchain agent where it is invoking a function which makes openai call as an api in django application getting timeout error in production env . any inputs on how this can be fixed
@jamesbriggs
@jamesbriggs 2 ай бұрын
if you're streaming maybe you are not closing the stream correctly? Otherwise I'm not sure to be honest - it does sounds like a codebase-specific issue rather than any particular behavior exclusive to using django+openai api together
@74Gee
@74Gee 2 ай бұрын
I like the additional flexibility of langchart. This is just crying out for a gui builder using Graphviz or tikzit - or more even node red. I can see an ecosystem growing around something like that with people submitting nodes and structures.
@justdavebz
@justdavebz 2 ай бұрын
Does llama3 support these functional calling in LangGraph?
@themax2go
@themax2go 2 ай бұрын
my q now is: does it still make sense to learn (theory, modify existing apps, experiment with, write new apps with) langchain? or rather just ignore and just start w/ langgraph? from a beginner's perspective (no prior langchain exp). what's the recommendation and its justification?
@andy111007
@andy111007 2 ай бұрын
Does ```@tool("final_answer") def final_answer_tool( answer: str, source: str ): """Returns a natural language response to the user in `answer`, and a `source` which provides citations for where this information came from. """ return ""``` help in parse my answer?. What if the client wants in some other format, how to use within LangGraph?
@johnvicente796
@johnvicente796 Ай бұрын
Can you build an agent in langgraph that focuses on SQL queries to a Postgres database?
@awakenwithoutcoffee
@awakenwithoutcoffee 23 күн бұрын
Thank you James! can we utilize LangChain for general abstractions and than only use LangGraph for Agents ? Id love to spar and contribute, is there a discord your active on ?
@gabrielnieves4912
@gabrielnieves4912 2 ай бұрын
Have not finished but this dude is legit
@realCleanK
@realCleanK Ай бұрын
Thank you! 🙏
@andrewandreas5795
@andrewandreas5795 2 ай бұрын
Nice video!" What do you think about DSPy? Do you think it makes langchain and similar obsolete?
@stephanembatchou5300
@stephanembatchou5300 2 ай бұрын
No they don't serve the same purpose
@SolidBuildersInc
@SolidBuildersInc 2 ай бұрын
This is very interesting. Is there a tool to reverse engineer this Agent solution ? Can Nodes and Edges be mathematically defined like a enforced index for a DB? Appreciate any feedback and Thank you for sharing.
@user-ie9co7ex6s
@user-ie9co7ex6s 2 ай бұрын
Thank you James :)
@jamesbriggs
@jamesbriggs 2 ай бұрын
thanks to you :)
@maxlgemeinderat9202
@maxlgemeinderat9202 26 күн бұрын
anyone knows how to add chat history (InMemory) in this example?
@matheusdonato6694
@matheusdonato6694 2 ай бұрын
James, have you already put any projects using LangChain into production in your consultancy? If so, was the experience positive?
@jamesbriggs
@jamesbriggs 2 ай бұрын
yes we've done a few - all good so far earlier langchain was troublesome, but most of the issues we had back then have been resolved (primarily stability + excessive dependencies)
@iukeay
@iukeay Ай бұрын
I'm not going to lie... I'm a bit more attracted to LLama index especially after they added agent memory, and you can put agents in a query pipeline. .... I'm just having a hard time grasping Lang graph
@danielschoenbohm
@danielschoenbohm 2 ай бұрын
Awesome! Also, what do you mean when you say that agents are the short-term future? What about the long term?
@jamesbriggs
@jamesbriggs 2 ай бұрын
long term: en.wikipedia.org/wiki/The_Terminator
@jamesbriggs
@jamesbriggs 2 ай бұрын
but fr, I have no idea on long term - I don't think it's possible to predict where things are going, so anything beyond the next 1-2 years (or even earlier) would be pure guesswork from me
@coinspeednews4703
@coinspeednews4703 2 ай бұрын
AI is moving so fast, it's become impossible to follow
@danielschoenbohm
@danielschoenbohm 2 ай бұрын
@@jamesbriggs 🤣
@danielschoenbohm
@danielschoenbohm 2 ай бұрын
​@@jamesbriggs Yes I agree. I have no idea where things are headed, but one thing is certain: agents enable intelligence to act. What that will look like, I don't know. I'm also not sure if we'll call them "agents" in the future. My dad probably won't. :)
@hellomyfriend_S2
@hellomyfriend_S2 22 күн бұрын
Thank you for the video. Could this be worked without OpenAI ?
@jamesbriggs
@jamesbriggs 21 күн бұрын
For sure it could, you can swap out the LLM component
@matthewwalker7063
@matthewwalker7063 2 ай бұрын
Is this similar to dspy?
@abdullahsiddique6393
@abdullahsiddique6393 2 ай бұрын
Semantic router for conditional edges is OP
@jamesbriggs
@jamesbriggs 2 ай бұрын
💯
@l.u.v
@l.u.v 17 күн бұрын
I'm getting this error : Nonetyoe object is not iterable
@user-um2kn6mn1j
@user-um2kn6mn1j 2 ай бұрын
What do you prefer between Llamaindex and Lagchain? I'm beginning in this topic and I want some advice
@jamesbriggs
@jamesbriggs 2 ай бұрын
I've never had any need to go beyond the langchain ecosystem, but I also haven't used llama-index enough to know if I'm missing out on anything big there
@alivecoding4995
@alivecoding4995 2 ай бұрын
What do you think about Microsoft's Semantic Kernel and PromptFlow?
@generationgap416
@generationgap416 2 ай бұрын
Nothing
@lavamonkeymc
@lavamonkeymc 2 ай бұрын
When’s the other complex langgraph video coming out??
@jamesbriggs
@jamesbriggs 2 ай бұрын
Pretty soon, code is ready 😁
@lezgoverci
@lezgoverci 2 ай бұрын
Can I go straight to learning Langgraph than learning Langchain first?
@adityanjsg99
@adityanjsg99 Ай бұрын
I understood better here than the langgraph doc.
@generationgap416
@generationgap416 2 ай бұрын
Why did you say agents are short-term leaders of AI? What is your definition of an agent? Is an agent a thing or is agentic workflow an approach to building intelligent systems?
@USBEN.
@USBEN. 2 ай бұрын
The volume of your videos is way lower than standard youtube videos, would be good if you could up the levels some more next time.
@alivecoding4995
@alivecoding4995 2 ай бұрын
I found this mixture of langchain (agents & tools) and langgraph quite confusing. The documentation is more straightforward.
@arcfired3615
@arcfired3615 2 ай бұрын
did you have a good night out yesterday?
@jamesbriggs
@jamesbriggs 2 ай бұрын
yes, night out, socializing, getting plenty of sleep and not trying to keep up with ai - all things I do frequently
@jbexta
@jbexta 2 ай бұрын
similar to agent pilot
@ChrizzeeB
@ChrizzeeB 2 ай бұрын
off topic - but have you noticed you write ESE than add an "l" -> ELSE SEARH, then add a "c" -> SEARCH how's your brain working to do that? I analyze human language production as if it were ML.. so I'm curious how this is happening...
@hasaniqbal3180
@hasaniqbal3180 28 күн бұрын
I actually think this is confusing. Using abstractions from both langchain amd langgrapgh makes this even more difficult to wrap your head around. I prefer the tutorials on langgraph docs that start simple and build up from there.
@rohanchoudhary672
@rohanchoudhary672 2 ай бұрын
Bro, please imcrease your audio. I have to use chrome extensions for your videos to improve audio amplitude
@viorelteodorescu
@viorelteodorescu 2 ай бұрын
There is no such thing as a graph with a conditional edge. What you are describing is normal conditional programming. Maybe a state machine if all the transitions are rigorously set.
@jamesbriggs
@jamesbriggs 2 ай бұрын
yeah that syntax is probably my least favorite part of langgraph, and it feels overly complex, ie you must define tools + router + "conditional edge" (using LangChain syntax)
@natekryn9840
@natekryn9840 2 ай бұрын
This video is proof that developers dont get half.
@8eck
@8eck 2 ай бұрын
LangGraph is not better than LangChain, it extends LangChain...
@Sarunas-llm
@Sarunas-llm 10 күн бұрын
Better or not, its not ready for most of prod solutions at all. Its overly bloated, opinionated by random dev opinions.
@frazuppi4897
@frazuppi4897 2 ай бұрын
damn their APIs are so bad
@generationgap416
@generationgap416 2 ай бұрын
Stop saying it's pretty simple. It's not simple for those people who are seeing this for the first time. I Like your content but be mindful of newbies because you will discourage them.
@user-en4ek6xt6w
@user-en4ek6xt6w 2 ай бұрын
Hey not simple at all i try to understand but i couldn't
@endlessvoid7952
@endlessvoid7952 2 ай бұрын
It’s all relative. He can’t explain every concept at every level in every video. Sometimes you need to assume some level of audience understanding or you’ll never discuss anything. What’s simple for you won’t be for someone else, and that’s ok.
@robertmazurowski5974
@robertmazurowski5974 2 ай бұрын
It is simple if someone already knows langchain.
@samyio4256
@samyio4256 2 ай бұрын
Ask a programmer what hes able to do, he will say: not much, a little here, a little there. In reality that programmer learned so much that he forgot how much he learned and how complicated it was. When that programmer learns something new it funds on that gigantic, mostly unconciouse base, built before, which is expressed by "thats pretty simple".
@jamesbriggs
@jamesbriggs 2 ай бұрын
Good point, I have been using langchain and related libraries for well over a year now. For anyone reading who doesn’t find it simple, it’s not (my bad) and it takes some time to learn. However, don’t be discouraged - after using the tools for a while, you’ll end up looking back at this eventually and thinking of it as “simple” too, but to get there it requires time and practice, my advice would be to try building with it, the more you build the more you will learn and understand If anyone has feedback on what they find most confusing I’d love to hear it and I’d be happy to put together some more content to focus on what you all struggle with most
@azero79
@azero79 2 ай бұрын
im sorry but this is unnecessarily complicated, i've used the graphs on haystack, and their api looks way cleaner
@jamesbriggs
@jamesbriggs 2 ай бұрын
I’m very open to jumping back into the haystack ecosystem
@azero79
@azero79 2 ай бұрын
@@jamesbriggs check haystack pipelines
@deeplearningpartnership
@deeplearningpartnership 2 ай бұрын
Watch at 1.25 speed. This guy speaks too slow.
@gambaweb
@gambaweb 2 ай бұрын
1.5 for me 😂
Have You Picked the Wrong AI Agent Framework?
13:10
Matt Williams
Рет қаралды 51 М.
Learn LangGraph - The Easy Way
28:29
Menlo Park Lab
Рет қаралды 21 М.
Каха и суп
00:39
К-Media
Рет қаралды 6 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 103 МЛН
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 14 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 40 МЛН
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 708 М.
Semantic Chunking for RAG
29:56
James Briggs
Рет қаралды 19 М.
Fixing RAG with GraphRAG
15:04
Vivek Haldar
Рет қаралды 6 М.
GraphRAG: LLM-Derived Knowledge Graphs for RAG
15:40
Alex Chao
Рет қаралды 93 М.
LangGraph Crash Course with code examples
39:01
Sam Witteveen
Рет қаралды 68 М.
AI Pioneer Shows The Power of AI AGENTS - "The Future Is Agentic"
23:47
Why Agent Frameworks Will Fail (and what to use instead)
19:21
Dave Ebbelaar
Рет қаралды 22 М.
Is Tree-based RAG Struggling? Not with Knowledge Graphs!
9:06
LangChain Master Class For Beginners 2024 [+20 Examples, LangChain V0.2]
3:17:51
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 14 МЛН
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 15 МЛН