---
name: "milvus-distributed-vector-indexing"
description: "Scale billion-scale similarity search with Milvus distributed vector database clusters."
metadata:
  author: "Milvus"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create milvus collection"
  - "build milvus hnsw index"
  - "query milvus vector similarity"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Milvus Distributed Vector Indexing & Search

Architects Milvus vector collections: configuring HNSW, IVF_PQ, and SCANN indexing, scalar filtering with expressions, dynamic schemas, partition keys, and tuning search consistency levels.

## When to Invoke
Invoke this skill whenever you need to:
- create milvus collection
- build milvus hnsw index
- query milvus vector similarity

## Execution SOP & Rules
1. Connect using pymilvus: connections.connect('default', host='localhost', port='19530').
2. Create CollectionSchema with auto_id=True and DataType.FLOAT_VECTOR field.
3. Create index: collection.create_index(field_name='vector', index_params={'metric_type': 'COSINE', 'index_type': 'HNSW'}).
4. Call collection.load() into memory before executing collection.search() queries.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
