Explain the architecture of a basic RAG system.
LLM & AILevel: FoundationCore Concepts
Explain the architecture of a basic RAG system.
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
INDEXING PIPELINE (offline):
Documents → Chunking → Embedding Model → Vector Database
QUERY PIPELINE (online):
User Query → Embed Query → Vector Search → Top-K Chunks
→ [Re-ranking] → Prompt Assembly → LLM → Answer
Key components:
- Embedding model — converts text to vectors for semantic similarity search
- Vector database — stores and indexes embeddings for fast approximate nearest neighbor search
- Retriever — finds the top-K most relevant chunks for a query
- Generator (LLM) — synthesizes a final answer from the retrieved context
Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0