word2vec is a library used to create embeddings.
Embeddings are vector representations (a list of numbers) that represents the meaning of some text.
RAG is retrieval augmented generation. It is a method to get better answers from GPT by giving it relevant pieces of information along with the question.
RAG is done by:
- taking a long text splitting it into pieces
- creating embeddings for each piece and storing those
- when someone asks a question, create an embedding for the question
- find the most similar embeddings of sections from the long text say the top 3
- send those 3 pieces along with the question to GPT for the answer
A vector DB is a way to store those section embeddings and to also search for the most relevant sections. You do not need to use a vector DB to perform RAG, but it can help. Particularly if you want to store and use RAG with a very large amount of information.