
Benchmarks HNSW parameters (M, efConstruction, efSearch) against your actual data to find the sweet spot between recall and latency. Implements scalar quantization, product quantization, and binary compression with memory usage estimates. The parameter tuning function runs systematic tests across different configurations and calculates recall@k, which beats guessing at settings. Also includes quantization strategies that can cut memory usage by 75% with minimal recall loss. Most useful when you're hitting memory limits or search latency SLAs with large vector datasets over 100K embeddings.
$ npx -y skills add wshobson/agents --skill vector-index-tuning --agent claude-codeInstalls into .claude/skills of the current project.
Guide to optimizing vector indexes for production performance.
Data Size Recommended Index
────────────────────────────────────────
< 10K vectors → Flat (exact search)
10K - 1M → HNSW
1M - 100M → HNSW + Quantization
> 100M → IVF + PQ or DiskANN
| Parameter | Default | Effect |
|---|---|---|
| M | 16 | Connections per node, ↑ = better recall, more memory |
| efConstruction | 100 | Build quality, ↑ = better index, slower build |
| efSearch | 50 | Search quality, ↑ = better recall, slower search |
Full Precision (FP32): 4 bytes × dimensions
Half Precision (FP16): 2 bytes × dimensions
INT8 Scalar: 1 byte × dimensions
Product Quantization: ~32-64 bytes total
Binary: dimensions/8 bytes
Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.
Sponsors