From the course: Level up LLM applications development with LangChain and OpenAI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Create embeddings from text (Faiss)

Create embeddings from text (Faiss)

- [Instructor] So let's begin with our basic example by using Facebook AI for similarity search. We're going to use this library to create a vector store, then embeddings. But before that, we also want to define a prompt to send instructions to the language model. And so we're going to find this basic example. So the first step will be to define prompt templates. So I'm going to copy all these lines and add right here. So between line 7 and 12. And so the question that we ask the language model is to answer the question based only on the following context, which will be provided by the retriever based on a given query. And this is going to be here represented with a question. The next step is that we want to create embeddings from a piece of text. So we're going to be doing that also from the same library. So, the step is going to be two in ones because we're going to create embeddings and also create the vector store. And so as a reminder, what are embeddings? So they are a vector…

Contents