Advanced RAG 03 - Hybrid Search BM25 & Ensembles

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • Colab: drp.li/biRYp
    My Links:
    Twitter - / sam_witteveen
    Linkedin - / samwitteveen
    Github:
    github.com/samwit/langchain-t... (updated)
    github.com/samwit/llm-tutorials
    00:00 Intro
    00:06 BM 25
    01:25 Code Time
    #langchain #openai #llm
  • НаукаНаука

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

  • @SpenceDuke
    @SpenceDuke 9 месяцев назад +10

    Very thankful for these videos, please continue with the series

  • @kenchang3456
    @kenchang3456 9 месяцев назад +3

    Thanks Sam, this title caught my eye as something I could use in my POC for better search results. Really appreciate you sharing.

  • @sup5356
    @sup5356 9 месяцев назад +3

    concise, interesting and useful content as always. Super series this, very interesting. Many thanks!

  • @micbab-vg2mu
    @micbab-vg2mu 9 месяцев назад +1

    Great thank you !!! This hybrid approach is quite interesting.

  • @K-Djoon
    @K-Djoon 9 месяцев назад

    Thank you so much for your sharing. This is so amazing!!

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

    Thanks for this video please continue this series

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

    This was awesome and quite informative, I heard about BM25 a couple of days back and now I know where it fits.
    Also I would request you to do a video on RAG Fusion if possible.

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

      Yeah will certainly going to do a RAG Fusion video

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

    @sam thanks for the content, will you please explain how can we use hybrid search for the document which you have used for self querying retrieval.

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

    Awesome

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

    Thanks a lot, please add agents with vectordb & rag video

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

    Which model would you use in production for a search over in documents? Thank you

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

    Hey Sam!, these videos are great, thank you for taking the time to make them. In your oppinion what is the best, managed, large scale RAG solutions provider? I'm helping a company that has around 2000 plus documents,

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

    By evaluating vector DBs for production, i came across weaviate, which supports hybrid search out-of-the-box also with weighting the search results. Maybe it depends on your use-case if you go with langchain or a build-in DB solution.

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

      yes! same, it's excellent

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

      How is Weaviate different from Pinecone or the functionality inside Neo4J?

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

      Weaviate lets you pick the ranking algorithm you want to use, which is a step up from using LangChain directly. But not everyone uses Weaviate for various important reasons, and there are only two algorithms currently available. I imagine that is something LangChain will add directly eventually, and Weaviate will continue to build out. The Reciprocal Rank Fusion algorithm that LangChain uses is probably good enough for most use cases, so you can probably live without Weaviate if you are already committed to something else. But definitely good to consider weaviate if hybrid is important to you, plus a whole bunch of other reasons.
      But as far as this demo goes, it shows the default way to do hybrid search with LangChain, so very useful for anyone looking into this approach. Then you just build your knowledge from there! For example, you may want to write a function that adds a third retriever to the rankings weighted in a certain way that is beneficial to your specific use case. Start with this demo, and then replace the ensemble retriever with your own function within the LangChain chain.

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

    Hey man, don't forget to use night mode. If watching on a big screen it's had. Thanks for the video 👊

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

    How do I use this with more than a single key word?

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

    how to do this if you have millions of text rows and you want your search to be sub 100ms?

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

    Very useful, thank you! Is it possible to update it with opensearch vectorstore instead of FAISS?

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

      Thats what makes LangChain great, you just swap out vectorstores/retreivers. For example, for ChromaDB:
      vectorstore = Chroma.from_documents(
      documents=documents,
      embedding=embedding_function,
      collection_name=collection_name,
      client=chroma_client
      )
      dense_retriever = vectorstore.as_retriever()

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

    Interesting add-in feature from langchain. You can search with BM25retriever in source documents (pdf etc.)? Does it search directly in the source document or in the embedding? I suppose ensemble both searches will affect performance when querying a lot of documents/embeddings... Thanks for the update!👍

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

      The ensemble allows you to do both. Yes you can use the BM25 alone if you just want that.

  • @ChairmanHehe
    @ChairmanHehe 9 месяцев назад +2

    how is bm25 able to retrieve documents that do not contain any verbatim words from the query?

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

      This is very important question to understand. There are lot of videos of RUclips but many of them just do not deep dive explain. They just explain what's working and ignore what's not working. I am facing tons of problems while implementing RAG in actual projects.

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

    Hey SAM, can you please make a video on RAG using knowledge graphs?? Thanks

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

      Yeah I really want to do this, one challenge is find a way for people to easily run Neo4J. I have been looking at alternatives if you have any suggestions please let me know.

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

    this is a nice idea but the actual implementation is way different than the example. there's no way you can implement this at all like the example which is disappointing. keyword style searches are imo very poorly supported in langchain. there are tons of gotchas for e.g. in the elasticseach classes which seems to me be one of the only realistic ways to implement this.