Advanced RAG Patterns
Hybrid search, reranking, query rewriting, and agentic retrieval — the upgrades, and the eval discipline that decides which you need.
Two upgrades pay off almost universally. Hybrid search runs semantic (vector) and lexical (BM25 keyword) retrieval together and fuses results — embeddings miss exact identifiers like error codes and SKUs, keywords miss paraphrases; the union covers both. Reranking retrieves generously (top-30) then has a cross-encoder rescore query-and-passage together, keeping the best 5 — recall from the wide net, precision from the reranker. Rerankers are cheap relative to the quality jump; they're usually the first upgrade worth shipping.
Query-side patterns fix the gap between how users ask and how documents state. Query rewriting turns conversational asks ('what about EU users?') into standalone queries using chat history. Decomposition splits multi-part questions into sub-queries retrieved separately. Multi-query generates paraphrases and unions the results. On the index side: parent-document retrieval (search precise small chunks, hand the model the bigger parent section) and GraphRAG (entity-relationship graphs for multi-hop 'how does X relate to Y' corpora) trade complexity for capabilities plain top-k can't reach.
Agentic RAG makes retrieval a tool the model calls in a loop — search, read, refine the query, search again — instead of a fixed pre-step. It shines on research-shaped tasks and multi-hop questions; it costs latency, tokens, and debuggability. The meta-rule for this whole lesson: add patterns only when your eval set names the failure they fix. Teams that stack five clever patterns without measurement usually can't say which ones help — and one of them is usually hurting.