Collections API

Collections API

Create, configure, and manage vector collections with flexible schema definitions.

Create Collection

POST
/api/v1/collections

Schema Configuration

Define the structure and properties of your vector collection:

{
  "name": "my_collection",
  "schema": {
    "fields": [
      {
        "name": "id",
        "type": "int64",
        "is_primary": true
      },
      {
        "name": "vector",
        "type": "float_vector",
        "dimension": 512
      },
      {
        "name": "metadata",
        "type": "json"
      }
    ]
  },
  "index_params": {
    "metric_type": "L2",
    "index_type": "HNSW",
    "params": {
      "M": 16,
      "efConstruction": 200
    }
  }
}

Performance Optimization

  • Choose the right index: HNSW for high accuracy, IVF for memory efficiency
  • Optimize dimensions: Higher dimensions provide more precision but slower queries
  • Batch operations: Insert vectors in batches for better throughput