LangChain Expression Language - The ONLY video you need to TRULY understand LCEL

Sdílet
Vložit
  • čas přidán 6. 07. 2024
  • In this video, we'll do a deep dive into the LangChain Expression Language-the backbone of LangChain. This is the only video you'll need to really understand the ins and outs of LCEL and its Runnable Interface.
    Code: github.com/Coding-Crashkurse/...
    Timestamps:
    0:00 - Intro
    0:37 - Basic Chain and invoke method
    3:06 - The magic of the pipe operator
    8:11 - RunnablePassThrough
    9:02 - RunnableLambda
    10:03 - RunnableParallel
    13:00 - More complicated chains
    18:35 - Real world Chain - easy!
    #langchain #LCEL

Komentáře • 48

  • @pratiknarendraraut6889
    @pratiknarendraraut6889 Před 2 měsíci +7

    Best teacher on CZcams , get this man on million subs asap.

  • @ramishelh9998
    @ramishelh9998 Před 23 dny +1

    One of the best tutorials on LCEL. Thanks a lot!

  • @efneogearbox
    @efneogearbox Před měsícem +2

    This is one of the best LCEL tutorials, not directly copying examples from LangChain website. Thank you!

  • @eloiseidlitz7062
    @eloiseidlitz7062 Před 21 dnem +1

    Purely helpful ! I love it ! Big thank to you !

  • @mr.daniish
    @mr.daniish Před 2 měsíci +3

    Pure knowledge bomb!

  • @matuskokoska312
    @matuskokoska312 Před měsícem

    exctremely helpful video, thank you very much

  • @mateusztylec215
    @mateusztylec215 Před 17 dny

    This is just great!

  • @user-sj1tp5mg6v
    @user-sj1tp5mg6v Před 2 měsíci +2

    It's awesome video!!! I finally figured out how it works! Thank you very much! ❤❤❤❤
    And I absolutely agree with idea that this great video should be in their shitty docs

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před 2 měsíci

      thank you for that great feedback

    • @thunken
      @thunken Před 2 měsíci

      @@codingcrashcourses8533 yeah their docs need attention; great vid

  • @deadlooop
    @deadlooop Před 2 měsíci

    Gave you the the * in git repo, and subscribed as well 👍

  • @SashaBaych
    @SashaBaych Před 2 měsíci

    Finally!

  • @yazanrisheh5127
    @yazanrisheh5127 Před 2 měsíci +3

    This definitely helped me understand more about LCEL. Thank you so much.
    Just to make sure I understood what you explained in the video, runnablepassthrough is simply taking any input variable and it keeps it as it is to pass it to another runnable right? For example if I wanted to implement memory in my RAG application, I would create a function and where the input of it is from the runnablepassthrough and I pass that into a runnablelambda. If I had another function, I'd do the same and pass it inside runnablelamdba and finally to construct the entire chain, I connect them all to a runnable parralel. Is this right?
    Also, sometimes I see "itemgetter" on langchain docs. Could you explain what that is

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před 2 měsíci +2

      Yes. For Memory pass the memory through the RunnablePassthrough and don´t change it until you pass it to the model.
      Itemgetter does the exact same as lamdba x: x[key]. Use that when you have dictionaries as objects.

    • @yazanrisheh5127
      @yazanrisheh5127 Před 2 měsíci +2

      @@codingcrashcourses8533 Thank you so much!

  • @farhanafridi8694
    @farhanafridi8694 Před 2 měsíci

    ❤❤

  • @pnhbs392
    @pnhbs392 Před měsícem

    around 19 min, `{"context": retriever | format _docs, "question": RunnablePassthrough ()}` is the first item in the chain ... how exactly does that get coerced to a RunnableParallel? What does the coercing and when is it done? In Python, `__or__` is called on the item to the left of the operator, which here is a dictionary ...

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před měsícem

      LCEL does some kind of magic and interpretes this as RunnableParallel. How be honest, I don´t really know how

  • @Lowlightu
    @Lowlightu Před 2 měsíci

    Amazing video!
    Interestingly the result of the RAG was Tuna instead of "thuna", any idea why it didn't use the word from your documents and supposedly used its own knowledge.

  • @Kube4x
    @Kube4x Před měsícem

    How would it work if I had more than one input var in the prompt. For example, my prompt has {height} and {weight} how do I pass both values with runnable ?

  • @jacehua7334
    @jacehua7334 Před měsícem

    Really great video so I'm guessing you can actually pass the metadata the same way that you do at the end so the LLM can consider the metadata as well?

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před měsícem

      The metadata is not for the LLM, the metadata is for you. Retrievers can use them to filter or so, but you don´t pass them to the LLM

    • @jacehua7334
      @jacehua7334 Před měsícem

      @@codingcrashcourses8533 let’s say I want to do a recommendation system of some sort. Besides considering the text embeddings how might I also include the metadata as a consideration. I’ve seen people do self querying but kind of interested if this can be put in as well into the prompt.

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před měsícem +1

      @@jacehua7334 Well to be honest, I don´t see any value in doing that, but you can of cause preprocess your documents and just append the metadata as string to the content and tell the LLM to take it into consideration for whatever you want. But I think it´s a bad idea to pass it to the LLM. Do whatever you want before, but don´t pass it to the LLM

  • @farhanafridi8694
    @farhanafridi8694 Před 2 měsíci

    Is their any way i can include memory in the code you provided at the last?
    I am encountering errors while doing it.

  • @nintendo2000
    @nintendo2000 Před 2 měsíci

    what vs code extension are you using to run notebooks?

  • @abhinavmane60
    @abhinavmane60 Před měsícem

    Hey I am building a bot for a call centre but I want the bot to do a credential check first like confirm the name how do I achieve that please respond.

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před měsícem

      You need some kind of routing mechanism to detect this. You can watch my "routing" video on my channel to take the ideas from there.

    • @abhinavmane60
      @abhinavmane60 Před měsícem

      @@codingcrashcourses8533 Oh okay thanks see you there

  • @user-dk8dm8db8t
    @user-dk8dm8db8t Před 2 měsíci

    Can you share the notebook? It'd be of great help!

  • @ericmagalhaes
    @ericmagalhaes Před 16 dny

    If possible I would give 1k likes! that solved hours of studying!

  • @yazanrisheh5127
    @yazanrisheh5127 Před 2 měsíci

    first

  • @kacperwodarczyk9349
    @kacperwodarczyk9349 Před 2 měsíci +3

    in their shitty documentation should be a links to your videos

  • @fraternitas5117
    @fraternitas5117 Před 2 měsíci

    LCEL is a huge mistake to invest in.