QGraph (Quantized Graph) configuration

更新时间:
复制 MD 格式

QGraph (Quantized Graph) uses a Hierarchical Navigable Small World (HNSW) graph structure with optional quantization. Configure the build and search parameters below to balance performance, recall rate, and index size for your workload.

Index build parameters

Build parameters are set at index creation time. Changing them requires rebuilding the index.

ParameterTypeDefaultDescription
proxima.hnsw.builder.max_neighbor_countuint32100Maximum number of neighbors per graph node. Higher values improve graph connectivity but increase construction time and index size.
proxima.hnsw.builder.efconstructionuint32500Size of the neighbor scan area during graph construction. Higher values produce a higher-quality graph but slow down index construction. Start with 400.
proxima.hnsw.builder.thread_countuint320Number of threads used during construction. 0 uses the number of available CPU cores.
proxima.qgraph.builder.quantizer_classstringNoneQuantizer applied to the index. Options: Int4QuantizerConverter, Int8QuantizerConverter, HalfFloatConverter. See Choose a quantizer.

Index search parameters

Search parameters can be adjusted without rebuilding the index.

ParameterTypeDefaultDescription
proxima.hnsw.searcher.efuint32500Number of nearest-neighbor candidates scanned during an online search. Higher values improve recall rate but reduce search performance. Set in the range [100, 1000].
proxima.hnsw.searcher.max_scan_ratiofloatNoneProportion of points scanned during an online search. Higher values improve recall rate but reduce search performance.
proxima.hnsw.searcher.brute_force_thresholduint32NoneMinimum number of points scanned during an online search. When this value exceeds the document count in a shard, the search switches to brute force.

Choose a quantizer

Quantization reduces index size and improves search performance at the cost of recall rate. Choose based on your memory budget and accuracy requirements.

Quantizer classIndex sizeSearch performanceRecall rate
Int4QuantizerConverterSmallestHighestLowest
Int8QuantizerConverterMediumMediumMedium
HalfFloatConverterClose to unquantizedClose to unquantizedClose to unquantized
Note: Due to CPU instruction set constraints, HalfFloatConverter delivers performance and recall rate nearly identical to no quantization. Use Int8QuantizerConverter for a meaningful size reduction, or Int4QuantizerConverter for the smallest index.

Tuning guide

The right configuration depends on your query throughput, write frequency, and recall target. Use this table as a starting point.

Query throughputWrite frequencyRecall targetRecommended configuration
LowLowLowKeep efconstruction and ef low. A smaller machine is sufficient.
LowLowHighIncrease efconstruction and ef until recall meets your target.
LowHighLowKeep efconstruction low. Tune ef upward to reach the desired recall rate.
LowHighHighKeep efconstruction low. Increase ef significantly.
HighLowLowHigh query throughput requires low ef. Low recall allows low efconstruction.
HighAnyHighThe most demanding scenario. Keep efconstruction and ef as low as possible while meeting your recall target.

General principles:

  • ef is the primary search-time tuning knob. Increase it to improve recall rate; decrease it to improve search performance.

  • max_scan_ratio and brute_force_threshold provide additional scan controls for advanced use cases.