LangChain101: Question A 300 Page Book (w/ OpenAI + Pinecone)

  Рет қаралды 206,483

Greg Kamradt (Data Indy)

Greg Kamradt (Data Indy)

Күн бұрын

Пікірлер: 623
@edzehoo
@edzehoo Жыл бұрын
So even Ryan Gosling's getting into this now.
@DataIndependent
@DataIndependent Жыл бұрын
It's a fun topic!
@blockanese3225
@blockanese3225 Жыл бұрын
@@DataIndependent he was referring to the fact you look like Ryan Gosling.
@Author_SoftwareDesigner
@Author_SoftwareDesigner Жыл бұрын
​@@blockanese3225 I think understands that.
@blockanese3225
@blockanese3225 Жыл бұрын
@@Author_SoftwareDesigner lol I couldn’t tell if he understood that when he said it’s a fun topic.
@nigelcrasto
@nigelcrasto Жыл бұрын
yesss
@sarahroark3356
@sarahroark3356 Жыл бұрын
OMG, this is exactly the functionality I need as a long-form fiction writer, not just to be able to look up continuity stuff in previous works in a series so that I don't contradict myself or reinvent wheels ^^ -- but then to also do productive brainstorming/editing/feedback with the chatbot. I need to figure out how to make exactly this happen! Thank you for the video!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Glad it was helpful
@areacode3816
@areacode3816 Жыл бұрын
Agreed. Do you have any simplified tutorials? Like explaining langchain I fed my novel into chatgpt page by page it worked..ok but I kept running into roadblocks. Memory cache limits and more.
@thebicycleman8062
@thebicycleman8062 Жыл бұрын
@@areacode3816 maybe from ur pinecone reaching its limit? or ur 4000 gpt3 token limit? i would check these first, if its pinecone the fix is easy, jus buy more space, but if its due to gpt then try gpt4 it has double the token at 8k or if that doesnt work i would figure out an intermediary step in between to introduce another sumarizing algorithm before passing it to gpt3
@gjsxnobody7534
@gjsxnobody7534 Жыл бұрын
How would I use this to make a smart chat bot for our chat support on our company? Specific to our company items
@shubhamgupta7730
@shubhamgupta7730 Жыл бұрын
@@gjsxnobody7534I have same query!
@nigelcrasto
@nigelcrasto Жыл бұрын
you know it's something big when The GRAY MAN himself is teaching you AI!!
@NaveenVinta
@NaveenVinta Жыл бұрын
Great job on the video. I understood a lot more in 12 mins than from a day of reading documentation. Would be extremely helpful if you can bookend this video with 1. dependencies and set up and 2. turning this into a web app. If you can make this into a playlist of 3 videos, even better.
@davypeterbraun
@davypeterbraun Жыл бұрын
Your series is just so so good. What a passionate, talented teacher you are!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Thank you!
@blocksystems202
@blocksystems202 Жыл бұрын
No idea how long i've been searching the web for this exact tutorial. Thank you.
@DataIndependent
@DataIndependent Жыл бұрын
Wonderful - glad it worked out.
@koraegis
@koraegis Ай бұрын
​@@DataIndependentdo you offer consulting? I'd like to do something like this for my learners / learning business. 🙂
@DataIndependent
@DataIndependent Ай бұрын
@@koraegis Happy to chat! Can you send me an email at contact@dataindependent.com with more details?
@koraegis
@koraegis Ай бұрын
@@DataIndependent Thanks! Will do it now :D
@vinosamari
@vinosamari Жыл бұрын
Can you do a more indepth Pinecone video? It seems like an interesting concept alongside embeddings and i think it'll help seam together the understanding of embeddings for more 'web devs' like me. I like how you used relatable terms while introducing it in this video and i think it deserves its own space. Please consider an Embeddings + Pinecone fundamentals video. Thank you.
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Thank you. What's the question you have about the process?
@ziga1998
@ziga1998 Жыл бұрын
@@DataIndependent I thinks that general pinecone video would be great, and connecting it with LangChain and building similar apps to this would be awesome
@ko-Daegu
@ko-Daegu Жыл бұрын
Weaviet is even better
@krisszostak4849
@krisszostak4849 Жыл бұрын
This is absolutely brilliant! I love the way you explain everything and just give away all notes in such detailed and easy to follow way.. 🤩
@CarloNyte
@CarloNyte Жыл бұрын
Duudee!!! This video is exactly what I was looking for! Still a complete noob at all this LLM integration stuff and so visual tutorials are so incredibly helpful! Thank you for putting this together 🙌🏿🎉🙌🏿
@DataIndependent
@DataIndependent Жыл бұрын
Great to hear! Checkout the video on the '7 core concepts' which may help round out the learnings
@64smarketing
@64smarketing Жыл бұрын
This is exactly what I was looking to do, but I could'nt sort it out. This video is legit the best resource on this subject matter. You're gentleman and a scholar. I tip my hat to you, good sir.
@nickpetolick4358
@nickpetolick4358 Жыл бұрын
This is the best video i've watched explaining the use of pinecone.
@DataIndependent
@DataIndependent Жыл бұрын
Nice!!
@DanielChen90
@DanielChen90 Жыл бұрын
Great tutorial bro. You're really doing good out here for us the ignorant. Took me a while to figure out that I needed to run pip install pinecone-client to install pinecone. So this is for anyone else who is stuck there
@DataIndependent
@DataIndependent Жыл бұрын
Glad it worked out
@PatrickCallaghan-yf2sf
@PatrickCallaghan-yf2sf Жыл бұрын
Fantastic video thanks. I obtained excellent results (accuracy) following your guide compared to other tutorials I tried previously.
@DataIndependent
@DataIndependent Жыл бұрын
Ah that's great - thanks for the comment
@aaanas
@aaanas Жыл бұрын
Was the starter tier of pinecone enough for you?
@PatrickCallaghan-yf2sf
@PatrickCallaghan-yf2sf Жыл бұрын
Its one project only on starter tier, that one project can contain multiple documents under one vector vector db. For me it was certainty enough to get an understanding of the potential. From my limited experience, to create multiple vector db's for different project types you will need to premium/paid and the cost is quite high. There may be other competitors offering cheaper entry level if you wish to develop apps but for a hobbyist/learning the starter tier on pinecone is fine IMO.
@mosheklein3373
@mosheklein3373 Жыл бұрын
This is really cool but i havent yet seen a query for a specific information store (in your case, a book) that chatgpt cant natively answer. For example i queried chatgpt the questions you asked and got detailed answers that echoed the answers you received and then some.
@davidzhang4825
@davidzhang4825 Жыл бұрын
This is gold ! please do another one with data in Excel or Google sheet please :)
@virendersingh9377
@virendersingh9377 Жыл бұрын
I like the video because it was to the point and the presentation with the initial overview diagram is great.
@bartvandeenen
@bartvandeenen Жыл бұрын
I actually scanned the whole Mars trilogy to have something substantial, and it works fine. The queries generally return decent answers, although some of them are way off. Thanks for your excellent work!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Glad to hear it. How many pages/words is the mars trilogy?
@bartvandeenen
@bartvandeenen Жыл бұрын
@@DataIndependent About 1500 pages in total.
@keithprice3369
@keithprice3369 Жыл бұрын
Did you look at the results returned from Pinecone so you could determine if the answers that were off were due to Pinecone not providing the right context or OpenAi not interpreting the data correctly?
@bartvandeenen
@bartvandeenen Жыл бұрын
@@keithprice3369 no I haven't.good idea to do this. I know have gpt4 access so can use much larger prompts
@keithprice3369
@keithprice3369 Жыл бұрын
@@bartvandeenen I've been watching a few videos about LangChain and they did bring up that the chunk size (and overlap) can have a huge impact on the quality of the results. They not only said there hasn't been much research on an ideal size but they said it should likely vary depending on the structure of the document. One presenter suggested 3 sentences with overlap might be a good starting point. But I don't know enough about LangChain, yet, to know how you specify a split on the number of sentences vs just a chunk size.
@borisrusev9474
@borisrusev9474 7 ай бұрын
I would love to see a video on the limitations of RAG. For instance say you have a document containing a summary of each country in Europe. Naturally one of the facts listed for each country would be the year they joined the EU. Unless explicitly stated, RAG wouldn't be able to tell you how many countries there are in the EU. I would love to see a tutorial on working around that limitation.
@DataIndependent
@DataIndependent 6 ай бұрын
nice! That's fun thanks for the input on that. You're right, that isn't a standard question and you'll need a different type of system set up for that
@sabashioyaki6227
@sabashioyaki6227 Жыл бұрын
This is definitely cool, thank you. There seem to be several dependencies left out. It would be great if all dependencies were shown or listed...
@DataIndependent
@DataIndependent Жыл бұрын
ok, thank you and will do. Are you having a hard time installing them all?
@benfield1866
@benfield1866 Жыл бұрын
@@DataIndependent hey I'm stuck on the dependency part as well
@MrWrklez
@MrWrklez Жыл бұрын
Awesome example, thanks for putting this together!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Glad it worked out. Let me know if you have any questions
@____2080_____
@____2080_____ Жыл бұрын
This is such a game changer. Can’t wait to hook all of this up to GPT-4 as well as countless other things
@DataIndependent
@DataIndependent Жыл бұрын
Nice! What other ideas do you think it should be hooked up to?
@____2080_____
@____2080_____ Жыл бұрын
Thumbs up and subscribed.
@Crowward92
@Crowward92 Жыл бұрын
Great video man. Loved it. I had been looking for this solution for some time. Keep up the good work.
@ninonazgaidze1360
@ninonazgaidze1360 Жыл бұрын
This is super awesome!!! And so easily explained! You made my year. Please keep up the greatest work
@thespiritualmindset3580
@thespiritualmindset3580 Жыл бұрын
this helped me a lot, thanks, for the updated code in description as well!
@401kandBeyond
@401kandBeyond Жыл бұрын
This is a great video and Greg is awesome. Let's hope he puts together a course!
@jonathancrichlow5123
@jonathancrichlow5123 Жыл бұрын
this is awesome! my question is, what happens when the model is asked a question outside of the knowledge base that was just uploaded? For example, what would happen if you asked a question about who is the best soccer player?
@HelenJackson-pq4nm
@HelenJackson-pq4nm Жыл бұрын
Really clear, useful demo - thanks for sharing
@ThomasODuffy
@ThomasODuffy Жыл бұрын
Thanks for this very helpful practical tutorial!
@tunle3980
@tunle3980 Жыл бұрын
Thank you very much for doing this. It's absolutely awesome!!! Also can you do a video on how to improve the quality of answers?
@nsitkarana
@nsitkarana Жыл бұрын
Nice video. i tweaked the code and split the index part and the query part so that i can index once and keep querying - like how we would do in the real world. Nicely put together !!
@babakbandpey
@babakbandpey Жыл бұрын
Hello, Do you have an example of how you did that. This is the part that I have become confused about how to reuse the same indexes. Thanks
@karimhadni9858
@karimhadni9858 Жыл бұрын
Can you pls provide an example?
@johnsmith21170
@johnsmith21170 Жыл бұрын
awesome video, very helpful! thank you
@DataIndependent
@DataIndependent Жыл бұрын
Love it thank you
@guilianamustiga2962
@guilianamustiga2962 11 ай бұрын
thank you Greg! very helpful tutorial!!
@DataIndependent
@DataIndependent 11 ай бұрын
Thanks Guiliana!
@Juniorventura29
@Juniorventura29 Жыл бұрын
Awesome tutorial, brief and easy to understand, Do you think this could be an approach to make semantic search on private data from clients? my concern is data privacy so, I guess by using pinecone and openAI, is that openAI only process what we send (to respond in a NL), but they don't store any of our documents.
@ritik1857
@ritik1857 Жыл бұрын
Thanks Ryan!
@sunbisoft9556
@sunbisoft9556 Жыл бұрын
Got to say, you are awesome! Keep up the good work, you got a subscriber here!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Thank you. I just ordered upgrades for my recording set up so quality will increase soon.
@geethaachar8495
@geethaachar8495 Жыл бұрын
That was fabulous thank you
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Glad to hear it
@RodolphoPortoSantista
@RodolphoPortoSantista Жыл бұрын
This video is very good!
@WooyoungJoo
@WooyoungJoo 11 ай бұрын
Thanks as always Greg!
@DataIndependent
@DataIndependent 11 ай бұрын
Awesome thank you
@nathanburley
@nathanburley Жыл бұрын
This is a great video - succinct and easy to follow. Two questions: 1) How easy is it to add more than one document to the same vector db 2) Is it possible to append an additional ... field(?) to that database table - so that the provenance of the reference can be reported back with the synethised result?
@DataIndependent
@DataIndependent Жыл бұрын
1) Super easy. Just upload another 2) Yep you can, it's the metadata field as you can add a whole bunch. People will often do this for document id's
@nathanburley
@nathanburley Жыл бұрын
@@DataIndependent Amazing (and thanks for the reply). One final follow up then, is it easy / possible to delete vectors from the db too (I assume yes wanted to ask). I assume this is done by using a query e.g. if meta data contains "Document ID X" then delete?
@dogchaser520
@dogchaser520 Жыл бұрын
Succinct and easy to follow. Very cool.
@gvarph7212
@gvarph7212 Жыл бұрын
Just out of curiosity, how much does something like this cost in openAI credits?
@RomuloMagalhaesAutoTOPO
@RomuloMagalhaesAutoTOPO Жыл бұрын
Great explanation. Thank you.
@DataIndependent
@DataIndependent Жыл бұрын
Thank you! That's great
@rajivraghu9857
@rajivraghu9857 Жыл бұрын
Excellent 👍
@luisarango-jm8eq
@luisarango-jm8eq Жыл бұрын
Love this brother!
@BlueGiant69202
@BlueGiant69202 Жыл бұрын
In 1994 Richard E. Osgood created a conversational reading system called "ASK Michael" for Michael Porter's book "The Competitive Advantage of Nations". Please let me know when you can automate the conceptual indexing and question-based indexing of a book including the creation and categorization of relevant questions that a novice that doesn't know any keywords or relevant vocabulary can ask.
@PizzaLord
@PizzaLord Жыл бұрын
Nice! I was working with pinecone / gpt code recently that gave your chat history basically infinite memory of past chats by storing them in pinecone which was pretty sweet as you can use it to give your chatbot more context for the conversation as it then remembers everything you ever talked about. Will be combining this with a custom dataset pinecone storage this week (like a book) to create a super powered custom gpt with infinite recall of past convos. Would be curious on your take, particularly how to keep the book data universally available to all users but at the same time keeping the past chat data of a particular user totally private but still being able to store both types of data on the free tier pinecone which I can see you are using (and I will be using too).
@DataIndependent
@DataIndependent Жыл бұрын
Nice! That's great. Soon if you have too much information (like in the book example above), you'll need to get good at picking which pieces of previous history you want to parse out. I imagine that won't be too hard in the beginning but it will later on.
@PizzaLord
@PizzaLord Жыл бұрын
@@DataIndependent Doesnt the k variable take care of this? It only returns the top k number in order of relevance that you end up querying. Or are you talking about the chat history and not the corpus? I see no reason why you would not just specify a k variable of 5 or 10 in regard to the chat history too. For example if a user was seeking relationship advice and the system knew their entire relationship history and the user said something like "this reminds of of the first relationship that I told you about", it would be easy for the system to do an exact recall of the relationship, the name of the partner and from there recall everything very quickly using the k variable on the chat history. I use relationships as an example because I just trained my system on a book that I wrote called sex 3.0 (something that gpt knows nothing about) and I am going to be giving it infinite memory and recall this week.
@DataIndependent
@DataIndependent Жыл бұрын
@@PizzaLord Yes, the K variable will help w/ this. My comment was around the chance for more noise to get introduced the more data you have. Ex: More documents creep in that share a close semantic meaning, but aren't actually what you're looking for. For small projects this shouldn't be an issue. Nice! That's cool about the project. Let me know how it goes. The langchain discord #tools would love to see it too
@PizzaLord
@PizzaLord Жыл бұрын
@@DataIndependent Another thing I will look at, and I think it would be cool if you looked at it too, is certain chat questions triggering an event like a graphic or a video link being shown where by the video can be played without leaving the chat. This can be done by either embedding the video in the chat response area or by having a separate area of the same html page which is the multimedia area or pane that gets updated. After all the whole point of langchain is to be able to chain things together, no? Once you chain things together you can get workflow. This gets around one of chat gpts main limitations right now which is that its text only in terms of what you can teach it and the internet loves its visuals and videos. Once this event flow stuff is in place you can easily use it to flow through all kinds of workflow with gpt at the centre like collecting data in forms, doing quick survey so you can store users preferences and opinions about what they might want to get out of an online course that you are teaching it and then storing that in a vector DB. It can become its own platform at that point.
@DataIndependent
@DataIndependent Жыл бұрын
@@PizzaLord You could likely do that by defining a custom tool, grabbing an image based off a URL (or generating one) and then displaying in your chat box. Doing custom tools is interesting and I'm going to look into a video for that.
@caiyu538
@caiyu538 Жыл бұрын
great lectures, learn how to use langchain API. It looks that how to fine tuning with langchain has not been uploaded yet.
@tom-greg
@tom-greg Жыл бұрын
Great! What are the limits? How many pages can it handle, and what are the costs?
@DataIndependent
@DataIndependent Жыл бұрын
However many pages you want. It just storage space. Check out pinecone's pricing for more
@haouasy
@haouasy Жыл бұрын
Amazing content man , love the diagrams and how you deliver ,absolutely professional . quick question , is the text returned by the chain is exactly the same from the book or does the openAI engine make some touches and make it better ?
@JoanSubiratsLlaveria
@JoanSubiratsLlaveria Жыл бұрын
Excellent video!
@caiyu538
@caiyu538 Жыл бұрын
Great series.
@hpzlatarski
@hpzlatarski Жыл бұрын
Awesome tutorial, brief, and easy to understand. My concern is data privacy, what happens with the data we turn into embeddings by using OpenAI, is that data used by them? Do they train further their models with that data? Can someone please answer if you have info on this privacy topic.
@TheHumanistX
@TheHumanistX Жыл бұрын
Ok, so maybe I misunderstand this one. I used the full text of War and Peace, just to test. My query was "How many times does the word 'fire' appear in War and Peace?" and when it finishes running there is no output... is this not the right set up for that kind of question? Then, I set the query to 'What are the main philosophical ideas in War and Peace?' and also returned nothing. Didn't error out. I double checked and all my code is good.
@DataIndependent
@DataIndependent Жыл бұрын
Ah yes this is a fun question. So LLMs won't be good at counting words like you're describing. That's. a task they aren't well suited for yet. I would use regular regex or a .find() for that The 2nd question is also hard, you need to review multiple pieces of text in the book to form a good opinion of the philosophical ideas. Just doing an similar embedding approach won't get you there. If you wanted to answer the philosophical question I would do a map reduce or refine with a large context window. However war and peace is huge so that would cost a lot.
@lukaszwiktor
@lukaszwiktor Жыл бұрын
This is gold! Thank you so much!
@DataIndependent
@DataIndependent Жыл бұрын
Thank you!
@saburspeaks
@saburspeaks Жыл бұрын
Amazing stuff with these videos
@DataIndependent
@DataIndependent Жыл бұрын
Glad you like them!
@rayxiao460
@rayxiao460 Жыл бұрын
Very impressive.great job.
@nattapongthanngam7216
@nattapongthanngam7216 5 ай бұрын
Appreciate it!
@3278andy
@3278andy Жыл бұрын
Amazing tutorial Greg! I'm able to reproduce your result in my env, I think in order to ask about follow up questions, chat_history should be handy
@sovopl
@sovopl Жыл бұрын
Great tutorial, I wonder how to generate questions based on the content of the book? I would probably have to pass the entire content of the book to the GPT model.
@roberthahn9040
@roberthahn9040 Жыл бұрын
Really awesome video!
@DataIndependent
@DataIndependent Жыл бұрын
Nice!! Thank you - what else do you want to see?
@rodrigomarques7128
@rodrigomarques7128 Жыл бұрын
This is awesome!!!!
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Glad it worked out
@rodrigomarques7128
@rodrigomarques7128 Жыл бұрын
@@DataIndependent what's open source alternative you indicate for the model embedding and QA model?
@vishnuvardhanvaka
@vishnuvardhanvaka Жыл бұрын
Is it a fine tuned model ? Because if not we will charged high for using openai api. Please make a video on fine tuned langchain openai ai model like text-ada-001
@ArchAid1
@ArchAid1 Жыл бұрын
heeeey! Loving this! Greg, I'm running an e-commerce site. We've got a metric shit-ton of products and endless amounts of purchase data. It would be extremely interesting to see how we could work with this to get all our product data loaded into Pinecone and then be able to query it in some meaningful sense. I guess a lot of the comments are in a similar vein. Would be super cool to get a video on that. I could supply some product data from our shop if need be.
@DataIndependent
@DataIndependent Жыл бұрын
Nice! What would be the business use case or problem you'd be trying to solve?
@ArchAid1
@ArchAid1 Жыл бұрын
@@DataIndependent So I'm running a shop for car parts and equipment for cars. I think, from a consumer point of view, it would be amazing if we could solve two major issues. 1. If you're browsing for something to solve your problem rather than an actual product. Say that you have some stains on your car. It would be amazing if you could just ask the Friendly Chat Support how to deal with the issue and the support AI would have all the information about all our products and all the content that we've written at hand. And could go "Yeah, so you would use this product and go about it in so and so manner". 2. It would be super cool if it also had access to user data and past purchases etc. And go "Hey.. last time you bought this and this. How did that work out for you? From 1 to 10 how much did you love it?" etc etc. -- It feels like this is a scenario that is predicated on the idea that the AI has very specific knowledge
@Shrimad-y8w
@Shrimad-y8w Жыл бұрын
How to know the perfect valure of chunk size and chunk overlap
@screweddevelopment12
@screweddevelopment12 Жыл бұрын
It’s crazy that you can ask books questions like they’re people now.
@klammer75
@klammer75 Жыл бұрын
Yes!!! Tku💪🏼
@DataIndependent
@DataIndependent Жыл бұрын
Nice!! Glad it worked out.
@vigneshyaadav6322
@vigneshyaadav6322 Жыл бұрын
I was looking for creating an API to store the embedding in Pinecode that was fairly simple but I did not understand how to pass on a query(Plain Text) and get the response back from the embedding stored in the pinecone db I see that's what happening in the doc search and the chain lines but how i do i do it separately
@DataIndependent
@DataIndependent Жыл бұрын
Sorry I don't fully understand your question - could you rephrase it?
@rayali8958
@rayali8958 Жыл бұрын
This is great! thanks, do you have a video that shows how to connect what you did to a chatbot interface?
@DataIndependent
@DataIndependent Жыл бұрын
Not currently but this is on the horizon - I'll make a post on this channel in a few weeks
@alvaromseixas
@alvaromseixas Жыл бұрын
Hey, Greg! I'm trying to connect the dots on GPT + langchain and your videos have been excelent sources! To give it a try, I'm planning to build some kind of personal assistant for a specific industry (i.e. law, healthcare), and down the road the vector database will become pretty big. Any guideline on how to sort the best results and also how to show the source of where the information was pulled from?
@DataIndependent
@DataIndependent Жыл бұрын
Nice! Check out the langchain documentation for "q&a with sources" you're able to get them back pretty easily.
@not_a_human_being
@not_a_human_being Жыл бұрын
I'm absolutely blown away by ChatGPT, this is the future, there're no more doubts in my mind. At the same time, this specific tutorial feels a bit like a "step back" and a "paid ad" for a hosted vector DB solution called "Pinecone". Why not something like Elastic? I'm not shilling for them, I don't even know if they support vectors. Feels to me like "cell 13" should be executed remotely by the document DataBase. And in "cell 14" - vectorisation should be done remotely too, IMHO. How would it know if the book doesn't contain the answer? Does it ensure that information from the book is used at all? What if this is a "Book of bad advice and factually incorrect statements", would this return actual bad advice or an incorrect statement? Shouldn't it at least prefix the response with some sort of "this book says that: ...".
@ZinebBouharra
@ZinebBouharra 7 ай бұрын
thank you for this series. I'm confused about one thing. When querying the db, you passed the text, not its embedding. How does pinecone know how to embed the text?
@ahmadmoner
@ahmadmoner Жыл бұрын
what will happen if you ask it outside of the book knowledge? also how to restrict it from going outside of the book?
@mosheklein3373
@mosheklein3373 Жыл бұрын
Im also curious how would you implement this into a stand alone app that can be queried
@amaanqureshi1286
@amaanqureshi1286 3 ай бұрын
My question is pinecone only stores vectors and not text files, how do I get the texts in my program
@calebsuh
@calebsuh Жыл бұрын
Another great tutorial Greg! Curious if you've played around with Faiss. And if so, what you think of Pinecone vs Faiss?
@DataIndependent
@DataIndependent Жыл бұрын
Yep! I've played around with it and love it for local use cases. I had a hard time w/ a supporting library in it the last time I used it
@calebsuh
@calebsuh Жыл бұрын
@@DataIndependent Pinecone was getting expensive for us, so we're trying out Faiss now
@danilovaccalluzzo
@danilovaccalluzzo Жыл бұрын
great video. thanks so much. How do you query the index without creating the embeddings all the time? is it possible? thanks
@nihonkeizaishinbun2254
@nihonkeizaishinbun2254 Жыл бұрын
Hi, i found this : docsearch = Pinecone.from_existing_index(index_name, embeddings)
@DrDanielCho-Kee
@DrDanielCho-Kee Жыл бұрын
Awesome! How do we query multiple documents? Perhaps multiple 300 page books or 30 100 pages PDFs?
@DataIndependent
@DataIndependent Жыл бұрын
You could utilize filters or simply load up all those docs if you don't care about sources
@carlosbenavides670
@carlosbenavides670 Жыл бұрын
Thanks for sharing, pretty good. QQ, did you make a version of this using Chroma?
@facundoalvarezmorales3325
@facundoalvarezmorales3325 Жыл бұрын
This is awesome! Thank you very much for the video. One quick question. How much did this cost with OpenAI and Pinecone API usage?
@DataIndependent
@DataIndependent Жыл бұрын
Pinecone at the time was free, openai was a couple cents
@jjolla6391
@jjolla6391 Жыл бұрын
Can you do a version of this with an open source alternative to ChatGPT .. and using a locally installed Pinecone (or other similar open source). I'd prefer to keep my inputs and outputs private
@danielnelson9996
@danielnelson9996 Жыл бұрын
How exactly is openAI querying those docs? Are you sending those docs in as prompt inputs?
@akashbhoite42
@akashbhoite42 Жыл бұрын
Great video. QQ, How is it different from asking Chat-GPT to base its answers on the title of the book and Author?
@gabayetma
@gabayetma Жыл бұрын
Hi thanks for the tutorial. I’m stuck with this error: ValueError: Could not import tiktoken python package. This is needed in order to for OpenAIEmbeddings. Please install it with pip install tiktoken. In the python line: docsearch = Pinecone.from_texts([t.page_content for t in texts], embeddings, index_name=index_name).
@yantaosong
@yantaosong Жыл бұрын
During my test , similarity search not working well when number of ingested documents is great. anyone met this problem .
@sumitbakhli2049
@sumitbakhli2049 Жыл бұрын
I am getting Index 'None' not found in your Pinecone project. Did you mean one of the following indexes : langchain1 for below line docsearch = Pinecone.from_texts([t.page_content for t in texts], embeddings, index_name) Any idea what the issue could be. I checked index_name variable is set correctly as langchain1
@Videodecumple
@Videodecumple Жыл бұрын
Can you talk about the costs of using OpenAI API for this? Is this like the cost of fine-tunning and usage with own data or the use of embbeding (ADA)?
@DataIndependent
@DataIndependent Жыл бұрын
Check out the pricing page on OpenAI for a detailed breakdown. I might do a video on it since it's a good topic to understand
@drewwellington2496
@drewwellington2496 Жыл бұрын
Ok, this doesn't work under Windows. Saying this so nobody else wastes time trying to figure it out like I did. Detectron2 does not install on Windows. Detectron2 is required for the PDF parser.
@panlaz1424
@panlaz1424 Жыл бұрын
Thank you for saying this. I think I have seen this too in my research trying to resolve the errors. If you have any updates or how to proceed, that would be amazing. Thank you.
@DataIndependent
@DataIndependent Жыл бұрын
Pretty surprised this is the case. For such a wide spread application I would think they would support it. I'm sorry it's a pain.
@DamienRourke
@DamienRourke Жыл бұрын
This should be pinned at the top. I've wasted an entire day trying to fix something that was unfixable.
@panlaz1424
@panlaz1424 Жыл бұрын
@@DataIndependent solved by using google colab. Hope this helps someone. Thank you
@drewwellington2496
@drewwellington2496 Жыл бұрын
@@DamienRourke I haven't tried this again (too much rage last time haha), but the "unstructured" git looks like it might now NOT need Detectron2, which is what was causing issues here. There's a recent commit from a few days ago: "feat: add "fast" strategy for PDF parsing; fallback to "fast" if detectron2 is not available" maybe it's worth another shot? i'll try again when I have time
@CrunchyMind
@CrunchyMind Жыл бұрын
When implementing this, would I still be able to ask questions outside the book?
@memesofproduction27
@memesofproduction27 Жыл бұрын
Great tut, thank you. Any advice on vectorizing a ton of widely varied documents? How many qa chatbots? One per index?
@DataIndependent
@DataIndependent Жыл бұрын
Hm how many chatbots will depend on your product use case. I would put them in the same index, but make sure your metadata is explicit so you can easily filter with them
@memesofproduction27
@memesofproduction27 Жыл бұрын
@@DataIndependent Thank you
@MosheRecanati
@MosheRecanati Жыл бұрын
Can we get back the source page from the book linked to the answer?
@KayaJones-x8p
@KayaJones-x8p 11 ай бұрын
Hello, I am getting a rate limit error but i haven't ever used the api yet
@abcd-zi4kc
@abcd-zi4kc Жыл бұрын
Love the article, I have few questions 1) after finding the relevant docs with highest cos similarity score, what's happening when you call OpenAI API? Is it summarising all the 5 docs together? Or are you doing few-shot with 5 docs as examples for prompt? 2) I would like to understand the shortcomings of having to divide into segments/documents - for example, if sentences containing same context gets cut into two docs and only one is included in the shortlist of similar docs, wouldn't some information go missing? Really love your video and you made it so easy to understand, but would love know your thoughts on these! Thanks :)
@DataIndependent
@DataIndependent Жыл бұрын
Here ya go: 1) This depends on the "chain_type" you specify. There are a few ways to do it. Check out my video on "workaround openai token limit" for more information on it 2) I agree with your point. It's not ideal to split on physical characters because you might split context like you're mentioning. What we are *really* trying to do is group together meaning and we're using sentences and paragraphs to split on this. My prediction is we'll soon see semantic splitting that groups together ideas or is more intelligent than just character splitting.
@abcd-zi4kc
@abcd-zi4kc Жыл бұрын
Thanks! When you stuff all the docs together into prompt and make and OpenAI API call, what is GPT doing? Is it just summarizing the docs in the prompt or is it doing few-shot learning to answer the question?
@DataIndependent
@DataIndependent Жыл бұрын
@@abcd-zi4kc In this example you're telling OpenAI to answer a question given context (which are the similar documents you've retrieved). We don't give any examples.
@abcd-zi4kc
@abcd-zi4kc Жыл бұрын
Got it, thanks!
@shubhamgupta7730
@shubhamgupta7730 Жыл бұрын
I have a doubt. Please help me in this. I am trying to create a chatbot in which I provide companies information and it will refer that information and provide answer. Currently I was trying to achieve this by fine-tuning the openai gpt model but not getting the desired results. How much I have understood that this technique will work for the above use case. Am i right?
@DataIndependent
@DataIndependent Жыл бұрын
Yes, it would help with that. You just need to pass your company's documents into the loader
@shubhamgupta7730
@shubhamgupta7730 Жыл бұрын
@@DataIndependentThank you for the reply!
@Murcie4S
@Murcie4S Жыл бұрын
Thank you for the excellent tutorial. I have a few questions to ask. How can I pre-filter the vector in multiple document situations? Secondly, I am not familiar with using Pinecone. How should I determine the optimal settings for dimensions and metrics in multiple documents? By the way thank you so much again.
@DataIndependent
@DataIndependent Жыл бұрын
Thank you! > How can I pre-filter the vector in multiple document situations? Check out this code line, it has an argument where you can pass a filter to metadata github.com/hwchase17/langchain/blob/3c2468452284ee37b8a88a20b864255fa4385b65/langchain/vectorstores/pinecone.py#L132 Dimensions will be the number of values in each of your vectors. So the optimal one is what your embedding engine recommends and outputs.
@Murcie4S
@Murcie4S Жыл бұрын
​@@DataIndependent Thank you for your previous response. I have an additional question regarding the language setting in Langchain. I am currently working on a Korean I/O based project, I would like to modify my language settings to receive ChatGPT's responses in Korean. How can I apply these changes?
@jatinaqua007
@jatinaqua007 2 ай бұрын
Great video! so what if my question is out of context of the pdf document? Will the open ai answers it from its generic knowledge? Or it will simply say that it doesn't know the answer? Either way can we configure it to respond the way we want?
@rhiteshkumarsingh4401
@rhiteshkumarsingh4401 Жыл бұрын
can we use chroma too? whats the differentiating factor between pinecone and chroma? is pinecone free?
@siddharthlodha5016
@siddharthlodha5016 Жыл бұрын
Great video!, how can we use the retriever without storing the vectors again ?
@DataIndependent
@DataIndependent Жыл бұрын
I wish I could go back and put this in the video. Check out from_existing_index()
@saqqara6361
@saqqara6361 Жыл бұрын
Why are u using Pinecone... would Chroma be sufficient as well?
@chunhualiao8191
@chunhualiao8191 Жыл бұрын
I cannot easily get pinecone test API key now due to high demands. What alternatives are available for the vector store?
@peikewu7952
@peikewu7952 Жыл бұрын
Hi Greg! Thanks so much for the video! I am wondering what OpenAI embedding model you used, and what OpenAI chat model you used, and where can I find that in the code? Additionally, is there a way to view the cost of querying in terms of tokens consumed? Thanks!
@DataIndependent
@DataIndependent Жыл бұрын
For embeddings I just use openai's ada-002 model. For chat model, if one isn't provided, then it's gpt-3.5 (as of today), I used the default so you won't see it unless you check out the langchain source code
Workaround OpenAI's Token Limit With Chain Types
15:53
Greg Kamradt (Data Indy)
Рет қаралды 62 М.
The LangChain Cookbook - Beginner Guide To 7 Essential Concepts
38:11
Greg Kamradt (Data Indy)
Рет қаралды 342 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 98 МЛН
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 244 М.
OpenAI Embeddings and Vector Databases Crash Course
18:41
Adrian Twarog
Рет қаралды 469 М.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Рет қаралды 992 М.
World’s Fastest Talking AI: Deepgram + Groq
11:45
Greg Kamradt (Data Indy)
Рет қаралды 49 М.
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 98 МЛН