vector-index-tuning — Claude Code skill: tuning vector indexes
This skill tunes vector indexes for latency, recall, and memory. Use it when adjusting HNSW, choosing quantization, or scaling vector search.
/plugin marketplace add wshobson/agents
/plugin install llm-application-dev@claude-code-workflowsWhat vector-index-tuning does
vector-index-tuning covers index selection by dataset size, from exact Flat search to HNSW, HNSW with quantization, IVF + PQ, and DiskANN. It helps connect latency, recall, and memory requirements to an index design.
The skill explains HNSW parameters such as M, efConstruction, and efSearch, along with FP32, FP16, INT8, Product Quantization, and Binary. Templates and worked examples are available in references/details.md. Use real queries for benchmarking, watch recall over time, and account for build time, warming, and reindexing.
Install it when you are tuning vector search or planning to scale it. For a small index with no latency or memory pressure, the extra guidance may be unnecessary.
What it helps with
- choose an index type for a given vector count
- tune HNSW for a recall and speed tradeoff
- reduce vector memory with a quantization strategy
- check build time, warming, and reindexing costs
- plan vector search for billions of vectors
Example prompts for the agent
- Tune the HNSW parameters for these real queries and explain the recall and latency tradeoffs.
- Compare FP16, INT8, and Product Quantization for this vector index.
- Review this vector search scaling plan, including warming and reindexing.
How to install vector-index-tuning
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install llm-application-dev@claude-code-workflowsThis installs the whole llm-application-dev plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill vector-index-tuning -a claude-code3Manually: put the files in place
~/.claude/skills/vector-index-tuning/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vector-index-tuning/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill vector-index-tuning -a codex2Manually: put the files in place
.agents/skills/vector-index-tuning/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill vector-index-tuning -a cursor2Manually: put the files in place
.cursor/skills/vector-index-tuning/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents vector-index-tuning2Manually: put the files in place
.github/skills/vector-index-tuning/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/llm-application-dev/skills/vector-index-tuningManually: put the files in place
.devin/skills/vector-index-tuning/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about vector-index-tuning
How do I install vector-index-tuning in Claude Code?
Run npx skills add wshobson/agents --skill vector-index-tuning -a claude-code. The skill file is placed at ~/.claude/skills/vector-index-tuning/SKILL.md.
What does vector-index-tuning do?
It guides index selection and tuning for HNSW, quantization, memory, latency, and recall. It also covers checks for scaling, warming, and reindexing.
Which HNSW parameters does the skill cover?
It covers M, efConstruction, and efSearch. These affect recall, memory use, index build quality, and search latency.
Source text
SKILL.md · MIT
--- name: vector-index-tuning description: Optimize vector index performance for latency, recall, and memory. Use when tuning HNSW parameters, selecting quantization strategies, or scaling vector search infrastructure. --- # 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
© Seth Hobson · MIT · wshobson/agents