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

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 32

  • @JDWilsonJr
    @JDWilsonJr 6 місяців тому +5

    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.

  • @nyceyes
    @nyceyes 2 місяці тому +2

    Thank you for this. I think your conclusion is correct. LangGraph is the way to go, documentation notwithstanding. This has been the way to do things (framework based) since around ~2012, which is when I first worrked with this pattern with Apache Storm in 2012 (now owned by Twitter). It's extremely powerful, expressive and easy to modify.

  • @jdallain
    @jdallain 6 місяців тому +2

    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

  • @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 👍

  • @dgbarbosa96
    @dgbarbosa96 6 місяців тому +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  6 місяців тому

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

  • @limjuroy7078
    @limjuroy7078 6 місяців тому +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  6 місяців тому +1

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

  • @rorycawley
    @rorycawley 5 місяців тому

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

  • @khaledsaud6677
    @khaledsaud6677 5 місяців тому +1

    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  5 місяців тому

      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

  • @thunkin-ai
    @thunkin-ai 6 місяців тому +1

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

  • @falmanna
    @falmanna 6 місяців тому

    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.

  • @rutambhagat4556
    @rutambhagat4556 6 місяців тому +1

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

    • @codingcrashcourses8533
      @codingcrashcourses8533  6 місяців тому

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

    • @dgbarbosa96
      @dgbarbosa96 6 місяців тому

      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 6 місяців тому

    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  6 місяців тому

      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 5 місяців тому

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

    • @codingcrashcourses8533
      @codingcrashcourses8533  5 місяців тому

      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 6 місяців тому

    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  6 місяців тому

      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 6 місяців тому

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

    • @frag_it
      @frag_it 6 місяців тому

      @@codingcrashcourses8533 is it updated for
      Lcel

  • @abdulrehmanbaber2104
    @abdulrehmanbaber2104 3 місяці тому

    I hate chains, i want to know my data, see the my data going from one place to another.
    I want to print my steps, but lecl is troublesome

    • @codingcrashcourses8533
      @codingcrashcourses8533  3 місяці тому

      So you like LangGraph for that reason? In an LCEL pattern I showed patterns for custom Runnables, which you might find helpful :)

  • @bonadio60
    @bonadio60 6 місяців тому +2

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