How to build chat with your data using Pinecone, LangChain and OpenAI

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ส.ค. 2024
  • / zackproser
    I show step by step how to build a Chatbot using Pinecone, LangChain and OpenAI in this easy to follow tutorial for beginners.
    I ingest my entire blog full of MDX posts, chunk and convert them to embeddings using LangChain and OpenAI. Then I upsert them into my Pinecone vector database to build a knowledge base that our chatbot can use to answer questions.
    I build everything using a Jupyter Notebook to make it extremely easy to follow along.

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

  • @sipanpalCineNuggets
    @sipanpalCineNuggets 25 วันที่ผ่านมา +1

    Your tutorial was very helpful. Please keep up the good work.👍

    • @zackproser
      @zackproser  25 วันที่ผ่านมา

      Thanks so much 🙏 I will!

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

    example tutorial, very clear and useful

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

      Thanks so much 🙏 Glad you found it useful. Stay tuned for more.

  • @SuiGio
    @SuiGio 18 วันที่ผ่านมา +1

    That's great content. How would you make the model have a memory on the chat?

    • @zackproser
      @zackproser  16 วันที่ผ่านมา +1

      Thanks so much for your feedback 😃 Great question - the TLDR is that you keep an ever expanding array of messages and pass them back and forth between the LLM and user each time. I may add an example of this in the future. You could also use a vector db to store the history and query it at inference time....

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

    Really great tutorial, thanks a lot!

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

      Thanks so much for the feedback and support 🙏 Glad it was useful. LMK what else you'd like to see in the future.

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

      @@zackproser I still haven't thought on a specific issue, but I will be glad to update you when I'll have...

  • @naufal-yahaya
    @naufal-yahaya 27 วันที่ผ่านมา

    Great tutorial. I'm curious, how do i store all the messages from users and AI
    1. User send a message

    • @zackproser
      @zackproser  26 วันที่ผ่านมา

      Hi @naufal-yahaya - thanks for your support and for your question! Yes, I've recently spoken with a Pinecone developer who is doing exactly that - he shared that vector databases make an excellent place to store conversational history, because retrieval is so fast and accurate, and because you can skip having to send all that data back and forth each time.

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

    Zachary if I have to add the api key directly not from the environment, then where will I put it in your above code?

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

      Hi Usman,
      Thanks for your question! Are you saying that you're not able to export an environment variable that contains your key? In a Jupyter notebook host like Google Colab or Kaggle, you can use their secrets integration to set your Pinecone or any other API key. You then reference the secret using their library. Here's a link to a ton of example notebooks where we demonstrate this pattern: github.com/pinecone-io/examples
      Let me know if that's what you mean or not!
      Best,
      Zack

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

      @@zackproser I want to ask that setting the pinecone api key in an environment variable is the only way to include the pinecone api key in the code.
      can i make a variable as api_key and equals it to actual api key in the code and then inset it in the pinecone???

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

      @@usmantahir2609 you could also hard code your API key in your call to instantiate the Pinecone client, but I wouldn't recommend that from a security perspective

    • @roopeshk.r3219
      @roopeshk.r3219 หลายเดือนก่อน +1

      @@zackproser I checked about hard code of API but it was not working as expected., can you share the doc for that ? thanks

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

      @@roopeshk.r3219 @zackproser exactly I am also facing this problem
      @roopeshk.r3219 can u tell me ur linkedin?

  • @RajPatel-d4u
    @RajPatel-d4u หลายเดือนก่อน

    OpenAI v2 has vector store feature now. It automatically splits into chunks and creates embeddings. Is there a way to use that instead of Pinecone and langchain?

    • @zackproser
      @zackproser  26 วันที่ผ่านมา

      Hi @RajPatel-d4u and thanks for your question! Ah I wasn't aware of that yet, but it makes sense and I'm guessing it's an extension of the vector datastore they already had for processing the documents of the custom GPTs - yes, so long as their API supports query methods, you should be able to swap that in instead. I may do another video in the future examining that in more detail.

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

    While creating the RetrievalQA, it shows this error of not being able to instantiate abstract class BaseRetriever with abstract methods _aget_relevant_documents, _get_relevant_documents

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

      Hi, did you use the same Notebook I linked?

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

      @@zackproser no , I'm using the same code for rag pipeline