arrow_backGuides / Advanced RAG
Updated July 2026 14 min read Advanced

Advanced RAG
— from "roughly" to precise

Basic RAG (embed → search → paste) works in a demo and fails in production: it returns irrelevant passages, misses answers that exist, and causes hallucinations. In this guide: smart chunking, hybrid search, reranking, metadata filtering and GraphRAG — the techniques that turn "roughly" retrieval into an accurate system you can trust.

Hybrid
Keywords + meaning
Rerank
Precision after retrieval
GraphRAG
Links between entities

Why basic RAG fails in production

If you have read the basic RAG guide, you know the flow: you split documents into chunks, convert to embeddings, store in avector DB, and at query time you search for the similar chunks and paste them into the prompt. It works — until it does not.

Three problems break basic RAG the moment the data is real:

Every technique in this guide directly addresses one of these problems. We will go in the order of the flow.

Smart chunking — the foundation that decides everything

Chunking quality sets the quality ceiling of the whole system. A good chunk is a coherent unit of information that can be understood on its own. Strategies beyond naive split-by-length:

Hybrid Search — the best value per unit of effort

This is the upgrade with the best return, and it is relatively simple. Hybrid search combines two kinds of search and merges the results:

psychology
Vector search (semantic)
Catches meaning and paraphrase. "how to cancel a subscription" will also find "terminating service". Weak on exact terms.
manage_search
Keyword search (BM25)
Catches exact terms: catalog numbers, names, error codes. Weak on paraphrase and meaning.

You combine both and merge the rankings (usually with a method like RRF — Reciprocal Rank Fusion). The result catches both meaning and exact terms — coverage neither method gives alone. Most modernvector DBs support built-in hybrid search.

Reranking — the precision stage

Fast retrieval (vector/BM25) is a "wide net" — it quickly brings many candidates, but its ranking is coarse. Reranker is a dedicated model (a cross-encoder) that reads the query and each candidate together and gives a far more accurate relevance score.

The winning pattern is two stages:

1
Broad retrieval
Quickly bring ~50 candidates with hybrid search. Favor high recall — the answer should be somewhere inside.
2
Rerank & filter
Pass the 50 through a reranker, take only the top 5 to the LLM. Precision jumps, and the context stays short and cheap.
tips_and_updates
Reranking also saves money

When the 5 chunks reaching the LLM are truly relevant, you can send less context — fewer tokens, a better answer. Reranking improves quality and lowers cost at the same time.

GraphRAG & metadata filtering

Metadata filtering

Remember the metadata we attached during chunking? Now it pays off. Instead of searching the entire store, filter first: "only 2026 documents", "only this department", "only product guides". This shrinks the search space, raises precision, and prevents returning stale or irrelevant information.

GraphRAG

Regular search finds single, isolated chunks. GraphRAG builds a knowledge graph — entities (people, products, concepts) and the relationships between them — and lets you answer questions that "connect the dots" across documents. A question like "which customers are affected by the change to policy X?" requires connecting information from different sources — something a single similarity search does not do well. GraphRAG is more expensive to build, so save it for cases that genuinely require reasoning about relationships.

The full pipeline — how it all connects

1 Smart chunking + metadata enrichment + contextual retrieval.
2 Metadata filter — shrink the search space before retrieval.
3 Hybrid search — bring ~50 candidates (vector + BM25).
4 Rerank — narrow down to the 5 strongest.
5 Generate — the LLM generates an answer with source citations.
warning
Do not add everything at once — measure

Build an evaluation set (questions + correct answers) and add one technique at a time, measuring the improvement. Without evals you add complexity without knowing whether it helps. Start with hybrid + reranking — they deliver most of the improvement.