Skip to content
ArticleBeginner

Build a Retrieval Augmented Generation (RAG) AI

Build your first retrieval-augmented generation (RAG) app on Cloudflare with Workers AI, Vectorize, D1 and Workflows.

Last updated
Nov 19, 2026
Read the original

Build a fully featured AI app: notes are stored in D1, embedded with Workers AI and indexed in Vectorize, and questions are answered by retrieving the most relevant notes. A Workflow handles indexing new notes, and you can optionally swap in an Anthropic Claude model. (For a fully managed alternative, see AI Search.)

What you’ll learn

  • Add the Workers AI binding
  • Store embeddings with D1 and Vectorize
  • Index notes with a Workflow
  • Query Vectorize and answer with an LLM

Cloudflare products used

Workers AI, Vectorize, D1, Workflows.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

Keep learning