Skip to main content
Configure HNSW parameters when creating a collection to balance search speed, accuracy, and memory usage. Custom parameters are useful when default settings do not meet your recall or latency requirements.

Create a collection with custom parameters

The following example creates a collection with custom m and ef_construct values inside HnswConfigDiff.
Higher parameter values improve accuracy at the cost of increased memory usage, slower index construction, and longer search times. Lower values prioritize speed and memory efficiency but can reduce recall.

Create a collection with default settings

When you omit hnsw_config, VectorAI DB applies balanced default settings that work well for general-purpose vector search. Test with your data to determine if custom parameters provide improvements.