A RAG pipeline has two halves. An offline indexing pass runs whenever documents change. An online query pass runs on every request.
The offline pass runs these stages in order:
Load and parse the documents.
Chunk them.
Embed each chunk.
Write the vectors, plus metadata, to the index.
The online pass runs these stages in order:
Rewrite the query.
Embed it.
Retrieve the top-k chunks.
Rerank them.
Build the prompt.
Generate the answer and return it with citations.
Two points beginners miss. The same embedding model must serve both halves, or the query vector and the stored vectors do not share one space. And the pipeline is a chain: if any stage before generation drops the right chunk, the model cannot recover it.
Reranking is optional. Retrieval is tuned for speed over a huge index, reranking for precision over a short list.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
I split a RAG pipeline into two halves. An offline pass indexes documents whenever they change, and an online pass runs on every request.
Offline, you load and parse the documents, chunk them, embed each chunk, and write the vectors with their metadata to the index.
Online, each request goes through query rewriting, embedding the query, retrieving the top-k chunks, reranking, building the prompt, and generating an answer with citations.
Both halves have to use the same embedding model. Otherwise the query vector and the stored vectors aren't in the same space, and the similarity scores mean nothing.
I treat reranking as optional. Retrieval is tuned for speed over the whole index, and reranking for precision over the short list it returns.
The main weakness is that it's a chain. If any stage before generation drops the right chunk, the model has no way to recover it.
Weak answers to avoid
Says 'retrieve, then generate' and stopsThat skips parsing, chunking, embedding, reranking and prompt building. Name both halves and each stage in order so the interviewer sees where things can break.
Blurs indexing time and query timeChunking and embedding the corpus happen offline when documents change, not on every request. Keep the two passes separate and say what triggers each.
Misses the shared embedding modelIf the query is embedded with a different model than the index, similarity scores are meaningless. Say that both halves must use the same model.
Blames the LLM for every bad answerThe pipeline is a chain. If parsing, chunking or retrieval drops the right chunk, no model can recover it, so trace each stage before tuning the prompt.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.