Configuration
EdgeConfig describes the vectors an Edge Shard stores and the parameters that govern how it indexes, stores, and searches them. Pass it to create/new when starting a new shard, and optionally to load when reopening one.
Every parameter except vectors and sparse_vectors is optional. A parameter left unset is considered as not specified rather than set to the default: when loading an existing shard, each unspecified parameter resolves through provided - persisted in edge_config.json - derived from the existing segments - default, so it keeps whatever the shard already has. This is why a configuration that sets only wal_options leaves the rest of the shard’s configuration untouched.
EdgeConfig
EdgeConfig(
vectors: Optional[Union[EdgeVectorParams, Dict[str, EdgeVectorParams]]] = None,
sparse_vectors: Optional[Dict[str, EdgeSparseVectorParams]] = None,
hnsw_config: Optional[HnswIndexConfig] = None,
quantization_config: Optional[QuantizationConfigType] = None,
optimizers: Optional[EdgeOptimizersConfig] = None,
max_search_threads: Optional[int] = None,
search_pool_core: Optional[int] = None,
payload_memory: Optional[Memory] = None,
id_tracker_memory: Optional[Memory] = None,
wal_enabled: Optional[bool] = None,
)
In Rust, EdgeConfig is a struct whose fields you can set directly, or build with the fluent EdgeConfig::builder():
let config = EdgeConfig::builder()
.vector("text", EdgeVectorParams::builder(384, Distance::Cosine).build())
.payload_memory(Memory::Cold)
.build();
| Parameter | Description |
|---|---|
vectors | Dense vector configuration. In Python, a single EdgeVectorParams configures the default unnamed vector. Optional if sparse_vectors is given. |
sparse_vectors | Sparse vector configuration. |
payload_memory | Memory tier of the payload storage. Default: Cold. |
id_tracker_memory | Memory tier of the point ID tracker in non-appendable segments. Default: Pinned. |
hnsw_config | Global HNSW parameters, used when building the HNSW index. Override per vector with EdgeVectorParams.hnsw_config. |
quantization_config | Global quantization. Override per vector with EdgeVectorParams.quantization_config. Refer to Quantization. |
optimizers | Optimizer parameters. Refer to Optimizer Parameters. |
max_search_threads | Size of the shard’s search thread pool, which runs per-segment reads in parallel. Defaults to a count derived from the number of CPUs. |
search_pool_core | Pin every search pool thread to this CPU core, bounding the shard’s search compute to one core while keeping the pool’s I/O overlap. Best-effort. Defaults to OS scheduling. |
wal_enabled | Whether updates are written to a write-ahead log. Enabled when unset. Fixed when the shard is created. Refer to WAL Options. |
wal_options | A WalOptions value carrying the write-ahead log parameters. Rust only. Refer to WAL Options. |
A new shard must define at least one of vectors or sparse_vectors; both are validated against the existing segments on load. Python raises ValueError if both are empty, so changing only a tunable parameter still requires redeclaring the vectors. Rust accepts a tunables-only configuration and takes the vectors from the shard.
Dense Vector Parameters
EdgeVectorParams configures one named dense vector. size and distance are required and cannot be changed after the shard is created.
EdgeVectorParams(
size: int,
distance: Distance,
multivector_config: Optional[MultiVectorConfig] = None,
datatype: Optional[VectorStorageDatatype] = None,
quantization_config: Optional[QuantizationConfigType] = None,
hnsw_config: Optional[HnswIndexConfig] = None,
memory: Optional[Memory] = None,
)
pub fn builder(size: usize, distance: Distance) -> EdgeVectorParamsBuilder
| Parameter | Description |
|---|---|
size | Vector dimension. Required. |
distance | Distance metric. Required. |
multivector_config | Multi-vector configuration, for late-interaction models. |
datatype | Storage datatype for the vector. |
quantization_config | Per-vector quantization, overriding the global setting. |
hnsw_config | Per-vector HNSW parameters, overriding the global setting. |
memory | Memory tier of the original vector storage. Default: Cached. Pinned isn’t supported and is treated as Cached. |
Sparse Vector Parameters
EdgeSparseVectorParams configures one named sparse vector. All parameters are optional.
EdgeSparseVectorParams(
full_scan_threshold: Optional[int] = None,
modifier: Optional[Modifier] = None,
datatype: Optional[VectorStorageDatatype] = None,
memory: Optional[Memory] = None,
)
pub fn builder() -> EdgeSparseVectorParamsBuilder
| Parameter | Description |
|---|---|
full_scan_threshold | Threshold below which a full scan is used instead of the sparse index. |
modifier | Score modifier. Set to Modifier.Idf for sparse vector queries that weight terms by inverse document frequency. |
datatype | Storage datatype for the vector. |
memory | Memory tier of the sparse index. Default: Pinned. |
Memory Tiers
The memory parameter, and the payload_memory and id_tracker_memory parameters on EdgeConfig, control how a component is held in RAM. Data is always persisted on disk. The Memory enum has three values:
| Tier | Behavior |
|---|---|
Cold | Not pre-loaded from disk. Pages are read on demand. |
Cached | Pre-loaded into the page cache when the shard opens. The OS can evict it under memory pressure. |
Pinned | Loaded in RAM and never evicted. The component must fit in RAM at all times. |
Not every component supports every tier. Dense vectors and payload storage can’t be pinned, and Pinned is treated as Cached there. Refer to Memory Tiers for the tiers each component supports.
The memory parameter also applies to hnsw_config, to every quantization config, and to payload index schemas.
Optimizer Parameters
EdgeOptimizersConfig controls what the optimize method does when you call it.
EdgeOptimizersConfig(
deleted_threshold: Optional[float] = None,
vacuum_min_vector_number: Optional[int] = None,
default_segment_number: Optional[int] = None,
max_segment_size: Optional[int] = None,
indexing_threshold: Optional[int] = None,
prevent_unoptimized: Optional[bool] = None,
)
In Rust, set the fields you need and leave the rest at their defaults:
pub struct EdgeOptimizersConfig {
pub deleted_threshold: Option<f64>,
pub vacuum_min_vector_number: Option<usize>,
pub default_segment_number: Option<usize>,
pub max_segment_size: Option<usize>,
pub indexing_threshold: Option<usize>,
pub prevent_unoptimized: Option<bool>,
}
let optimizers = EdgeOptimizersConfig {
indexing_threshold: Some(20_000),
..Default::default()
};
| Parameter | Description |
|---|---|
deleted_threshold | Minimum fraction of deleted vectors in a segment required to run vacuum. Default: 0.2. |
vacuum_min_vector_number | Minimum number of vectors in a segment required to run vacuum. Default: 1000. |
default_segment_number | Target number of segments. 0 chooses automatically from the CPU count. |
max_segment_size | Maximum segment size in KB. Derived from the CPU count when unset. |
indexing_threshold | Size in KB above which a segment gets an HNSW index. |
prevent_unoptimized | Prevents slow reads from large unoptimized segments by deferring the visibility of points until they’ve been indexed. |
optimize
Applies the optimizer parameters above: removes data marked for deletion, merges segments, and builds indexes. Qdrant Edge has no background optimizer, so optimization happens only when you call this method. It runs synchronously and blocks until no further optimization is planned.
def optimize(self) -> bool
pub fn optimize(&self) -> OperationResult<bool>
pub fn optimize_with_budget(&self, budget: ResourceBudget) -> OperationResult<bool>
| Parameter | Description |
|---|---|
budget | Rust only. The CPU and I/O budget that each optimization draws permits from. |
Returns True if any segment was optimized, and False if the shard was already optimal.
Create a budget with ResourceBudget::new(cpu_budget, io_budget). optimize_with_budget waits until a permit is available. Clones of a ResourceBudget share permits, so using the same budget for concurrent calls, such as calls across shards, limits their combined resource usage. optimize gives each optimization all the indexing threads it requests.
Call optimize at a point when blocking is acceptable, such as after a batch of upserts or during an idle period. Until it runs, newly written vectors are searchable but not yet indexed, which shows up as an indexed_vectors_count below points_count in info.
WAL Options
Qdrant Edge records every update in a write-ahead log (WAL) before applying it to storage. You can configure the WAL with wal_enabled in Python and Rust, or with WalOptions through EdgeConfig.wal_options in Rust only.
Disable the WAL
Set wal_enabled to False (.wal_enabled(false) in Rust) to disable the WAL. This setting is saved when the shard is created. Loading the shard with a different value fails. The WAL is enabled by default.
With the WAL disabled, a crash loses every update since the last flush, and wal_options is ignored. If Edge finds a WAL when loading the shard, such as one included in a restored Qdrant snapshot, it replays the operations, persists them to the segments, and removes the WAL.
WalOptions
Rust only
pub struct WalOptions {
pub segment_capacity: usize,
pub segment_queue_len: usize,
pub retain_closed: NonZeroUsize,
}
| Parameter | Description |
|---|---|
segment_capacity | WAL segment capacity in bytes. Default: 32 MiB. |
segment_queue_len | Number of segments to pre-create so appends never wait on segment creation. Default: 0. |
retain_closed | Number of closed WAL files to retain. Default: 1. |
The WAL file is pre-allocated to segment_capacity, which inflates backup sizes and OS storage reports. Reduce it for embedded and mobile deployments where 32 MiB is too large. Refer to Custom WAL Size.
Change Configuration on a Live Shard
Update a shard’s configuration after it has been opened and persist the change to edge_config.json. Rust only.
pub fn set_hnsw_config(&self, hnsw_config: HnswConfig) -> OperationResult<()>
pub fn set_vector_hnsw_config(&self, vector_name: &str, hnsw_config: HnswConfig) -> OperationResult<()>
pub fn set_optimizers_config(&self, optimizers: EdgeOptimizersConfig) -> OperationResult<()>
| Method | Description |
|---|---|
set_hnsw_config | Sets the global HNSW config. Does not affect per-vector overrides. |
set_vector_hnsw_config | Sets the HNSW config for one named vector. Fails if the vector does not exist. |
set_optimizers_config | Sets the optimizer parameters. |
Changes apply to work done after the call. Existing segments converge to the new parameters as the optimizers run.