vector-index-tuning
What it does
This tool helps make searches in large amounts of data (like images or text) faster and more efficient. It adjusts how this data is organized so the AI can find what you're looking for more accurately and quickly, using less memory.
When to use it
- βWhen you have a lot of data and searches are slow.
- βWhen trying to balance search speed with result accuracy.
- βWhen you need to reduce the memory used by data search.
Skill link
https://github.com/wshobson/agents/blob/main/plugins/llm-application-dev/skills/vector-index-tuning/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHow can I optimize the search for similar images to make it faster and use less memory?β
5 new skills a week. 1 minute to read.
How it works
The tool adjusts internal parameters that control how data is connected and stored. It can choose different organization methods (like HNSW or Quantization) depending on the data volume and your speed and accuracy goals.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
FAQ
What are 'HNSW parameters'?
These are settings that affect the speed and accuracy of searches in a specific data organization method called HNSW. Adjusting them can improve results.
What is 'quantization'?
It's a technique to reduce the space data takes up in memory, making searches faster and cheaper, sometimes with a small loss in accuracy.
What does 'recall vs speed' mean?
It's a common trade-off: increasing search speed might decrease the accuracy of results (recall), and vice versa. The tuning aims for the best balance for your needs.
Details
Original description by the author
Optimize vector index performance for latency, recall, and memory. Use when tuning HNSW parameters, selecting quantization strategies, or scaling vector search infrastructure.
repo: wshobson/agents
Popularity
- GitHub stars
- 41k
- Ranking position
- #6727
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
screen-reader-testing
41kHas your agent test websites using screen readers to ensure they are accessible.
wcag-audit-patterns
41kHelps your agent audit websites for accessibility and fix issues according to WCAG guidelines.
multi-reviewer-patterns
41kEnables your agent to coordinate parallel code reviews, deduplicating findings and consolidating reports.
parallel-debugging
41kAllows the agent to debug complex issues with parallel investigations and root cause analysis.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.