AI EngineeringIntermediate15 min

Retrieval quality: chunking, hybrid search & reranking

The practical levers that move retrieval from demo quality to dependable.

See it on the map

Chunking decides what a retrievable unit is. Too small and chunks lose context. Too large and they dilute the match and waste tokens. Split on document structure such as headings and paragraphs, keep some overlap, and attach the title and section to each chunk so it makes sense alone.

Hybrid search combines keyword scoring such as BM25 with vector similarity and merges the rankings, for example with reciprocal rank fusion. Keywords catch exact names, codes and rare terms that embeddings blur. Vectors catch paraphrase.

A reranker takes the top candidates, perhaps 30 to 50, and scores each against the query with a stronger model, then keeps the best few. It costs latency but often gives the largest single quality jump. Measure it against your own queries, not a benchmark.

Key points

  • Chunk on structure and carry titles into each chunk.
  • Hybrid search beats either method alone on mixed queries.
  • Rerank a wide candidate set down to a few.
  • Build a small labelled query set and track recall@k.

Answer these out loud

  1. 1Your docs contain error codes like E4017. Which retrieval method catches them and why?
  2. 2How would you decide between 200-token and 800-token chunks for your data?

Use this from an agent

Any MCP client, including Grok, can read this lesson. See how to connect.

REST
curl https://engineeros-delta.vercel.app/api/v1/topics/retrieval-quality

This unlocks