Vectorize
What it is
Vectorize is Cloudflare's vector database. You store embeddings — lists of numbers that capture the meaning of text, images, or other data — and query for the ones most similar to a given vector. It's the retrieval half of semantic search and retrieval-augmented generation (RAG), and 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.
- Serverless and globally available, scaling with your app.
Trade-offs
- It stores vectors and metadata, not your source documents — keep those in D1 or R2.
- 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 agent 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