Cloudflare Vectorize icon

Cloudflare Vectorize

Execute operations against Cloudflare Vectorize vector databases. Supports vector operations (insert, upsert, query), index management, metadata filtering, and can be used as a tool by AI Agents for semantic search and RAG applications.

Vector → Upsert

AI-generated

Overview

The Cloudflare Vectorize node enables interaction with Cloudflare's vector database service, focusing on operations related to vector data and indexes. Specifically, the Vector Upsert operation allows users to insert new vectors or update existing ones within a specified vector index. This is useful for maintaining an up-to-date semantic search index or embedding store where vector representations of data (e.g., text embeddings) need to be added or refreshed.

Common scenarios include:

  • Adding new document embeddings to a semantic search index.
  • Updating existing vectors when the underlying data changes.
  • Managing vector data in applications like recommendation systems, AI agents, or retrieval-augmented generation (RAG).

Example: You have a collection of product descriptions converted into vectors. When new products are added or existing descriptions updated, you use this node to upsert those vectors into your Cloudflare Vectorize index, ensuring your search results stay relevant.

Properties

Name Meaning
Index Name The name of the target vector index. Must be lowercase and contain only letters, numbers, and hyphens.
Vectors JSON array of vector objects to insert or update. Each object must include:
- id (string): Unique identifier for the vector.
- values (number array): The vector values (embedding).
- metadata (optional object): Additional metadata associated with the vector.
- namespace (optional string): Namespace to logically group vectors within the index.

Output

The output JSON contains:

  • mutationId: A unique identifier for the upsert operation mutation.
  • vectorCount: The number of vectors successfully upserted.

This confirms that the vectors were inserted or updated in the index. No binary data is output by this operation.

Example output JSON:

{
  "mutationId": "abc123xyz",
  "vectorCount": 3
}

Dependencies

  • Requires an API key credential for authenticating with the Cloudflare Vectorize service.
  • The node depends on internal utility functions (CloudflareVectorizeUtils) to handle API requests.
  • The user must configure the node with a valid Cloudflare Vectorize API connection.

Troubleshooting

  • Invalid Index Name: Ensure the index name is lowercase and contains only letters, numbers, and hyphens. Otherwise, the API may reject the request.
  • Malformed Vectors JSON: The vectors property must be a valid JSON array with correctly structured vector objects. Parsing errors or missing required fields (id, values) will cause failures.
  • Dimension Mismatch: The vector dimensions must match the index configuration. Inserting vectors with incorrect dimensions will result in errors.
  • API Authentication Errors: Verify that the API key credential is correctly set up and has necessary permissions.
  • Partial Failures: If continueOnFail is enabled, failed items return error messages in the output; otherwise, execution stops on first error.

Links and References

Discussion