Basic retrieval-augmented generation retrieves passages with a single vector similarity search and hands them to the model, and that simplicity is exactly where it breaks. When a user asks a multi-part or ambiguous question, the single embedded query under-retrieves, and when the top-k results are merely similar rather than genuinely relevant, the model either misses the answer or buries it in weak context. The fix, according to practitioners building production RAG systems, is a multi-stage pipeline that adds intelligence before retrieval—query transformation and decomposition—and after it—re-ranking with cross-encoders or LLM-based scoring.
Beyond Basic RAG: Addressing LLM Limitations
A typical RAG pipeline is, as Enzo Htet writes in Neo4j's guide to advanced RAG techniques, "simple to describe but also easy to underbuild for production." The architecture looks complete: embed the query, search a knowledge base, stuff the results into the prompt, generate. Yet several structural weaknesses recur. Limited query understanding—no expansion or decomposition—causes under-retrieval on multi-hop questions. A limited context window forces the system to drop good passages or rely on summaries that lose detail. There is no feedback loop to detect weak context before generation, and no graph context connecting entities and events, so cross-document reasoning fails.
Google's own production guidance makes the same point from the engineering side: building a production-ready RAG system requires more than a simple vector search, and demands optimizing how data is ingested, how relevant results are ranked, and how user queries are processed. The retrieval mechanism itself is critically important—Google Cloud's documentation stresses that you need the best semantic search over a curated knowledge base to ensure retrieved information is actually relevant to the input query. The failure points, in other words, cluster at retrieval quality, not at generation.
Advanced RAG Pipeline: An Architectural Overview
The advanced pattern keeps the same skeleton but wraps it in pre-retrieval and post-retrieval stages. Before lookup, the raw user query is processed—transformed for clarity, corrected for spelling, decomposed into sub-questions when it is multi-part. After the initial search returns candidates, a re-ranking stage scores them so the most relevant results rise to the top and only the strongest passages reach the model's context window. The table below sequences these stages and shows where each technique intervenes.
| Stage | Technique | Purpose | Mechanism |
|---|---|---|---|
| Query processing (pre-retrieval) | Query transformation, spelling correction, decomposition | Ensure the query sent to the index is clear, focused, and matched to the question's structure | Sophisticated search engines transform the query and fix spelling mistakes prior to lookup; complex questions are broken into retrievable sub-queries |
| Initial retrieval | Hybrid search (semantic + keyword) | Cast a wider net than vector similarity alone | Semantic search and keyword search are used together, so exact identifiers and paraphrases both match |
| Re-ranking (post-retrieval) | Cross-encoder and LLM-based scoring | Improve the relevance ranking of retrieved results | A re-ranker scores search results so the top returned results are the most relevant before they enter the prompt |
| Generation | Grounded answer synthesis | Produce answers grounded in the strongest context | The model reasons over a refined, high-relevance context window rather than raw top-k results |
The cumulative effect is architectural, not incremental: an advanced RAG system, as Google's Codelabs on advanced RAG methods describe it, strengthens both what the model sees and how it reasons. Each stage addresses a distinct failure point—query processing fixes under-retrieval, hybrid search fixes missed exact matches, re-ranking fixes weak ranking—so the stages are interdependent and their benefits compound at generation time.





