Wow so clear! Really appreaciate the multi-level numbered comments. Really helps a novice like me to see what you are doing, follow along, and code. A good practice anyhoo!
@@DevelopersDigest I'm still new at this, so I can't comment yet what parts you haven't covered. In your channel you covered most of the basics already and the quality of the videos are great. I'm learning a great deal out of it. I like your videos because you start with actual running examples, well commented, instead of a lot of unnecessary explanations. Learning as you practice is much easier like in your videos. You encouraged us to "do it" instead of just watching.
I would like to know the performance implications of running LangChain in a production Nodejs environment, but not sure if that's in your scope. Mostly on the internet people show how to run LLM locally, but I'm interested in using this actually on production nodejs servers, inside an express app for example.
just dropping by to say thanks. It took me forever to find a tutorial that works. I just wish I found you a week ago, but thanks again, keep them coming.
the only one video that made me learn. FCK pinecode and all shit, broken those days... Making me unable to learn. THANKS a lot, dunno why everyone is doing all the guides for python :( U are neat thanks man
Hi amazing!, I have some question. Using OpenAI model and APIKEY has cost??? IT´s posibble to create the vector index and uploading for example into s3 bucket and then use this url? Thanks!!
Thank you, works :) May I have a question: I want to tell my model to behave in a certain way, the way I want to. I simply don't know where I can do this to pass the instructions to him. If you know the answer I will be grateful too see it. Thanks.
You can always pass the results within a query for an LLM. So the basic examples you could try is first passing in the results from your vector store to the LLM, then you could add instructions before and or after. Alternatively you could add a system message to the OpenAI payload which are weighted higher when past. There are also a handful of langchain ways you could accomplish this but I found using the code model api as a good place to learn!
Thank you for your answer. For now I simply changed the prompt in node_modules -> dist -> chains and so on. It works, because there is a template with {question} from User and {context} from Retriever. It's kinda a system message.
For simplicity. Rationale is that this was a quick way to show someone to get started with Langchain without having to dive into Vector databases. I consider this my introduction to Langchain video. I have a video going in depth on how to do something very similar to this with pinecone which I recommend as a next step after this if you are interested. Depending on your requirements and scale you require you could use something like this in production, it would really depend on the use case.
@@DevelopersDigest Thanks for your answer. Right... I'd assume it's pretty much the same as hosting your own mongodb database instead of using something as Atlas o Scalegrid. For a static database as the one in this video (and I'd assume it's the case for pretty much every other PDF or Doc), I still haven't figured out a case in which a cloud DB like Pinecone is a must. For dynamic documents, as in the MongoDB example, they're useful because of their snapshots, security, version control and so on.
Great Video! Helped me test things locally. Can openAI read and use the embeddings that we generate? If I use a pdf that I bought to generate embeddings, am I violationg any laws?
Great question! Digging into OpenAI's privacy policy and your regional laws would be a first step I would take a look at. The copyright question surrounding LLMs as a whole is an interesting area of discussion right now!
Thank you for this amazing tutorial 🙌. I just have a quick question, is there a way to reference multiple text files? Or should all text be in one file? Thanks
You can have multiple text files that convert into multiple vector store with this approach it does become a bit more involved to retrieve the data from multiple vector stores however. Alternatively, if you want one vector store for all text files, you could read all the txt files before embeddings and concatenate them to be within one vector store. Hopefully this helps!
What a great video! After trying it out myself i was quite impressed, how easy it seemed to integrate my own data as an embedding. However i was wondering, if you can combine your embeddings and the trained chatGPT Model? As an example i've provided some sauces as an embedding with their ingredients and then tasked the AI to provide me some recepies based on these, but it said it didnt know any. However if i do the same one GPT4 or GPT3.5 even it does provide me with a good answer. Is there any way to combine your data with the trained model?
If querying your vector store isn’t working as well as you would have expected you could look at fine tuning a model. OpenAI does have some good documentation on how to start fine tuning. I can also make a video on fine tuning if that helps! platform.openai.com/docs/guides/fine-tuning
Loved the tutorial, really help get up to speed with something I am building, I want to know what can we do if we have a website FAQs that need to be embedded as a chatbot for the any website?
Thanks Salman, check out Databerry, I have a video on my channel, it’s an open source project that can accomplish what you are looking for, alternatively you could look into organizing your data in a vector database on pinecone. I have a handful of langchain and pinecone videos coming out if you are interested. Stay tuned !
Depends on what exactly you are looking to do with it but say for embedding and using hosted inference endpoints. You would be able to use most computers, it becomes a different question if you want your computer to start to do more of the inference locally though!
Absolutely. I will post a repo to the description of the video tonight. I’ll also respond to this comment with the repo link so you will get an alert when it’s up!
OH NOOOO! I'M getting the dreaded "Package subpath './dist/text_splitter' is not defined by "exports" " As in all LangChain attempts! Have been all over GH and the docs and still not solved. Please someone help...
Love the video, it was super helpful and helped me get a server running so I can make requests to it from my website I'm creating. Am I able to also use the base chatgpt knowledge base on top of the custom data? It's very good at answering any question in the data but just says "I dont know" for any other question.
Yes, check out my video here. It should have a similar implementation to what you are describing. m.ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EFM-xutgAvY.html
Absolutely. I will post a repo to the description of the video tonight. I’ll also respond to this comment with the repo link so you will get an alert when it’s up!
Great question and absolutely, there would be a handful of different approaches to accomplish this. I will be creating more Langchain and OpenAI content on the coming weeks and I will make sure to cover this in an upcoming video! 🙂
i can not run it, seemly the issue happened on storage " await vectorStore.save(VECTOR_STORE_PATH)" to fetch the .env code; and showed the authorization bearer the code is not the code in .env file. please help me find the solusion. thanks.
Sir what if 1 million user using the api, that time many file will be created for cashing,storing one million file is scalable, this is how work in real world or any other solution
I have a video on Pinecone and langchain that is a scalable version of something very similar to this you might like checking out. This is intended to be an introduction :)
sor this is the updated code as the method shown is degraded now. thanks import { OpenAI } from 'langchain/llms/openai'; import {RetrievalQAChain} from 'langchain/chains'; import { HNSWLib} from "langchain/vectorstores/hnswlib"; import { OpenAIEmbeddings } from 'langchain/embeddings/openai'; import { RecursiveCharacterTextSplitter} from 'langchain/text_splitter'; import * as fs from 'fs'; import * as dotenv from 'dotenv';
It won't run getting an error with some headers object: /Get_Started_with_LangChain_in_Nodejs/node_modules/langchain/dist/util/axios-fetch-adapter.js:234 const headers = new Headers(config.headers); ReferenceError: Headers is not defined
i tried to use loadLLM to use my local gpt4all-lora-quantized-ggml.bin model. i failed to do so as it says BaseLanguageModel(return from loadLLM) does not have methods cal() or generate(). send help
I feel like that Langchain bird could be a great bird to deliver a set of debugging instructions😆 I will be looking into gpt4all model later this week, if I find anything I will circle back!
@@DevelopersDigest quick update, i managed to use loadLLM for langchain.js. it was my fault for trying to convert the file path of model into file uri whereas loadLLM takes model path only. However it seems loadFromFile has a memory limit of 2GB and it cant load my 3gb gpt4all model. The error is code:'ERR_FS_FILE_TOO_LARGE'. It seems a limitation of the 'fs' node module itself.
i don't know why but on running npm i hnswlib-node there are a lots of error. gives the error " npm ERR! code 1 npm ERR! path C:\Users\heman\Desktop\project ode_modules\hnswlib-node npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@18.16.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.11.3 found at "C:\Python311\python.exe" npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config" this is only 40% of error log. can you suggest why its not working