All skills
wshobson avatar

/vector-index-tuning

@be57c0b
by Seth Hobsonwshobson/agents40k stars
4,281

Optimize vector index performance for latency, recall, and memory. Use when tuning HNSW parameters, selecting quantization strategies, or scaling vector search infrastructure.

Use this Skill: https://skilld.dev/gh/wshobson/agents/vector-index-tuning

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ49 tokens always: the name and description. β‰ˆ525 when used: this file. β‰ˆ3.3k more on demand in 1 file.

Vector Index Tuning

Guide to optimizing vector indexes for production performance.

When to Use This Skill

  • Tuning HNSW parameters
  • Implementing quantization
  • Optimizing memory usage
  • Reducing search latency
  • Balancing recall vs speed
  • Scaling to billions of vectors

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

  • Benchmark with real queries - Synthetic may not represent production
  • Monitor recall continuously - Can degrade with data drift
  • Start with defaults - Tune only when needed
  • Use quantization - Significant memory savings
  • Consider tiered storage - Hot/cold data separation

Don'ts

  • Don't over-optimize early - Profile first
  • Don't ignore build time - Index updates have cost
  • Don't forget reindexing - Plan for maintenance
  • Don't skip warming - Cold indexes are slow

Source: SKILL.md on GitHub

No alerts16d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides guide materials, architectural recommendations, and Python templates for vector index performance tuning, parameter benchmarking, and quantization strategies. No security risks were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW Β· No issues

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at be57c0b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 4 months ago
  • vector-search
  • hnsw
  • quantization
  • indexing
  • performance-tuning
  • recall
  • latency
  • approximate-nearest-neighbor

README badge

README badge for wshobson/agents/vector-index-tuning

Optimize vector index performance by tuning HNSW parameters, selecting quantization strategies, and choosing the right index type for your data scale. Covers parameter tuning (M, efConstruction, efSearch), quantization methods (FP32, FP16, INT8, PQ, binary), and decision trees for index selection from flat search up to billion-scale vectors.

Generated from the current SKILL.md.

What vector index types does this skill cover?
The skill covers Flat, HNSW, IVF+PQ, and DiskANN indexes, with recommendations based on dataset size from under 10K vectors to over 100M.
Can I use this skill to tune HNSW parameters like M and efSearch?
Yes. The skill provides default values and explains how each parameter (M, efConstruction, efSearch) affects recall, latency, and memory tradeoffs.
What quantization strategies are covered?
The skill covers FP32, FP16, INT8 scalar, product quantization, and binary quantization with their respective memory footprints.
Does this skill help with scaling to large datasets?
Yes. It includes index selection guidance for datasets up to billions of vectors and discusses tiered storage and reindexing strategies.

Generated from the current SKILL.md. These answers refresh after source changes.