AI Engineering · LLM applications that ship
How does a RAG pipeline work end to end?
Short answer
RAG retrieves relevant passages at query time and places them in the prompt so the model answers from evidence. The pipeline runs ingest, chunk, embed, index, retrieve, rerank and generate.
Retrieval-augmented generation separates knowledge from the model. Documents are prepared offline, then at request time the system finds passages relevant to the question and gives them to the model as context. The model's job becomes reading and synthesising evidence rather than recalling facts.
- Ingest and parse source documents, preserving headings and structure.
- Chunk content and attach metadata such as source, section and permissions.
- Embed chunks and store them in a vector index, optionally alongside keyword indexes.
- At query time retrieve candidates, rerank them, and pack the best passages into the prompt.
- Generate an answer with citations, then evaluate retrieval and answer quality separately.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Which stage would you instrument first, and why?
- 2How do permissions apply during retrieval?
- 3What changes when documents update frequently?
Say it in the interview
RAG is a pipeline, not a single call. Offline I parse documents, chunk them, embed them and build an index with metadata. At query time I retrieve candidates, rerank them, and pack the best evidence into the prompt so the model answers with citations. I evaluate retrieval and generation separately, because if the right chunk never arrives, the model cannot be blamed for a bad answer.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live AI Engineering mock interview and get scored feedback on depth, clarity and confidence.