Index Parameters
This page summarises cross-index defaults and the top-level common fields. Each index page carries the complete list of public build and search keys for that index; the source remains the final authority:
- Build parameter keys:
src/constants.cpp - Public constants:
include/vsag/constants.h - Per-index examples: the
examples/cpp/*_index_*.cppfiles (e.g.103_index_hgraph.cpp).
Common Fields
Every index accepts these top-level fields at build time. dtype and metric_type are required;
repr is optional. dim is required for non-sparse data and defaults to 4096 for
dtype: "sparse" when omitted:
| Field | Values | Description |
|---|---|---|
dim | positive integer | Vector dimensionality; cannot change after build |
dtype | float32 / fp16 / bf16 / int8 / sparse | Scalar value type. sparse is retained for sparse-index compatibility. |
repr | dense / sparse / multi_vector | Optional data layout. When omitted, VSAG infers sparse from dtype: "sparse" and otherwise uses dense. |
metric_type | l2 / ip / cosine | Distance metric |
dtype and repr describe different properties: dtype is the scalar encoding, while repr
is the record layout. dtype: "sparse" requires repr: "sparse" when repr is explicit.
Use repr: "multi_vector" with a supported multi-vector index and a scalar dtype such as
float32.
HGraph
HGraph places its build parameters under the generic index_param key (see
examples/cpp/103_index_hgraph.cpp); the hgraph key is reserved for search-time parameters.
{
"dim": 128,
"dtype": "float32",
"metric_type": "l2",
"index_param": {
"base_quantization_type": "fp32",
"max_degree": 32,
"ef_construction": 400
}
}
| Field | Typical | Description |
|---|---|---|
adaptive_pruning | false | Experimental NSW bottom forward/reverse L2 pruning; see HGraph |
max_degree | 16–48 | Maximum out-degree per node |
ef_construction | 200–500 | Candidate set size during build; larger = higher recall, slower build |
alpha | 1.0 | Final robust-pruning factor; PiPNN requires a finite value at least 1.0 |
base_quantization_type | fp32 / fp16 / bf16 / sq8 / sq8_local / sq4_local / sq4 / pq / rabitq / saq / tq | Quantization of the base storage; see the Quantization chapter for behavior and per-index restrictions |
use_reverse_edges | false | Track incoming neighbors for O(1) reverse-edge lookup; roughly doubles edge storage and is unsupported with compressed graph storage |
label_remap_type | pg | Label-map implementation: pg (default) or robin |
reorder_source | precise | Reorder from the precise store or directly from base; RaBitQ x+y split, including tq_chain="mrle, rabitq", selects base automatically |
persist_source_id | false | Include HGraph source-ID metadata in serialization; useful when a restored index must later export a build cache |
use_conjugate_graph | false | Enable HGraph feedback/pretraining and persist the auxiliary conjugate graph |
mrle_dim | 0 | MRLE output dimension in [0, dim]; 0 means input dimension |
fast_encode_rabitq | true | Use fast multi-bit RaBitQ encoding; false restores the exact encoder |
fast_encode_rabitq_rounds | 6 | Fast-encoder refinement rounds in [1, 32] |
For HGraph float32 L2/IP/cosine, sq8_local and sq4_local can select either base_quantization_type or precise_quantization_type (the latter requires use_reorder: true). See local SQ4/SQ8 for memory, persistence and limitations.
SAQ base-quantizer parameters
When base_quantization_type is saq, HGraph, IVF, and Pyramid accept the following parameters.
They are part of the trained model state and must remain consistent when loading or merging
compatible index states.
| Field | Type | Default | Valid values | Description |
|---|---|---|---|---|
saq_avg_bits | float | 4.0 | [1, 8] | Average payload target per input dimension. The complete record reserves the same 12-byte allowance as equal-length multi-bit RaBitQ; SAQ’s 8-byte metadata per segment and byte-aligned bit planes are charged against that fixed record budget. |
saq_segment_count | unsigned integer | 0 | 0 or a feasible positive value | 0 jointly learns the segment count, 64-dimension-aligned boundaries, and bit widths. A positive value fixes evenly distributed aligned boundaries and still learns bit widths. Training rejects requests that cannot fit the dimension or record budget. |
saq_random_rotation | boolean | true | true / false | Apply a deterministic, persisted orthogonal rotation within every segment. |
See the SAQ guide for record layout, metric semantics, persistence, and a complete HGraph example.
PiPNN build parameters
When graph_type is pipnn, HGraph and Pyramid also accept the following build parameters under
index_param. They share these defaults and validation rules:
| Field | Default | Description |
|---|---|---|
pipnn_max_leaf_size | 1024 | Maximum partition leaf size, in [2, 2147483647]. |
pipnn_min_leaf_size | 64 | Target for merging undersized leaves; must be positive and no larger than pipnn_max_leaf_size. |
pipnn_leader_sample_rate | 0.005 | Fraction sampled as leaders, in (0, 1]; each partition uses 2 to 1000, bounded by its point count. |
pipnn_fanout | [10, 2] | Positive nearest-leader fanout at successive partition levels; deeper levels use 1. |
pipnn_leaf_neighbor_count | 5 | Positive nearest-candidate count per point and leaf; undersized leaves use at least 4. |
pipnn_hash_plane_count | 12 | Direction-hash bits in [1, 15]; max_degree <= 2^pipnn_hash_plane_count. |
pipnn_reservoir_size | 64 | Positive per-point candidate capacity before final pruning; effective capacity is max(value, max_degree) and must not exceed 65535. |
pipnn_build_quantization_type | "fp32" | Internal precision for CPU PiPNN batch graph construction: "fp32" (default, lossless) or "sq8_local" (opt-in per-vector asymmetric 8-bit quantization with SIMD kernels; requires dim <= 65535, initial Build only). |
The existing alpha field controls PiPNN’s final robust pruning. ef_construction only tunes NSW
and has no effect on PiPNN.
HGraph additionally supports the experimental L2-only options pipnn_adaptive_pruning (default false) and pipnn_adaptive_pruning_adjust_step (default 0.06). They adapt the final per-point pruning threshold during initial Build; see HGraph adaptive PiPNN pruning. Pyramid exposes the same two options; see its build parameter table.
At search time:
{"hgraph": {"ef_search": 100}}
ef_search accepts any positive signed 64-bit integer. It is no longer capped relative to
topk; very large values can substantially increase latency and memory used by the frontier.
use_conjugate_graph_search is a boolean (default true) that uses learned conjugate edges when
the index was built with use_conjugate_graph: true.
The hgraph search-param object also accepts brute_force_threshold (a float
in [0.0, 1.0], default 0.0). When set above zero and the request carries a
filter whose ValidRatio() is at most this threshold, HGraph skips the graph
traversal and runs an exact scan over the surviving ids. See the
HGraph index page
for details.
LazyHGraph
LazyHGraph can take its build parameters in a top-level lazy_hgraph object
(preferred for clarity) or in the generic index_param object. The hgraph
sub-object is forwarded to the internal HGraph used after transition.
{
"dim": 128,
"dtype": "float32",
"metric_type": "l2",
"lazy_hgraph": {
"transition_threshold": 1000,
"hgraph": {
"base_quantization_type": "sq8",
"max_degree": 26,
"ef_construction": 100
}
}
}
| Field | Typical | Description |
|---|---|---|
transition_threshold | 1000 or workload-specific | Positive vector count at which the index converts from exact flat search to HGraph |
hgraph | HGraph build object | Parameters for the graph phase; see HGraph |
LazyHGraph only supports dtype: "float32". Search parameters use the hgraph
object, for example {"hgraph": {"ef_search": 100}}. See the
LazyHGraph index page for details.
The hgraph search-param object also accepts the following filter-related parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
skip_ratio | float | 0.2 | Controls the ratio of filtered-search candidate checks to skip, in range [0.0, 1.0]. Higher values mean more aggressive skipping, faster search, and potentially lower recall. |
skip_strategy | string | "deterministic_accumulative" | Skip strategy. Supports "random" and "deterministic_accumulative". |
IVF
{
"ivf": {
"buckets_count": 4096,
"base_quantization_type": "sq8"
}
}
See the IVF index page for the full build-parameter table.
Brute Force
{"brute_force": {}}
Quantization, IO, and thread-pool parameters are available under
index_param. See the BruteForce index page
for the full parameter table.
Pyramid
adaptive_pruning defaults to false. For experimental NSW bottom forward/reverse L2 pruning, see Pyramid.
Pyramid build parameters also live under index_param:
{
"dtype": "float32",
"metric_type": "l2",
"dim": 128,
"index_param": {
"base_quantization_type": "sq8",
"max_degree": 24,
"ef_construction": 300,
"store_paths": true
}
}
For graph_type: "pipnn", see the shared
PiPNN build parameters above.
store_paths is a top-level Pyramid build parameter and defaults to false. Enable it when
GetDataByIdsWithFlag must return the original default or named-hierarchy paths with
DATA_FLAG_PATH; see the
Pyramid parameter table for its completeness and
persistence semantics.
MRLE with split RaBitQ uses base_quantization_type: "tq",
tq_chain: "mrle, rabitq", mrle_dim, and the
rabitq_bits_per_dim_base/rabitq_bits_per_dim_precise pair. It reorders from the split base codes. Original FP32 vectors are not retained for this
combination: Pyramid only auto-enables store_raw_vector when the transform quantizer needs raw
vectors and the case is not MRLE with a RaBitQ split (RequiresRawVectorForTransformQuantizer
and not RequiresRawVectorForMRLERaBitQSplit). HGraph differs and does auto-enable it for this
exact combination. See the
Pyramid page for a complete configuration and
storage/recall tradeoffs.
SINDI (sparse vectors)
{
"dtype": "sparse",
"metric_type": "ip",
"dim": 1024,
"index_param": {
"term_id_limit": 30000,
"doc_prune_ratio": 0.1
}
}
See the SINDI page for use_quantization, immutable builds, and search
parameters such as n_candidate.
SINDI_V2 (sparse vectors)
SINDI_V2 supports all SINDI features with both in-memory and disk-based I/O.
{
"dtype": "sparse",
"metric_type": "ip",
"dim": 1024,
"index_param": {
"term_id_limit": 30000,
"use_reorder": true,
"term_io": {
"type": "async_io",
"file_path": "/path/to/sindi_v2.terms"
},
"rerank_io": {
"type": "async_io",
"file_path": "/path/to/sindi_v2.rerank"
}
}
}
See the SINDI_V2 page for build parameters and search parameters such as
n_candidate and filter_callback_limit.
SIMQ (multi-vector retrieval)
SIMQ requires top-level dim > 0, dtype: "float32", and metric_type: "ip";
repr: "multi_vector" can describe the layout explicitly. Its 15 public build fields live under
index_param: base_io_type, base_file_path, base_enable_read_cache, base_cache_total_size,
quantization_type, build_thread_count, init_cluster_ratio, max_cluster_size,
split_start_idx, random_seed, coarse_k, rerank_k, split_delay_seconds,
support_duplicate, and deduplicate_storage.
Both KNN and range search accept simq.coarse_k, simq.rerank_k (omitted/non-positive values
use build defaults), and soft simq.timeout_ms. Root-level finite threshold limits KNN final
distances only; range search uses radius. Shared parallelism, factor, and enable_reorder
are parsed inside simq but ignored; MaxSim reranking cannot be disabled. See the
SIMQ parameter tables for defaults, constraints, storage/quantization caveats,
and the distinction between input dtype and storage format.
Runtime Parameters
Beyond build-time parameters, Index::Tune and SearchParam tweak runtime settings such as
ef_search and nprobe. See Optimizer and the
examples/cpp/3xx_feature_*.cpp examples.