The outcome

Operate a compact edge RAG service whose vector configuration, sources, access rules, and refresh lifecycle are controlled.

Cloudflare Workers AI is a serverless GPU inference platform for running AI models on Cloudflare's global network. Running open-source text, embedding, image, speech, and classification models in serverless Workers and combining them with AI Gateway and Vectorize. This guide narrows that broad capability into one repeatable outcome, with checkpoints that keep the source material and your judgment in the loop.

Before you begin

Set the boundary before the tool starts.

Choose one real task, identify who will use the result, and decide what evidence or test will make the result acceptable. Gather only the source material needed for that task. If the work contains confidential, personal, regulated, or client-owned information, confirm that the platform and account are approved before sharing it.

Troiana principle

AI should make the work easier to inspect. If the workflow removes the source, the owner, or the review step, redesign the workflow.

Step by step

A workflow you can repeat.

  1. 01

    Define corpus ownership, permissions, update and deletion rules, benchmark queries, source citations, and the approved Worker and storage boundaries.

  2. 02

    Choose an embedding model, dimensions, distance metric, namespaces, and metadata schema before creating separate development and production indexes.

  3. 03

    Chunk approved documents, create stable vector IDs linked to source objects, generate embeddings, and upsert records with minimal searchable metadata.

  4. 04

    Embed queries with the same model, apply namespace and metadata filters, retrieve candidates, and pass only verified context to generation.

  5. 05

    Evaluate recall and answer support, handle asynchronous index updates, test deletion and model migration, and monitor query latency and inference spend.

Working standard

What good use looks like.

  • Fix dimensions and metric deliberately.
  • Map every vector to a source object.
  • Test asynchronous updates and deletions.

Serverless inference can still expose sensitive inputs, unsafe outputs, public endpoints, logs, and unbounded cost. Protect bindings and tokens, authenticate and validate Workers, pin and benchmark model IDs, understand model licenses and limits, minimize logs and caching for sensitive data, set AI Gateway rate and spend controls, make retries safe, and preserve source identity and access rules in Vectorize.

Official references

Check the current product documentation.

Features, plan limits, availability, and data controls change. These official pages are the starting points used for this collection.