What are the key components of a RAG pipeline?
LLM & AILevel: FoundationCore Concepts
What are the key components of a RAG pipeline?
Hints
- Break the query into candidate retrieval, context selection and generation.
- How would you locate the stage that lost a fact without using only one end-to-end metric?
Answer
| Component | Options | Key Decisions |
|---|---|---|
| Document loader | LangChain loaders, PyMuPDF, Unstructured | File formats, OCR for scanned docs |
| Chunker | Fixed-size, recursive, semantic | Chunk size, overlap strategy |
| Embedding model | OpenAI ada-002, E5, BGE, Cohere | Domain fit, dimensionality, cost |
| Vector store | Pinecone, Weaviate, Chroma, pgvector | Scale, metadata filtering needs |
| Retriever | Dense, sparse, hybrid | Recall vs precision tradeoff |
| Re-ranker | Cohere rerank, BGE-reranker, cross-encoder | Quality vs latency |
| LLM | GPT-4, Claude, Llama | Quality, cost, latency |
| Orchestration | LangChain, LlamaIndex | Developer experience |
Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0