Vector index tuning

From mtecoYY/ai-baike · View interactive version

Vector index tuning is an AI agent skill from the GitHub repository mtecoYY/ai-baike. Optimize vector index performance for latency, recall, and memory. Use when tuning HNSW parameters, selecting quantization strategies, or scaling vector search infrastructure.

How to use this skill

Skill file

Vector Index Tuning

Guide to optimizing vector indexes for production performance.

When to Use This Skill

Core Concepts

1. Index Type Selection

Data Size           Recommended Index
────────────────────────────────────────
< 10K vectors  →    Flat (exact search)
10K - 1M       →    HNSW
1M - 100M      →    HNSW + Quantization
> 100M         →    IVF + PQ or DiskANN

2. HNSW Parameters

| 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 |

3. Quantization Types

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

Templates and detailed worked examples

Full template library and detailed worked examples live in references/details.md. Read that file when you need the concrete templates.

Best Practices

Do's

Don'ts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.