Building a RAG application from scratch using Python, LangChain, and the OpenAI API

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии •

  • @sgatea74
    @sgatea74 9 месяцев назад +15

    This is the best crispy clear RAG walkthrough that I have seen until now ! Congratulations and thank you for putting effort into educational videos on GenAI use

  • @beastunleased0205048
    @beastunleased0205048 10 месяцев назад +38

    DUDE!! this is the best resource I have found so far. The part I truly appreciate is that you focused on the conceptual parts and NOT just here is the code

  • @DavidMwiti-v3i
    @DavidMwiti-v3i 10 месяцев назад +10

    This will be a great resource! I'd love to see a dedicated video diving deeper into LangGraphs and their applications. Keep up the great work!

  • @davieslacker
    @davieslacker 8 месяцев назад +2

    I’m only 15 minutes into this and was mostly looking for a RAG example, but I must say as a beginner to all this I really appreciate how much you’re breaking down the entire process. I haven’t used langchain for invoking models and you have me excited to do so now. The workflow seems much more logical this way.

  • @marcinp3343
    @marcinp3343 10 месяцев назад +4

    For me, good mentor is someone that can explain difficult topics with elegant simplicity and you doing it superb! Looking forward to Cohort 12 :)

    • @underfitted
      @underfitted  10 месяцев назад

      I’ll see you in class!

  • @avneeshkhanna
    @avneeshkhanna 3 дня назад

    This is a great tutorial for someone who wants a hands-on approach to run basic gen AI projects

  • @Kidzwish
    @Kidzwish 6 месяцев назад +1

    You have sorted most of my understandings for RAG which i was missing here and there, this is your zero shot prompt for me understanding RAG basics Thank You !!

  • @anatoliisyvaschenko1553
    @anatoliisyvaschenko1553 10 месяцев назад +7

    Looking forward to upcoming videos! Also it would be interesting if you can cover the following topics:
    1. Langchain - saving context of conversation and using in next questions
    2. Dialogflow intents or if it can be built in LangChain.
    3. the real-time data to be added based on conversation.
    4. Streaming audio to LLM, and the way to implement conversations like chatGPT by holding button, with less latency.

    • @Shubhampalzy
      @Shubhampalzy 6 месяцев назад

      I wanted to ask something related to 1:11:20.
      If I have understood correctly, the cell being run at this time is showing the records present in the pinecone database that match closely with the user prompt and the answer would be generated based on this.
      My database consists of a large number of code files (HTML,typescript,python) and I wish to make a chatbot on these files so the user is able to get answers related to each file. I wish to know the best approach to store the vector embeddings of many different files in pinecone so that I can also provide the exact reference to that code file name.
      Also if the answer is generated from multiple files, it should be able to refer that too.

  • @tamasmatolcsi4129
    @tamasmatolcsi4129 10 месяцев назад

    Köszönjük!

  • @zayndejohn2432
    @zayndejohn2432 12 дней назад

    whose dad is this. i thank the lord for him because wow, i have watched so many rag videos but this is perfection 100/10 it is just so simple yet in depth thank you

  • @thekmk1194
    @thekmk1194 4 месяца назад

    Brother the most comprehensive resource for learning RAG. No doubt this is the ultimate tutorial video of RAG so far.

  • @GrantNaylor-b8l
    @GrantNaylor-b8l 3 месяца назад

    The most informative and helpful video I have found. Working through each of the concepts and building on to the previous lesson has been very well executed here, unlike other content I have seen that tends to skip over detail or push forward too quickly. In addition, the fact you demonstrate concepts like vector stores using a memory based examples first is so much more insightful than jumping straight into Pinecone or Chroma. Thank you!

  • @Kim-kr6of
    @Kim-kr6of 10 месяцев назад +9

    Nice - looking forward to dive into this.
    Could be nice to see a setup for Application with local LLM for private docs. I think a lot of people are looking for such a video 🤞🏻💪🏻 TY for your Nice work!

  • @Alidotty
    @Alidotty 2 месяца назад

    you are exactly what ive been searching for , for days. so amazing such a great tutor and amazing person

  • @martinsandor707
    @martinsandor707 3 месяца назад

    I just started my MSc in Data Science, and one of our projects is creating a RAG API similar to the one in this video. Your content is extremely helpful! Thank you very much!

  • @maarijahmed9031
    @maarijahmed9031 5 месяцев назад +1

    You are a truly amazing instructor of Machine Learning and LLMs, Truly inspired!

  • @AI-Reviews-and-Tutorials
    @AI-Reviews-and-Tutorials 9 месяцев назад +1

    Fantastic tutorial! Thanks a lot! I already saw other tutorials on LangChain and also I purchased a Udemy course. This tutorial here is the best of all. Everything is well explained and can easily be understood.

  • @cheenakachroo
    @cheenakachroo 4 месяца назад

    its so far the best content available across youtube on RAG. keep it up!

  • @salamina_
    @salamina_ 9 месяцев назад

    Wow. Great teaching! Explaining the "why" on your lessons, in this case (RAG) is what you dont find in other teaching material . Thank you, this has been very insightful! 👍

  • @footsldr
    @footsldr 3 месяца назад

    Brilliant explanation. I understand the what, how and why of RAG applications a lot more clearly now than before I watched this video. Thanks a lot!

  • @batkibalint
    @batkibalint 10 месяцев назад +1

    Great tutorial! Thank you Santiago!
    I actually tried it myself (first time using the OpenAI API). I was able to build a RAG application to get answers based on a PDF document. And it works!
    However, I see that there are some more stuff to think about, such as storing the embedded pages in the vectorstore might not be the best approach.
    I am looking forward to new videos!

  • @RankMotion
    @RankMotion 10 месяцев назад +1

    I have implemented your example in node js and it's working like a charm. Thanks!

    • @RankMotion
      @RankMotion 10 месяцев назад

      But I really hate the langChain api. I'm trying to implement it as plain old functions.

    • @Shubhampalzy
      @Shubhampalzy 6 месяцев назад

      I wanted to ask something related to 1:11:20.
      If I have understood correctly, the cell being run at this time is showing the records present in the pinecone database that match closely with the user prompt and the answer would be generated based on this.
      My database consists of a large number of code files (HTML,typescript,python) and I wish to make a chatbot on these files so the user is able to get answers related to each file. I wish to know the best approach to store the vector embeddings of many different files in pinecone so that I can also provide the exact reference to that code file name.
      Also if the answer is generated from multiple files, it should be able to refer that too.

  • @ddre54
    @ddre54 6 месяцев назад +1

    Great content! Extremely helpful to get hands-on introduction into LLM and RAG. Thank you!

  • @serhiua
    @serhiua 8 месяцев назад +1

    Thank you, this is top-notch content!
    Many new for me llm rag concepts are clearly explained, and most importantly, it shows how they are interconnected and reinforce each other.

  • @soutulhira
    @soutulhira 4 месяца назад

    Can't explain how much i have learned from this GREAT video. So far the BEST !!! thanks for such amazing explanation 👍👍👍

  • @pedropaulotelho8603
    @pedropaulotelho8603 3 месяца назад

    Dude, you made my life much easier after this video!! Keep doing this!! Thank you so much

  • @Azam.Rajabov
    @Azam.Rajabov 10 месяцев назад +1

    Love it how you explain everything step by step!

  • @AhmedShafikk
    @AhmedShafikk 9 месяцев назад +1

    man this is great, keep it up.
    also it will be appreciated if you make a video for a full RAG system including:
    1. adding the most suitable way of using memory .
    2. how to embed and deploy these application for production(web, mobile, saas...etc)

    • @Shubhampalzy
      @Shubhampalzy 6 месяцев назад

      I wanted to ask something related to 1:11:20.
      If I have understood correctly, the cell being run at this time is showing the records present in the pinecone database that match closely with the user prompt and the answer would be generated based on this.
      My database consists of a large number of code files (HTML,typescript,python) and I wish to make a chatbot on these files so the user is able to get answers related to each file. I wish to know the best approach to store the vector embeddings of many different files in pinecone so that I can also provide the exact reference to that code file name.
      Also if the answer is generated from multiple files, it should be able to refer that too.

  • @riemannderakhshan1037
    @riemannderakhshan1037 7 месяцев назад

    By far you are one of the top three the best instructor I have ever seen. You remind me Richard Phillips Feynman.

  • @samuelwest6817
    @samuelwest6817 9 месяцев назад

    Genuinely found this to be hyper-valuable, after watching this, tons of concepts now actually make sense to me, Thank you!

  • @lokeshsharma4177
    @lokeshsharma4177 8 месяцев назад

    "All you need is Attention" to the details this GREAT teacher is providing , he could have picked up a simple context within the limits and would have been done BUT no his zeal to share and show every single road block that we need to know is OUTSTANDING. God Bless You. Could you please do a Speech To Speech Application as well?

  • @MrGirishbarhate
    @MrGirishbarhate 6 месяцев назад

    excellent tutorial explaining theory as well as code in very beginner friendly manner, subscribed! I found you via twitter feed and started this first video.

  • @UjjwalDevarapalli
    @UjjwalDevarapalli 10 месяцев назад +2

    Thanks for the video. Very clear explanation of all concepts involved. Looking forward to your next videos.
    If possible, please can you cover the topic of production deployments and operations for a LLM project.

  • @tee_iam78
    @tee_iam78 8 месяцев назад

    Million stars to this video. The content is clear, precise and well explained. Thank you.

  • @johnny1966m
    @johnny1966m 10 месяцев назад

    Thank you. It is the perfect video when you want start doing RAG just after knowing what RAG is for. Now it is easy to do chatbot for technical documentation queries.

  • @seallyolme
    @seallyolme 10 месяцев назад

    I already have experience with Langchain, but wanted to learn more about Pinecone. You are just exceptional at teaching. Thank you so much for this. :)

  • @wis_advice
    @wis_advice 10 месяцев назад

    Thanks!

  • @girirajalone7825
    @girirajalone7825 6 месяцев назад

    Best Video on RUclips regarding RAG. Must watch....

  • @ImadSyed-gb8gg
    @ImadSyed-gb8gg 10 месяцев назад

    This tutorial was the perfect level of theory + code for a beginner like me to get enough knowledge to start tinkering myself. Subscribed and looking forward to more content!

  • @Abdallah-Elsharawy
    @Abdallah-Elsharawy 5 месяцев назад +1

    You're amazing!! Thank you for covering both code and conceptual aspects of the concept.

  • @AugustoBouzas
    @AugustoBouzas 5 месяцев назад +1

    👏Congrats and thanks Bro for this incredible video! What every student needs: knowledge and passion in one place. Very clear.💪

  • @grabih
    @grabih 7 месяцев назад

    Awesome explanation and content. Your content is by far the best I found on RAG... hats off!👏

  • @TooyAshy-100
    @TooyAshy-100 10 месяцев назад

    Santiago, thank you for the valuable RAG videos. Your insights are well-explained and informative. I would be interested in seeing more of your work on this topic.

  • @AdnanAli
    @AdnanAli 8 месяцев назад

    Thanks for taking the effort to explain the concepts one by one.

  • @huzafaarshad973
    @huzafaarshad973 7 месяцев назад

    it is not 15 minute and i am sure it is one of the best video on this topic

  • @tehamill1
    @tehamill1 4 месяца назад

    This is an amazingly thorough introduction thank you

  • @andilemasela2719
    @andilemasela2719 Месяц назад

    Hi on 47:20 i think it grouped number five to the left because of the word "drives" not "audio"

  • @AnderZvy
    @AnderZvy 6 месяцев назад

    What can I say, its just awesome what the world of possibilities you open to us, now I've more clear idea on how to make what I want with sort ideas, thank you I hope to join soon to your school , gracias :)

  • @steveokay8810
    @steveokay8810 10 месяцев назад +1

    So, langchains are pipes for LLMs ?
    Do they provide any of the output splitting/redirection that you get from classic stdio ?

  • @rakeshgohane8938
    @rakeshgohane8938 10 месяцев назад +1

    Hi Santiago, at 31:33 you mentioned that 1000 words is 750 Tokens. Isn't it the other way round? 1 word around 3/4 Tokens?

    • @underfitted
      @underfitted  10 месяцев назад

      Ha! Yeah, more tokens than words. I’m always getting this wrong (notice you also made the same mistake in your comment.)
      1 word is about 1.3 tokens

    • @rakeshgohane8938
      @rakeshgohane8938 10 месяцев назад

      @@underfitted😅

  • @snrajamurugan123
    @snrajamurugan123 10 месяцев назад

    Excellent walk through capturing all the required details

  • @meetbardoliya6645
    @meetbardoliya6645 9 месяцев назад

    You're the Legend, Santiago!
    Love the way you explain :)

  • @wazir3974
    @wazir3974 4 месяца назад

    Such an amazing indepth video! Thank you so much brother

  • @piclezwd
    @piclezwd 10 месяцев назад

    Awesome video with great explanation, step by step with examples, images and code!! Love it.

  • @rauloliveiradev
    @rauloliveiradev День назад

    I definitely would super like this video if I have the option. Amazing class. Thank you!

  • @sehrishilyas8416
    @sehrishilyas8416 6 месяцев назад

    Loved watching it... You explain every thing so nicely!!!❤

  • @sharky-luna
    @sharky-luna 10 месяцев назад +1

    Great video. The jupyter notebook was very helpful!
    Interesting that, by default and only given the context of "Patricia likes white cars," the parser came to the conclusion that Patricia's car was white even though she might not actually own a white car. I added instructions to tell me when it was inferring an answer but makes me wonder what other things it might be inferring without telling me why.

    • @freerider6300
      @freerider6300 10 месяцев назад

      I don't know why but I get the response "I don't know" for that question even though my code and the prompts are identical and I'm also using the OpenAI API.

    • @sharky-luna
      @sharky-luna 10 месяцев назад

      @@freerider6300 Given that the template for the prompt says to respond as "I don't know" that seems appropriate. Are you by chance using gtp-4 vs gtp3.5-turbo? I changed my model to use gtp-4 and I get the response as "I don't know" where, with gtp-3.5-turbo, I get the response as "White" just like it shows in the video.

  • @ShubhamSaboo-j9g
    @ShubhamSaboo-j9g 10 месяцев назад +1

    Best beginner level explanation of RAG with Langchain on Internet. Great one Santiago!

  • @lakraMundka
    @lakraMundka 8 месяцев назад

    Amazing video. Thanks for the work you do in putting all this together.

  • @MarcelDeufel
    @MarcelDeufel 2 месяца назад

    Amazing video! Great work, really helped a lot in my understanding of RAG

  • @ieltxualganaras6031
    @ieltxualganaras6031 10 месяцев назад

    This video got to me on the perfect day, you just solved a whole project for me with this. Thanks!

  • @sushanths.l4865
    @sushanths.l4865 10 месяцев назад +3

    Keep uploading this kind of content

  • @MahimaChhagani
    @MahimaChhagani 10 месяцев назад +1

    Love your method of teaching!!!

  • @TonyMM
    @TonyMM 10 месяцев назад +1

    Excellent introduction to Pinecone use for RAG using Langchain. Looking forward to more...I had an error 2/3rds way through AttributeError: 'builtin_function_or_method' object has no attribute '__func__'. Eventually, I installed Python 3.11.8, re-cloned the repo, installed the same dependencies and it worked again, no problem!

  • @Shubhampalzy
    @Shubhampalzy 6 месяцев назад

    First of all, thanks for providing this awesome video on RAG.
    I wanted to ask something related to 1:11:20.
    If I have understood correctly, the cell being run at this time is showing the records present in the pinecone database that match closely with the user prompt and the answer would be generated based on this.
    My database consists of a large number of code files (HTML,typescript,python) and I wish to make a chatbot on these files so the user is able to get answers related to each file. I wish to know the best approach to store the vector embeddings of many different files in pinecone so that I can also provide the exact reference to that code file.
    Also if the answer is generated from multiple files, it should be able to refer that too.

  • @atulbisht9019
    @atulbisht9019 7 месяцев назад

    Thanks for the video. The content and the explanation is top notch.

  • @theanonymous92
    @theanonymous92 4 месяца назад

    Amazing, You were just Amazing. Thank you so much for Explaining with this level of detail. Subscribed!
    btw, I really think your project should be used to build a Rag system with 'your video' as the knowledge base

  • @zhihaoguo103
    @zhihaoguo103 8 месяцев назад +1

    Thank you for the great video! This is very insightful and helpful. I have one question: What if there are multiple documents input, and the answer you want to retrieve exists across different chunks? In that case, only fetching the most similar chunk will generate incomplete answer. However, if we search the top N most similar chunks, how can we make sure that they can be connected meaningfully (it could be the case that the top 3 most similar chunks are on Page 3, 80, 100, and there is no meaning connecting them together)? Thanks again for the effort you put in this video!

  • @anonymoustechnopath1138
    @anonymoustechnopath1138 10 месяцев назад +1

    Such an amazing Resource !! Thanks Santiago ❤

  • @virajkarjol4868
    @virajkarjol4868 8 месяцев назад

    WOOWWW!! an amazing effort thank you so much. Look forward for more

  • @duanxn
    @duanxn 10 месяцев назад +1

    Thanks for the detailed, clearly explained tutorial. Nice

  • @gabrielomogbai256
    @gabrielomogbai256 10 месяцев назад

    Thank you for this, your explanation on embeddings was superb!!

  • @toddroloff93
    @toddroloff93 7 месяцев назад

    Amazing video. You are such a wealth of knowledge. Thankyou for these great video tutorials. Please keep them coming!!😃

  • @breynerrojas1735
    @breynerrojas1735 9 месяцев назад

    Thank you a lot Santiago, best tutorial I have watched so far

  • @OPXDataAnalytics
    @OPXDataAnalytics 9 месяцев назад

    Finally a video that i can follow through and understand what embedding and vector is. Thanks!

  • @notanotherstandup
    @notanotherstandup 6 месяцев назад

    Beautiful video sir! Great work!

  • @MauricioFagundesBSB
    @MauricioFagundesBSB 10 месяцев назад

    Wonderful video! I made my post-graduate final project exactly like this.

  • @ayushidubey8734
    @ayushidubey8734 6 месяцев назад

    Superb explanation, Thank you for such great informative videos!!!

  • @harshaldharpure9921
    @harshaldharpure9921 9 месяцев назад +1

    you have not use the opensource vector database and opensource language model in the above video. please try to make video on that.

  • @abhichintapalli7444
    @abhichintapalli7444 8 месяцев назад

    Could you also do a video on how you can show the source documents that the context comes from?

  • @vasuchewprecha
    @vasuchewprecha 10 месяцев назад

    best class period. you need to launch LLM course!

  • @sunitjoshi3573
    @sunitjoshi3573 5 месяцев назад +1

    Great work here! Thanks a lot. 😊

  • @nachoeigu
    @nachoeigu 8 месяцев назад

    You gain a new follower. Great job!

  • @causalinference4176
    @causalinference4176 7 месяцев назад

    So great video, you alway explain complex concepts very well!

  • @mohamedadel1734
    @mohamedadel1734 8 месяцев назад

    Hello Santiago!
    Thanks for this amazing video and for the explanation. Is it possible to provide an updated version of this RAG system to have be a chatbot with a conversational behaviour not only Q&A system? so it takes into consideration the previous questions and answers as part of the context to be able to answer questions that refer to something already mentioned before?

  • @m4rth1n13
    @m4rth1n13 10 месяцев назад +1

    if anybody had the same problem with activating the virtenvir venv as i: source command didnt work - it’s just different based on the os so source works for linux/macos and the .venv\scripts\activate for windows

  • @Jorge-ls9po
    @Jorge-ls9po 10 месяцев назад +1

    What value do you set to PINECONE_API_ENV? If I try to use text-embedding-3-small it wont work. For some reason it deploys ada. Do you know why? btw, nice intro to RAGs and its details.

    • @underfitted
      @underfitted  10 месяцев назад +2

      We don't need that one any more, actually. I apologize. When I wrote the code, that variable was needed, but not anymore.

  • @srikanthdongala6922
    @srikanthdongala6922 7 месяцев назад

    I am building a RAG application, but I am just looking for some advice on issues:
    1. How to make it answer general questions like greetings, farewell, etc., directly without trying to retrieve them as there is no need to do so? I know I can use LLM to classify the question but I will need an additional API call for that (if the model is openai)
    2. I implemented RBAC if a single question from a user contains two queries and the user only has access to the document that is sufficient to answer one of the two queries, I retrieve the context of whatever is close to that (here the context is sufficient to answer one of the two queries) but the response from LLM is I don't know, which means it is failing to extract the context and answer at least whatever it can, how do I address this?
    3. If I ask a specific question it answers, but if I ask in an overall sense say, what is the summary of XYZ doc, it fails to answer
    it would be great if someone could help me with the possible approaches to fix this thanks 🙏

  • @tinchoroman10
    @tinchoroman10 8 месяцев назад

    Love your video! I you allow me a small suggestion, I would have put your face in the top left corner in order to avoid the overlapping with the code. Great Work

  • @MageDigest-c1z
    @MageDigest-c1z 25 дней назад

    I must say its a superb video. thanks for the clarification.

  • @abhichintapalli7444
    @abhichintapalli7444 8 месяцев назад

    How would you scale to more than 1 document (in your case 1 transcript). Would you continue to use 1 vector store for all the documents or are there other methods? Great video btw!

  • @jenniferdsouza7708
    @jenniferdsouza7708 Месяц назад

    Thank you for the really great video!! I think Pinecone updated its console because I could not find the ENV variable value beside my API key.

  • @ravindarmadishetty736
    @ravindarmadishetty736 5 месяцев назад

    This video is excellent.
    how can we manage when we have lack of memory during splitting to document(loading in tempfile) when we have 10GB/100GB/more, of pdf or any format documents ? Please suggest as it is more problem with memory issue.
    Also please make a video on different types of RAG(like DR RAG...etc) and RAG + Fine tune combination method along with how will you evaluate the response is reliable or not.

  • @niklasfischer3146
    @niklasfischer3146 10 месяцев назад +1

    Thanks for the video! Perfectly explained. However I did get an error when I tried to transcribe the YT Video:
    URLError:
    Why that?
    Thanks!

  • @bnshanks
    @bnshanks 8 месяцев назад

    Great, thanks, Santiago. What about using gpt4?

  • @TomasTrenor
    @TomasTrenor 8 месяцев назад

    Thanks Santiago ! As always , high value content ! Just one quick question: why not match the LLM max content size with the chunk document size ?

  • @farhanfarooq855
    @farhanfarooq855 10 месяцев назад

    Super helpful walkthrough. Thank you !

  • @anatoliisyvaschenko1553
    @anatoliisyvaschenko1553 10 месяцев назад +1

    Nice video! Very helpful for beginners! Just one question, in terms of performance isn't it better to create one prompt and one call to model with the context, answer and translation? It would be just one call to OpenAI server instead of two..

    • @underfitted
      @underfitted  10 месяцев назад +1

      For that particular example, yes. One call would be better.
      But think beyond that. You may have two separate chains using different models and processes. One call might not be possible, and that’s where chaining different chains might be helpful.

    • @anatoliisyvaschenko1553
      @anatoliisyvaschenko1553 10 месяцев назад

      Oh, I see.. Valid argument! Thanks for explanation, it's really great explanation of the concept itself!

  • @haticetozoglu2752
    @haticetozoglu2752 8 месяцев назад

    Thanks for your valuable insights! It has been immensely helpful.

  • @saxegothaea_conspicua
    @saxegothaea_conspicua 4 месяца назад

    Impresionante. Que gran tutorial, es el tercero que veo para aprender RAG, y los conceptos y el procedimiento están muy bien explicados. Muchas gracias!!