I am trying to build an NLP model that will ask the user a question and try to generate its answer using some documents like PDF, i.e., an open generative QA (please correct me if I am wrong). For the project, I came to know I needed a database, a retriever, and a reader. To store the documents, I came to know that vector DB is a good option. After researching a bit, I found Elastic Search to be a very good vector DB. For retrievers, I found multi-qa-mpnet-base-dot-v1 to be a good option on hugging face, and finally, Google Flan-t5-base as the reader.
I am very confused about whether my selection is right or not, and do I even need to use Elastic search or can I use MongoDB and the retriever to get the documents (if that's possible)? Also, is the output of the elastic search a collection of documents? Please suggest if the stack could be better.
You don't have to use elasticsearch for that. If you want to use elasticsearch, there is a very good blog post on deepset.ai that walks you through this process.
You get both. The answer and the document. The blog above examples it in details.
Definitely, there is another good block post that explains how to do the same with MongoDB and LangChain for example.
That's the part of your question that might cause your question to be closed. The architecture selection is very subjective and multifaceted question that is not a good fit for stack-overflow that more targets "here is my concrete problem, here is the correct solution" type of questions.