vector-index-tuning

Tune HNSW parameters and quantization strategies for vector search performance.

2|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/as4584/antigravity-skills --skill vector-index-tuning-as4584
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vector-index-tuning
Source: https://github.com/as4584/antigravity-skills/tree/main/agents-wshobson/plugins/llm-application-dev/skills/vector-index-tuning
Command: npx skills add https://github.com/as4584/antigravity-skills --skill vector-index-tuning-as4584

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires hnswlib, scikit-learn, qdrant-client, numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of optimizing vector index performance, ensuring efficient and accurate search results for large-scale vector databases.

Core Features & Use Cases

  • HNSW Parameter Tuning: Adjust M, efConstruction, and efSearch for optimal recall and latency.
  • Quantization Strategies: Implement INT8 scalar, Product Quantization (PQ), or binary quantization to reduce memory footprint.
  • Use Case: When deploying a similarity search system with millions of embeddings, use this Skill to find the best HNSW parameters and quantization method to meet strict latency and memory constraints.

Quick Start

Use the vector-index-tuning skill to recommend HNSW parameters for 1 million vectors targeting 95% recall.

Frequently Asked Questions about vector-index-tuning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I tune HNSW parameters for optimal vector search latency and recall?

Tune HNSW parameters like M, efConstruction, and efSearch to balance the tradeoff between search latency and recall. Adjusting M increases graph connectivity and memory, while efSearch controls search depth and query accuracy.

What is the best way to reduce memory footprint in large-scale vector databases?

Reduce vector database memory footprint by applying quantization strategies such as INT8 scalar quantization, Product Quantization (PQ), or binary quantization. These methods compress embedding representations while maintaining acceptable search recall.

Can I use scikit-learn and qdrant-client to optimize similarity search for millions of embeddings?

Yes, you can use scikit-learn and qdrant-client to optimize similarity search for millions of embeddings. The skill leverages these dependencies to estimate memory usage and implement quantization for large-scale vector search applications.

How do I estimate memory requirements for 1 million vectors targeting 95% recall?

Estimate memory requirements for 1 million vectors by calculating HNSW graph size based on the M parameter and applying quantization strategies. Memory estimation helps determine if strict latency and memory constraints are achievable.

What is the difference between INT8 scalar quantization and Product Quantization for vector indexes?

INT8 scalar quantization compresses individual vector dimensions into 8-bit integers, while Product Quantization divides vectors into subvectors and compresses each independently. Both reduce memory footprint but impact recall and search latency differently.

Does vector index tuning work with hnswlib for performance optimization?

Yes, vector index tuning works with hnswlib to optimize performance. The skill uses hnswlib to implement HNSW parameter tuning, allowing you to adjust efConstruction and efSearch to meet specific recall and latency targets.