This example shows how to build a very simple Vectorized document retrieval system using Cloudflare's Vectorize service and Python workers.
Note: This example uses remote Workers AI and Vectorize resources, which are billable, even in local development.
npx wrangler login
# Select the intended account if Wrangler prompts for one.
npx wrangler vectorize create python-rag-index --dimensions=768 --metric=cosine
uv run pywrangler devcurl -X POST http://localhost:8787/seedSeed the four-document to the Vectorize index.
curl -X POST http://localhost:8787/query \
-H 'content-type: application/json' \
--data '{"question":"What does Vectorize store?"}'GET /describes the setup and models.POST /seedembeds and upserts the documents.POST /queryaccepts{"question":"..."}and returns a groundedanswerplus match IDs, titles, scores, and citations.