LangGraph vs. LangChain LCEL - Can we get rid of LCEL (LangChain Expression Language)

preview_player
Показать описание
Many people seem to dislike LCEL. It is hard to debug chains, they are hard to read and can really become complex. Can we use LangGraph to create complex Chains instead of using LCEL for that? Let´s find that out!

Timestamps
0:00 Introduction
0:58 Simple RAG Chain with LCEL
4:00 RAG chain with LangGraph
8:07 Comparison & Discussion
Рекомендации по теме
Комментарии
Автор

I agree with you, thanks for showing us the light :D

rorycawley
Автор

Now there are two people on the internet who agree that using LangGraph exclusively whether for simple DAG (Directed Acyclic Graphs) or to add cycles and persistence is the way to go. Thank you very much for this most excellent walkthrough and code example.

JDWilsonJr
Автор

I use LangGraph almost exclusively and on a daily basis, it makes the code more readable. Debugging also works much better. But sometimes I use LCEL as a one-liner for simple things (prompt template | llm | output parser). This can also make the code more readable, because otherwise you have some kind of subgraph again instead of a one-liner.
Conclusion: Your opinion is tried and tested 👍

ki-werkstatt
Автор

LangGraph seem very complicated but it's actually very modularized and aligns with the human brain's of logical thinking since human always thinks logically and tends to work step-by-step. Then, I can't agree more with you on the matter of debugging. Sometimes, I don't even understand my code even when it works after I have written a tons of codes on computer using LCEL😅 (U can imagine when it doesn't work and needs debugging😂)

limjuroy
Автор

Interesting, first I had the same thought of, only use Langgraph for complex scenarios, but since I've beign trying Langgraph I dont get why dont use it more, even for more simple scenarios.
Im pretty sure that for DAG might be less stressing/less code with only LCEL but coming back later for the same code is a little bit more complex to read and understand what is happening, Langgraph on the other way, its easier to debug, check the graph and see how the flow is working. But thats only my opinion, right now I definely agree with your final conclusions

dgbarbosa
Автор

It’s really cool to see the comparison. Langgraph is the winner. You can use lcel in langgraph, but not vice versa. There are a lot more options with langgraph

jdallain
Автор

I've suspected as much; not that I'm super experienced in either as yet.

thunken
Автор

Which would you recommend for creating complex, production-ready agents with more than 30 nodes, with cycling and branching capabilities: Haystack, LangGraph, or a custom-built framework? I haven't seen a comparison between Haystack and LangGraph for real product development. What is your opinion?

khaledsaud
Автор

Anyone who've built complex systems will agree that the langgraph approach is, yes more complex, but also better structured.

That's a golden rule in software, if you want things to be standardized, easier to extend, easier to debug, and harder to break, you will need to write a bit more code.

Of course simplicity wins always, but simplicity != less code, it means easily readable and understandable code.

falmanna
Автор

I might be wrong here but we cant send the response as a stream with langgraph right?

rutambhagat
Автор

the langchain docs go only for now to langchain and langsmith, I imagine LangGraph documentation is going to mature tremendously over time. the langchain videos bounce over to langsmith to trace stuff can you incorporate that so we can see 'under-the-hood'?

DerekBMoore
Автор

how would you store a chat history here? So e.g. saving the last 2 qa pairs

maxlgemeinderat
Автор

Can you make a in-depth playlist for langchain for 2024 a lot of things have changed, it would be amazing ! And you can make it with both lcel and langgraph

frag_it
Автор

LangGraph is very flexible, but their documentation is really bad.

bonadio