Walk through the components of a production RAG pipeline.
mediumAnswer
- (1) Ingest: load source documents, extract text, chunk.
- (2) Embed: encode chunks with an embedding model, store vectors + metadata in a vector DB.
- (3) Retrieve: at query time, embed the question, run ANN search (top-k, filtered by metadata) + optionally BM25.
- (4) Rerank: reorder retrieved docs with a cross-encoder for higher precision at top ranks.
- (5) Prompt: assemble system prompt + retrieved chunks + question.
- (6) Generate: LLM produces the answer with citations.
- (7) Evaluate + observe: track retrieval quality, hallucination rate, latency, cost.
Check yourself — multiple choice
- Just embed and retrieve
- Ingest → chunk → embed → ANN + BM25 → rerank → prompt assembly → LLM → eval / observe
- Only vector search
- No re-ranking needed
RAG pipeline: ingest / chunk / embed / hybrid retrieve / rerank / prompt / generate / observe.
#rag#retrieval#production
Practise LLMs & GenAI
214 interview questions in this topic.