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

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

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

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

    Best teacher on TH-cam , get this man on million subs asap.

  • @ramishelh9998
    @ramishelh9998 18 วันที่ผ่านมา

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

  • @efneogearbox
    @efneogearbox 29 วันที่ผ่านมา +2

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

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

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

  • @mr.daniish
    @mr.daniish 2 หลายเดือนก่อน +3

    Pure knowledge bomb!

  • @mateusztylec215
    @mateusztylec215 13 วันที่ผ่านมา

    This is just great!

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

    exctremely helpful video, thank you very much

  • @user-sj1tp5mg6v
    @user-sj1tp5mg6v 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน

      thank you for that great feedback

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

      @@codingcrashcourses8533 yeah their docs need attention; great vid

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

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

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

    Finally!

  • @yazanrisheh5127
    @yazanrisheh5127 2 หลายเดือนก่อน +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  2 หลายเดือนก่อน +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 2 หลายเดือนก่อน +2

      @@codingcrashcourses8533 Thank you so much!

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

    ❤❤

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

    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  หลายเดือนก่อน

      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 หลายเดือนก่อน

      @@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  หลายเดือนก่อน +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

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

    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  หลายเดือนก่อน

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

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

    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.

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

      Interesting point. I guess the llm just corrected the Spelling mistake

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

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

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

    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 ?

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

    what vs code extension are you using to run notebooks?

  • @user-dk8dm8db8t
    @user-dk8dm8db8t 2 หลายเดือนก่อน

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

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

      sorry - totally forgot to include that. Updated the description. Thank you for pointing it out

    • @user-dk8dm8db8t
      @user-dk8dm8db8t 2 หลายเดือนก่อน

      @@codingcrashcourses8533 No prob!

    • @user-dk8dm8db8t
      @user-dk8dm8db8t 2 หลายเดือนก่อน

      @@codingcrashcourses8533 Thanks!

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

    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  หลายเดือนก่อน

      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 หลายเดือนก่อน

      @@codingcrashcourses8533 Oh okay thanks see you there

  • @ericmagalhaes
    @ericmagalhaes 11 วันที่ผ่านมา

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

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

    first

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

    in their shitty documentation should be a links to your videos

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

    LCEL is a huge mistake to invest in.

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

      Why?

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

      @@codingcrashcourses8533 because it is a DSL and not a general purpose programming language it forces vendor lockin.