Index of every page on this site: llms.txt
All skills
wshobson avatar

/vector-index-tuning

@4220308
by Seth Hobsonwshobson/agents43k stars
4,518
Run it yourself

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈49 tokens for metadata: the name and description. ≈525 when used: this file. ≈3.3k more on demand in 1 file.

Description uses 2.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈197 characters, or 2.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    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.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4220308. 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 6 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.