We're talking new releases & fast AI at Redis Released. Join us in your city.

Register now

Speed is accuracy: Why Redis Query Engine leads in vector search

In today's AI-driven landscape, the difference between retrieving relevant information and irrelevant noise can make or break your application's value proposition. Whether you're building a RAG system that powers customer support, a recommendation engine that drives revenue, or a feature store that enables real-time ML decisions, one fundamental truth remains: serving the right data at the right time is everything.

The Performance-Accuracy-Cost Triangle: Every vector search system faces three competing demands:

  • Accuracy: How well does your system retrieve the most relevant vectors?
  • Performance: How quickly can you serve results to meet user expectations? How further can you scale your performance over demand?
  • Cost: How much compute and memory resources does your system consume to provide a responsive experience?

Traditional approaches force you to choose two out of three. Brute-force search gives perfect accuracy but terrible performance. Simple hashing techniques offer speed but sacrifice accuracy. This is where intelligent indexing becomes a competitive advantage. Redis offers this flexibility due to its dev’s friendly swiss-knife.

Redis flavor of HNSW: The algorithm that changes the game

Imagine you're designing a navigation system for a massive city with millions of locations. Traditional brute-force search would be like checking every single address in the city phone book—thorough but impossibly slow. HNSW, however, builds a smart navigation system that works just like modern GPS.

Hierarchical Navigable Small World (HNSW) is a graph-based indexing algorithm that fundamentally changes how we think about these trade-offs. Instead of forcing you to choose between accuracy and performance, HNSW provides fine-grained control over the balance through carefully tuned hyperparameters for your approximate nearest-neighbor search (ANN).

Think of HNSW as creating a multi-level navigation system through your vector space—like having both highways and local roads in a city. You can travel quickly across long distances using highways (upper layers), then use local roads (lower layers) for precise navigation to your destination.

Decoding the HNSW hyperparameters in Redis

Redis HNSW's power lies in its hyperparameters, which give you precise control over the accuracy-performance-memory triangle:

M (maximum connections per node)

`M` is defined as the “Max number of outgoing edges (connections) for each node in a graph layer.” In practical terms, `M` controls the connectivity of each node in the HNSW graph. Think of it like a city map where each neighborhood node has up to `M` roads leading out. A larger `M` means a denser road network—travelers (the search process) have more direct routes to explore. Reducing `M` shrinks the index (fewer roads) and speeds up building the graph, but it limits routing options and can hurt recall.

Business Impact (Redis default M 16):

  • Higher M (16-96): More connections create denser graphs with better recall, but consume more memory and slower indexing
  • Lower M (4-16): Fewer connections reduce memory footprint and speed up construction, but may sacrifice accuracy

EF_CONSTRUCTION (construction time search width)

`EF_CONSTRUCTION` is the “Max number of connected neighbors to consider during graph building.” In other words, it sets how thoroughly the indexer searches for good connections when adding new vectors. Back to our City, it’s like the budget and time you invest in city planning—how thoroughly you survey and connect locations when building your road network. Trade-off consideration—if you build the index once but query it millions of times. Investing in higher EF_CONSTRUCTION often pays dividends in query performance.

Business Impact (Redis default 200):

  • Higher EF_CONSTRUCTION (200-500): Takes longer to build, but creates a more optimal road network. Leads to better graph quality and higher query accuracy
  • Lower EF_CONSTRUCTION (100-200): Faster to build your road network, but some optimal connections might be missed.Leads to potentially lower query performance.

EF_RUNTIME (query time search width)

`EF_RUNTIME` is the “Max [number of] top candidates during KNN search.” This parameter controls how deeply each search query examines the graph. Our navigation and map system controls how many different routes your GPS considers when finding a path to your destination. Unlike city planning (EF_CONSTRUCTION), you can adjust your navigation strategy per trip. Emergency routes can use high EF_RUNTIME for optimal paths, while routine trips can use low EF_RUNTIME for speed.

Business Impact (Redis default 10):

  • Low EF_RUNTIME (4-512): Like a GPS that considers only a few route options. Fast route calculation, gets you moving quickly. Might miss the truly optimal route (lower accuracy)
  • High EF_RUNTIME (512-8192): Like a GPS that thoroughly evaluates many possible routes. Finds more optimal routes, higher chance of finding the best path. Takes longer to calculate your route (better accuracy)

Speed buys you headroom. Headroom enables precision.

To recap the practical upshot:

1. Faster search (`EF_RUNTIME`). If your engine is fast, you can set a larger `EF_RUNTIME` to examine more candidates per query, improving recall.

2. Faster indexing (`EF_CONSTRUCTION`). If building the index is quick, you can use a larger `EF_CONSTRUCTION` to create a higher-quality graph up front.

3. Plenty of memory (`M`). If your system can handle more connections, a larger `M` creates a denser graph for better accuracy.

Redis advantage: Maximum navigation power

Redis Query Engine's exceptional performance gives you the "headroom" to maximize accuracy-focused parameters without sacrificing speed—like having a supercharged GPS that can evaluate complex routes instantly. Redis lets you use higher M, EF_CONSTRUCTION, and EF_RUNTIME values while still meeting tight latency requirements. This is because Redis uses multiple threads to access the index and has a query latency of less than a millisecond, even at high throughput. This in-memory architecture with minimal I/O overhead means you can have both the comprehensive road network and the lightning-fast route calculation your business demands. Check our documentation to see how you can leverage these parameters to their full potential

In other words, Redis’s high performance enables high precision. You’re not forced to pick between speed and recall to the same extent as other vector databases—a fast engine lets you have both by tuning these parameters properly.

Benchmarking Redis: Real-world results

Real-world benchmarks confirm that Redis’s speed translates into high recall at low latency. For example, an internal Redis benchmark ran KNN searches on 1 billion 768‑dimensional vectors. In that test, Redis achieved ~90% recall with a median latency of only 200 ms (50 concurrent queries) and ~95% recall at about 1.3 s latency. In other words, very high-precision search was possible with acceptable latency on massive data.

Moreover, Redis has repeatedly outperformed other vector search engines on standard benchmarks. These results reinforce that Redis’s design gives you more options: you can reach very high recall (through parameter tuning) without paying a large latency penalty.

Final thoughts: Redis is the fast path to smart search

Many people assume speed and accuracy must compete, but Redis shows they can reinforce each other. Because the Redis Query Engine is so fast, it becomes feasible to crank up the HNSW settings for maximum recall without missing the latency targets of real-time applications. With the right `M`, `EF_CONSTRUCTION`, and `EF_RUNTIME` values, and Redis’s optimization, you get smarter, faster vector searches at scale. Whether you’re doing semantic search, recommendation, or AI-powered insights, Redis provides the tools and the performance foundation to deliver precise results with minimal delay. In practice, Redis “speed = accuracy” isn’t just a slogan—it’s a measurable advantage in modern vector search.