Traditional RAG
Traditional RAG end to end: core components, the 7-step pipeline, offline ingestion and indexing, online retrieval, augmentation and generation, advantages, limitations, common vector databases, embedding models and best practices.
Cheat sheet · Offered as a template
In this diagram
- Traditional RAG
- Retrieval-Augmented Generation
- ① What is Traditional RAG?
- Combines LLMs with external knowledge retrieval.
- Retrieves relevant documents from a knowledge base and augments the prompt.
- Improves accuracy and reduces hallucinations.
- Easy to implement and widely used.
- ② Core Components
- User Query
- Retriever (Find Relevant Documents)
- Relevant Docs
- Generator (LLM)
- Response
- Retriever : Searches and returns relevant context
- Generator : Uses the context + query to generate answer
- ③ Traditional RAG Pipeline
- Raw Documents
- • Cleaning • Chunking • Metadata Extraction
- Preprocessing
- Embedding Model
- Embedding
- Vector Database
- Vector Store
- Top-k Relevant Documents
- Retrieval
- Combine Query + Context
- Augmentation
- LLM (Generate Answer)
- Generation
- ④ Ingestion & Indexing (Offline)
- Documents (PDF, Word, …)
- Text Extraction & Cleaning
- Chunking
- Embeddings [0.21, 0.41, …] [0.17, 0.89, …] …
- Vector DB (Faiss / Chroma / Pinecone / Qdrant)
- ⑤ Retrieval (Online)
- Query Embedding
- Similarity Search (Top-k)
- ⑥ Augmentation & Generation
- Top-k Documents
- Prompt Construction (Combine Query + Context)
- LLM (Generator)
- ⑦ Advantages
- Simple and easy to implement
- Uses up-to-date external knowledge
- Reduces hallucinations
- Cost-effective with open-source models