Skip to content

Changelog

2024-01-17

HTTP API query vectors request and response format change

Vectorize /query HTTP endpoint has the following changes:

  • returnVectors request body property is deprecated in favor of returnValues and returnMetadata properties.
  • Response format has changed to the below format to match [Workers API change]:(/workers/configuration/compatibility-dates/#vectorize-query-with-metadata-optionally-returned)
{
  "result": {
    "count": 1,
    "matches": [
      {
        "id": "4",
        "score": 0.789848214,
        "values": [ 75.0999984741211, 67.0999984741211, 29.899999618530273],
        "metadata": {
          "url": "/products/sku/418313",
          "streaming_platform": "netflix"
        }
      }
    ]
  },
  "errors": [],
  "messages": [],
  "success": true
}

2023-12-06

Metadata filtering

Vectorize now supports metadata filtering with equals ($eq) and not equals ($neq) operators. Metadata filtering limits query() results to only vectors that fulfill new filter property.

let metadataMatches = await env.YOUR_INDEX.query(queryVector,
  {
    topK: 3,
    filter: { streaming_platform: "netflix" },
    returnValues: true,
    returnMetadata: true
  })

Only new indexes created on or after 2023-12-06 support metadata filtering. Currently, there is no way to migrate previously created indexes to work with metadata filtering.

2023-11-08

Metadata API changes

Vectorize now supports distinct returnMetadata and returnValues arguments when querying an index, replacing the now-deprecated returnVectors argument. This allows you to return metadata without needing to return the vector values, reducing the amount of unnecessary data returned from a query. Both returnMetadata and returnValues default to false.

For example, to return only the metadata from a query, set returnMetadata: true.

let matches = await env.YOUR_INDEX.query(queryVector, { topK: 5, returnMetadata: true })

New Workers projects created on or after 2023-11-08 or that update the compatibility date for an existing project will use the new return type.

2023-10-03

Increased indexes per account limits

You can now create up to 100 Vectorize indexes per account. Read the limits documentation for details on other limits, many of which will increase during the beta period.

2023-09-27

Vectorize now in open beta

Vectorize, Cloudflare's vector database, is now in open beta. Vectorize allows you to store and efficiently query vector embeddings from AI/ML models from Workers AI, OpenAI, and other embeddings providers or machine-learning workflows.

To get started with Vectorize, see the guide.