RAG Isn't Just a Knowledge Base: The Full Retrieval Pipeline from Embedding to Rerank
Teams treating RAG as just a vector database and an LLM will hit a ceiling fast. The difference between a demo and a production system lies in the retrieval pipeline—chunk overlap, hybrid search, query rewriting, and reranking—and getting any one of these wrong means the LLM generates plausible-sounding answers from irrelevant or broken context.
Retrieval-Augmented Generation is often reduced to 'chat with your PDFs,' but its real architecture is a chain of independent stages that each make or break answer quality. Chunking strategy determines whether an answer gets severed across boundaries or diluted into noise. Embedding models turn semantic similarity into a vector-distance math problem, but they are blind to exact codes and proper nouns, which is why BM25 keyword search remains essential. HNSW indexing makes approximate nearest-neighbor search fast enough for millions of vectors by layering a navigable small-world graph, trading a controlled amount of recall for orders-of-magnitude speed gains.
The full online pipeline runs Query Rewrite (users rarely ask well-formed questions), Metadata Filtering (multi-tenant guardrails), multi-path Recall (dense vectors + sparse keywords), RRF fusion (rank-based merging that avoids score-scale mismatches), and a Cross-Encoder Reranker that reads query and document together to fix the coarse ranking mistakes a Bi-Encoder can't catch. Each stage addresses a specific failure mode, and skipping any one of them degrades the final answer the LLM generates.
RAG's retrieval pipeline is a stack of independent, replaceable components, yet most framework defaults treat chunking and recall as afterthoughts. The real engineering work is tuning each stage to the specific document structure and query patterns of a domain.
Embedding models and reranker models are often discussed as interchangeable, but they solve opposite halves of the retrieval problem. Embedding models are optimized for speed and recall; reranker models are optimized for precision and read query-document pairs jointly. Conflating the two leads to systems that are either slow, inaccurate, or both.
The article's framing of memory as a first-class retrieval source alongside static documents is under-discussed in Western RAG literature. User-specific dynamic knowledge—preferences, conversation history, short-term state—requires separate attribution, conflict-resolution, and expiry logic that a standard vector DB does not provide.