https://github.com/NirDiamant/RAG_Techniques/blob/main/all_rag_techniques/crag.ipynb
please use this link, it has complete answer to your question