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

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • 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

ความคิดเห็น • 27

  • @rorycawley
    @rorycawley วันที่ผ่านมา

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

  • @ki-werkstatt
    @ki-werkstatt 5 วันที่ผ่านมา

    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 👍

  • @JDWilsonJr
    @JDWilsonJr หลายเดือนก่อน +3

    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.

  • @limjuroy7078
    @limjuroy7078 หลายเดือนก่อน +2

    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😂)

    • @codingcrashcourses8533
      @codingcrashcourses8533  หลายเดือนก่อน +1

      After understanding the three most important concepts its actually quite easy :). I struggle less than just using lcel

  • @dgbarbosa96
    @dgbarbosa96 หลายเดือนก่อน +2

    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

    • @codingcrashcourses8533
      @codingcrashcourses8533  หลายเดือนก่อน

      Introducted that idea to my colleagues today, but they did not appreciate my initiave too much :(

  • @thunken
    @thunken หลายเดือนก่อน +1

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

  • @jdallain
    @jdallain หลายเดือนก่อน

    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

  • @falmanna
    @falmanna หลายเดือนก่อน

    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.

  • @khaledsaud6677
    @khaledsaud6677 16 วันที่ผ่านมา

    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?

    • @codingcrashcourses8533
      @codingcrashcourses8533  16 วันที่ผ่านมา

      I am not that familiar with Haystack I have to admit and since I am pretty familar with LangChain my opinion would be pretty biased

  • @rutambhagat4556
    @rutambhagat4556 หลายเดือนก่อน +1

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

    • @codingcrashcourses8533
      @codingcrashcourses8533  หลายเดือนก่อน

      yes, it depends on the model. You can stream with Langgraph and openai

    • @dgbarbosa96
      @dgbarbosa96 หลายเดือนก่อน

      I had success using Langgraph with openai, check his video about streaming with fastapi, it helped me a lot.
      BTW I had to use astream_events

  • @DerekBMoore
    @DerekBMoore หลายเดือนก่อน

    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'?

    • @codingcrashcourses8533
      @codingcrashcourses8533  หลายเดือนก่อน

      Yes, but often its the way the data looks that leads to an error and with that langsmith is not too great tbh

  • @maxlgemeinderat9202
    @maxlgemeinderat9202 21 วันที่ผ่านมา

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

    • @codingcrashcourses8533
      @codingcrashcourses8533  21 วันที่ผ่านมา

      just create a new attribute for that: history: list[BaseMessage]. You can just append to that and do whatever you want with it

  • @frag_it
    @frag_it หลายเดือนก่อน

    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

    • @codingcrashcourses8533
      @codingcrashcourses8533  หลายเดือนก่อน

      My in depth stuff is actually Happening on udemy. :). Thats Kind of my Business Model if you want to say so ;)

    • @frag_it
      @frag_it หลายเดือนก่อน

      @@codingcrashcourses8533 does it have the latest update on lcel ?

    • @frag_it
      @frag_it 26 วันที่ผ่านมา

      @@codingcrashcourses8533 is it updated for
      Lcel

  • @bonadio60
    @bonadio60 หลายเดือนก่อน

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