Vector Index Tuning

Use when tuning vector search latency, recall, memory, index build time, quantization, or scaling strategy.

9 stars 3 forksProductivity & Notes

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sandbaseai/workbuddy-skill --skill vector-index-tuning
Manual install
git clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/vector-index-tuning ~/.claude/skills/vector-index-tuning

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Vector Index Tuning

在召回、延迟、内存、构建和更新成本之间做可测取舍。索引类型和参数没有通用最优值;先锁定查询分布、向量维度、过滤条件、更新频率、租户/删除语义和 SLO,再用固定数据和查询集做基线。

## 使用边界

- 开始前确认 embedding 模型/维度/版本、索引实现、数据量、字段过滤、硬件、数据区域、owner、SLO 和预算。
- 默认只读检查索引配置、查询 trace、召回标注、内存/CPU、构建日志和版本 manifest;基准使用合成、脱敏或授权语料。
- 不擅自重建/删除生产索引、切换 embedding、改变租户过滤、扩容或修改副本;生产变化必须有授权、双写/回滚和删除证明。
- 向量 metadata、query、路径和结果可能含敏感信息;日志只保留哈希、聚合分布和不可逆的样本标识。

## 基线与指标

固定索引版本、数据快照、查询集、过滤条件、并发、warm/cold 状态和硬件,记录 Recall@k、MRR/nDCG、过滤后召回、p50/p95/p99 延迟、QPS、内存、CPU、构建时间、更新/删除延迟和成本。区分近似搜索的召回损失、网络/序列化耗时、过滤耗时和重排耗时。

查询集要覆盖精确术语、短 query、长 query、多语言、空/无结果、热门向量、租户过滤、时间范围、删除后查询和分布漂移。没有标注或可靠的 exact-search 对照时,只能报告相对趋势,不能声称召回保持不变。

## 索引与参数选择

小数据集先用 flat/exact 作为质量基线;规模扩大后再比较 HNSW、IVF/PQ、DiskANN 或 provider-specific 索引。HNSW 的 `M`、`efConstruction` 和 `efSearch` 通常分别影响内存/构建质量/查询质量,但参数必须在目标硬件和过滤模式下实测。IVF 的分桶数、探测数和 PQ 压缩也需与向量分布、更新模式共同评估。

```python
def benchmark(config, queries, exact_reference):
    index = build_index(config)
    results = search_all(index, queries)
    return {
        "recall_at_k": recall(results, exact_reference),
        "p95_ms": percentile(results.latencies_ms, 95),
        "memory_mb": index.memory_mb,
        "build_seconds": index.build_seconds,
        "config": config,
    }
```

只改一个主要变量,固定其他条件并重复运行;将参数、库/硬件版本和随机种子写入 manifest。先以默认值建立对照,再按 SLO 排序实验,不要仅因内存下降就接受不可接受的召回、删除延迟或过滤错误。

## 量化、过滤与生命周期

比较 FP32、FP16、INT8、PQ 或 binary 时验证距离近似、语言/领域差异、尾部 query、重排需求和模型版本兼容性。量化索引保留少量高精度重排候选可能改善质量,但增加延迟和成本;所有取舍必须有分层结果。
Read the full skill on GitHub

Details

Skill name
vector-index-tuning
Path
skills/vector-index-tuning/SKILL.md
License
MIT
Repo updated
8 September 2026

FAQ

What does the Vector Index Tuning skill do?

Use when tuning vector search latency, recall, memory, index build time, quantization, or scaling strategy.

How do I install the Vector Index Tuning skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill vector-index-tuning. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Vector Index Tuning popular?

It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.

Related skills

Browse the most popular Claude skills, all productivity & notes skills, or write your own with the skills generator.