RAG System Components: Vector DB, Embedder, LLM
What you'll learn: How the three essential infrastructure components of a RAG system work together to enable retrieval-augmented generation.
The Three-Part Architecture
A production RAG system requires three distinct infrastructure components that form a pipeline:
- Embedder (Embedding Model): Converts text into dense vector representations
- Vector Database: Stores and efficiently searches these vector embeddings
- Large Language Model (LLM): Generates responses using retrieved context
Think of it like a specialized research library: the embedder is the cataloging system that assigns unique numerical "addresses" to books, the vector database is the smart filing system that quickly finds related books, and the LLM is the expert librarian who reads those books and answers your questions.
How They Interact
During Indexing:
- Documents pass through the embedder → producing vectors
- Vectors are stored in the vector database with metadata
- The LLM isn't involved yet
During Query Time:
- Your query goes through the same embedder → becomes a query vector
- Vector database searches for similar document vectors (top-K retrieval)
- Retrieved chunks are injected into the LLM prompt as context
- LLM generates the final answer using that context
Component Independence
These three components are loosely coupled—you can swap them independently:
- Use OpenAI embeddings with Pinecone and Claude
- Use sentence-transformers with Chroma and GPT-4
- Mix and match based on cost, performance, and requirements
The embedder must remain consistent between indexing and retrieval, but the vector DB and LLM are independent choices.
Key Takeaway: A RAG system requires three core components—an embedder for vectorization, a vector database for similarity search, and an LLM for generation—each serving a distinct role in the retrieval-augmented pipeline.