Vectorize
What it is
Imagine giving every photo, sentence, or song a set of coordinates so that similar things sit close together on a map — then "find me more like this" just means "find the nearest points." Vectorize is Cloudflare's vector , a store built for exactly that. You save embeddings — lists of numbers that capture the meaning of text, images, or other data — and ask for the ones most similar to a given list. It's the retrieval (finding) half of semantic search and RAG (Retrieval-Augmented Generation — feeding an AI relevant facts it can quote from). It binds directly into a Worker alongside Workers AI, which can produce the embeddings.
Strengths
- Purpose-built for similarity search over embeddings, with fast nearest-neighbor queries.
- Binds straight into Workers; no separate vector service to run.
- Pairs cleanly with Workers AI for an end-to-end RAG pipeline on Cloudflare.
- Supports metadata filtering so you can scope results.
- and globally available, scaling with your app.
Trade-offs
- It stores vectors and metadata, not your source documents — keep those in D1 (a database) or R2 (file storage).
- You must generate embeddings yourself (e.g. via Workers AI) before inserting.
- Index dimensions and the distance metric are fixed at creation — choose carefully.
- It's a specialized store, not a general database.
When to use it
Use Vectorize for semantic search, recommendations, deduplication, and the retrieval step of RAG — any time "find the things most similar to this" beats an exact keyword match.
Vibe coding fit
Vectorize lets an build a full RAG feature without leaving Cloudflare: Workers AI makes the embeddings, Vectorize stores and searches them, and D1 or R2 holds the originals. Tell the agent the embedding model up front, because the index dimensions must match that model's output. The example creates an index and binds it.
# wrangler.toml
[[vectorize]]
binding = "VECTORIZE"
index_name = "docs-index"
# Dimensions must match your embedding model's output
npx wrangler vectorize create docs-index --dimensions=768 --metric=cosine