Vector Databases & RAG for Semantic Search and Retrieval
1. Vector Databases — High-Dimensional Embeddings
Store and search high-dimensional vector embeddings. Used in semantic search, similarity search, and RAG pipelines.
Indexing Techniques
- Flat Index (Brute Force) → accurate but slow.
-
Approximate Nearest Neighbor (ANN) → fast and scalable.
- Algorithms: HNSW, FAISS, Annoy.
3. Retrieval-Augmented Generation (RAG)
Overview
Enhances LLM output by integrating retrieved external knowledge.
- Reduces hallucination and outdated responses.
- Improves factual grounding.
RAG Workflow
- Indexing: Convert raw data (PDF, HTML, Word) → embeddings.
- Retrieval: Retrieve relevant document chunks using similarity search.
- Generation: LLM synthesizes results with the query to produce the final answer.
Retrieval Types
| Type | Description | Example |
|---|---|---|
| Sparse |
English with a size of 206.28 KB