---
name: ajuste-indice-vectorial
description: Guia tecnica para optimizar indices vectoriales en produccion, cubriendo seleccion de tipo de indice, parametros HNSW, estrategias de cuantizacion y escalado a miles de millones de vectores. Ideal para ingenieros que construyen sistemas RAG o busqueda semantica de alto rendimiento.
license: MIT
metadata:
  id: 11043d3b
  slug: ajuste-indice-vectorial
  titulo: "Ajuste de Índice Vectorial"
  servicio: IA-Ingenieria-MLOps
  categoria_recurso: Inspiracion-Formacion
  tipo: referencia
  nivel: avanzado
  idioma: es
  idioma_original: en
  acceso: gratis
  precio_eur: 0
  plataformas: [Pinecone, Weaviate, Qdrant, pgvector, Faiss, DiskANN]
  dependencias: []
  licencia: { spdx: MIT, redistribuible: true, uso_comercial: true }
  fuente:
    repo: wshobson/agents
    url: https://github.com/wshobson/agents/tree/main/plugins/llm-application-dev/skills/vector-index-tuning
    commit: cc37bfd
    autor: wshobson
    nombre_original: vector-index-tuning
    duplicados_en: []
  seguridad: { veredicto: seguro, riesgo: bajo, escaneado: "2026-06-14", motor: "grep-estatico+auditor-llm" }
  ficha:
    que_hace: "Optimiza el rendimiento de indices vectoriales equilibrando latencia, recall y uso de memoria en sistemas de busqueda semantica."
    como_lo_hace: "Proporciona tablas de decision para seleccion de indice segun volumen, parametros HNSW configurables y comparativa de tipos de cuantizacion con sus impactos en memoria."
  content_hash: "11043d3b57140a0d07c49098caa0756f70723d605341ac0c8e24d5edf79a5515"
  version: 1.0.0
---

# 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
