wshobson avatar

Vector Index Tuning

Benchmarks HNSW parameters (M, efConstruction, efSearch) against your actual data to find the sweet spot between recall and latency. Implements scalar quantization, product quantization, and binary compression with memory usage estimates. The parameter tuning function runs systematic tests across different configurations and calculates recall@k, which beats guessing at settings. Also includes quantization strategies that can cut memory usage by 75% with minimal recall loss. Most useful when you're hitting memory limits or search latency SLAs with large vector datasets over 100K embeddings.

skills.sh installs
11K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill vector-index-tuning --agent claude-code

Installs into .claude/skills of the current project.

Files

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

ParameterDefaultEffect
M16Connections per node, ↑ = better recall, more memory
efConstruction100Build quality, ↑ = better index, slower build
efSearch50Search quality, ↑ = better recall, slower search

3. Quantization Types

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
AI & Agent Building, Debugging, Marketing & SEO, Cloud & Infrastructure

More from wshobson/agents

All 174
1rivet-dev avatarsandbox-agentrivet-dev/skillsDeploy, configure, and integrate Sandbox Agent - a universal API for orchestrating AI coding agents (Claude Code, Codex, OpenCode, Amp) in sandboxed environment10.7Kskills.sh installs
2google avataragent-platform-deploygoogle/skillsDeploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resourc9.8Kskills.sh installs
3mcp-use avatarmcp-buildermcp-use/mcp-useBuild, modify, debug, or review TypeScript MCP servers with mcp-use.9.6Kskills.sh installs
4google avataragent-platform-tuninggoogle/skillsAgent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outsi9.5Kskills.sh installs
5google avataragent-platform-tuning-managementgoogle/skillsManages GenAI tuning jobs in Agent Platform. Use this to list, get, or cancel ongoing model tuning jobs. Don't use for fine-tuning models (use `agent-platform-t9.4Kskills.sh installs
6google avataragent-platform-model-registrygoogle/skillsAgent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Age9.3Kskills.sh installs