Where vectors lurk in your code
One way to indicate the value of vectors in the RAG system is to show you all the places they are used. As discussed earlier, you start with your text data and convert it to vectors during the vectorization process. This occurs in the indexing stage of the RAG system. But, in most cases, you must have somewhere to put those embedding vectors, which brings in the concept of the vector store.
During the retrieval stage of the RAG system, you start with a question as input from the user, which is first converted to an embedding vector before the retrieval begins. Lastly, the retrieval process uses a similarity algorithm that determines the proximity between the question embedding and all the embeddings in the vector store. There is one more potential area in which vectors are common and that is when you want to evaluate your RAG responses, but we will cover that in Chapter 9 when we cover evaluation techniques. For now, let’s dive deeper into...