Introduction

In pursuit of optimizing real-time vector search within a large, company-segmented dataset , a shift from the traditional single HNSW graph to a more tailored approach wa necessary. The introduction of a HNSW Manager allows for searches across multiple, segmented HNSW graphs, enhancing efficiency by directly targeting relevant company data instead of searching the entire dataset. This approach prompts a comparison of memory consumption, build time, and response time between the singular and multiple graph approaches.

HNSW Manager

Untitled

Single vs. Multiple HNSW Graphs: A Comparative Analysis

Single HNSW Graph

Total vector num HNSW num_vectors per HNSW Build Time Memory
100k 1 100k 350s 230 MB
1M 1 1M 4435s 808 MB

Multiple HNSW Graphs

Total vector num HNSW num vectors per HNSW Build Time Memory
100k 2 50k 267s 252 MB
100k 10 10k 94s 293 MB
100k 100 1k 27s 747 MB
1M 10 100k 2989s 2419 MB
1M 100 10k 909s 2887 MB
1M 1000 1k 161s 3670 MB

Key Findings

Pros and Cons of Single vs. Multiple Divided HNSW Graphs

Single HNSW Graphs