Vectorize
Cloudflare’s serverless vector database for Workers, which stores embeddings in R2-backed indexes and bills only for vector dimensions stored and queried.
- What it is
- Vector databases
- Type
- Commercial product
- Made by
- Cloudflare, Inc.
- License
- Proprietary
- Facts checked
- 12 October 2026
What it is
You create an index with a fixed number of dimensions (up to 1,536, as 32-bit floats) and a fixed distance metric (cosine, euclidean or dot-product), neither of which can change later. Workers insert and query through a binding; embeddings can come from Workers AI, for example @cf/baai/bge-base-en-v1.5 with 768 dimensions, or from any other model. An index holds up to 20 million vectors. Under the hood the index files live in R2 and are read through Cloudflare’s cache; Vectorize clusters vectors with an inverted file index (IVF) and compresses them with product quantization, so a query scans only the clusters nearest to it.
Each vector can carry up to 10 KiB of JSON metadata and belong to one namespace. To filter on a metadata field you first create a metadata index for it (up to 10 per index, on string, number or boolean fields). The filter is applied before the top-K search, and supports $eq, $ne, $in, $nin and ranges, which also gives prefix matching on strings. Writes go through a write-ahead log and are applied asynchronously, so new vectors show up in queries after a short delay. Pricing counts dimensions: the paid plan includes 50 million queried and 10 million stored dimensions a month, then $0.01 per million queried and $0.05 per 100 million stored, with no charge for idle indexes.
Why teams pick it
- No servers, CPU or “active index hours” to pay for, and Cloudflare’s own example of 50,000 768-dimension vectors queried 200,000 times a month comes to $1.94
- A Workers binding next to Workers AI, so embedding, storing and searching fit in one Worker
- Metadata filtering is applied before the nearest-neighbor search, with namespaces for cheap per-tenant isolation
- Up to 20 million vectors per index and 50,000 indexes per account on the paid plan
Watch out for
- At most 1,536 dimensions, and dimensions and metric are fixed at creation, so changing embedding models means a new index
- Eventually consistent: writes are applied asynchronously, so a vector may not appear in queries right after an upsert
- Filtering needs a metadata index created before the vectors are inserted, only the first 64 bytes of a string are indexed, and range filters over about 10 million vectors may lose accuracy
- Returns at most 50 results with values or metadata (100 without)
Alternatives
What all vector databases have in common →
ChromaOpen sourceAn open-source vector database for AI apps that runs inside a Python or JavaScript process, as a single server, or as a distributed service on object storage.
PineconeCommercialA managed, serverless vector database that keeps its indexes in object storage and serves dense-vector, sparse-vector and BM25 full-text search from the same index.How it fits with other technologies
Embed a question with Workers AI and search only one platform’s items · ts
// npx wrangler vectorize create catalog --dimensions=768 --metric=cosine
// npx wrangler vectorize create-metadata-index catalog --property-name=streaming_platform --type=string
export default {
async fetch(request, env): Promise<Response> {
const question = new URL(request.url).searchParams.get("q") ?? "";
// bge-base-en-v1.5 returns 768-dimension vectors, matching the index
const { data } = await env.AI.run("@cf/baai/bge-base-en-v1.5", { text: [question] });
const { matches } = await env.VECTORIZE.query(data[0], {
topK: 5,
filter: { streaming_platform: { $in: ["netflix", "hbo"] } },
returnMetadata: "all",
});
return Response.json(matches.map(m => ({ id: m.id, score: m.score, url: m.metadata?.url })));
},
} satisfies ExportedHandler<{ AI: Ai; VECTORIZE: Vectorize }>;See it in a real stack
No architecture uses Vectorize yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2023–2024
Language models only know what they were trained on. To answer questions about your own documents, an app embeds them as vectors and, for each query, finds the nearest ones to pass to the model as context. Cloudflare’s launch post described doing that without a vector database, by sending its whole 2.1 GB docs dataset along with every query, as impractical.
Vectorize launched in open beta on 27 September 2023, alongside Workers AI and AI Gateway, so that the whole retrieval loop could run in Workers. The first version was limited to 200,000 vectors per index and 20 results per query.
For general availability on 26 September 2024 Cloudflare rebuilt it: indexes of up to 5 million vectors, median query latency down from 500 ms to 30 ms, up to 100 results, and query prices cut by 75% and storage by 98%. A follow-up post in October 2024 described the new design on R2, Cloudflare’s cache, Durable Objects and its container platform. The vector limit per index has since grown to 20 million.
Why it’s built this way
- Index files in R2, read through the cache
- Storing indexes as objects lets any Cloudflare data center serve queries without dedicated database servers, and reading through the cache keeps hot index files close to the compute.
- IVF clustering with product quantization
- To search multi-million-vector indexes within the CPU, memory and I/O of shared servers, Vectorize prunes the search to the nearest clusters and compresses vectors, then refines the best candidates.
- A write-ahead log in a Durable Object
- A single coordinator applies writes in strict order and commits each new index version atomically, while heavier executors rewrite the index files, so queries always read a consistent snapshot.
Timeline
- 2023
Open beta on 27 September, with Workers AI and AI Gateway
- 2024
Rebuilt and generally available on 26 September: 5 million vectors per index, 30 ms median queries
- 2024
Cloudflare publishes the new design on R2, Durable Objects and containers on 22 October
- 2024
Legacy V1 indexes can no longer be created after December
- Cloudflare blog: Vectorize, a vector database for shipping AI-powered applications to production, fast (27 September 2023)
- Cloudflare blog: Cloudflare’s bigger, better, faster AI platform, including Vectorize GA (26 September 2024)
- Cloudflare blog: Building Vectorize, a distributed vector database, on Cloudflare’s Developer Platform (22 October 2024)
- Vectorize docs: Limits (current and legacy V1)
- Vectorize docs: Metadata filtering (legacy V1 index note)
Sources6 · facts checked 12 October 2026
- Vectorize docs: Limits
- Vectorize docs: Pricing
- Vectorize docs: Metadata filtering
- Vectorize docs: Create indexes (dimensions and distance metrics)
- Vectorize docs: Vectorize and Workers AI (embeddings tutorial)
- Cloudflare blog: Building Vectorize, a distributed vector database, on Cloudflare’s Developer Platform (22 October 2024)