DPR & RAG may be the references you want.
Regarding your questions and my answers with DPR

  
      
      huggingface.co
  
  
    

DPR — transformers 3.5.0 documentation 5



  
  
    
    
  
  




DPR (retriever module) select top-k paragraphs from 20 million of possible wikipedia paragraphs (not just 10k, and you can also make your own corpus) using very fast MIPS (maximum inner product search) implemented by FAISS


DPR (reader module) produce a relevance score for each of the top-k passages so this is a confidence number that you mentioned


Finally, RAG is an improvement of DPR where (1) you can combine different passages directly (both relevance and irrelevance) to produce the final answer by “marginalization” and (2) Final answer is generated in free-form, not necessarily contained in any of the passage .
(Please see the paper for details 
https://huggingface.co/transformers/model_doc/rag.html 12 )