How does it work?
Ahead of time: split your documents into chunks, embed each chunk, and store the vectors. At question time: embed the question, retrieve the closest chunks, paste them into the prompt with an instruction to answer from them and cite which one, and return the model's answer alongside its sources.
Everything hard about RAG lives in the retrieval half. Getting the model to use supplied text is easy; getting the right text supplied is the engineering.
