Practical overview
When it fits
Use the repository as a reference when building or adapting a PDF-chat RAG application with Cloudflare services, especially when hybrid retrieval and streamed responses are part of the design.
Who it is for
- Developers building a PDF question-answering application on Cloudflare.
- Teams exploring hybrid retrieval that combines full-text and vector search.
- Engineers comparing model-provider routing and fallback patterns for a RAG application.
Documented uses
- Ingest PDF text using OCR within a Cloudflare Worker.
- Retrieve document passages with both keyword and vector search.
- Combine search rankings and pass relevant context to a language model.
- Stream generated answers to a web interface.
- Route model requests through AI Gateway to supported providers, with Workers AI fallback.
Requirements & limits
The repository is public and licensed under the MIT License. The README documents a hosted demo and local development and Cloudflare Pages deployment paths.
- The retrieval pipeline generates five query variants, searches both D1 and Vectorize, merges the results with Reciprocal Rank Fusion, and supplies the top ten passages to the model.
- Cloudflare KV is used for per-IP rate limiting, while OCR runs in a Worker using unpdf.
- Local setup requires Node, pnpm, Wrangler, a Cloudflare account ID, and configured D1 and KV identifiers.
- OpenAI, Groq and Anthropic API keys are optional in local configuration because Workers AI is the documented fallback.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the local development environment
Prepare the Cloudflare Rag project and its documented local development configuration.
Before you start
- Node, pnpm and Wrangler CLI
- A Cloudflare account ID
- Cloudflare D1 and KV resources created by the setup script
Steps
Install dependencies with pnpm install or npm install.
Run ./setup.sh to deploy the required Cloudflare primitives.
Set the D1 database ID and KV rate-limiter namespace ID in wrangler.toml.
Create .dev.vars with CLOUDFLARE_ACCOUNT_ID; add provider keys if desired.
Start the development server with npm run dev and open http://localhost:5173/.
Expected outcome
The documented local development server is available at http://localhost:5173/.
Guide limitations
- The Cloudflare account ID is required.
- OpenAI, Groq and Anthropic keys are optional; the stream route falls back to Workers AI.
Compare options for Vector search
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Cloudflare Rag | Ingest PDF text using OCR within a Cloudflare Worker. | Cloud, Server, Web | The repository is public and licensed under the MIT License. The README documents a hosted demo and local development and Cloudflare Pages deployment paths. |
| Chatbot with PDF for Semantic Search | Prepare document content as embeddings and save it to a supported vector database. | Web | The repository is identified as open source and publicly visible on GitHub. |
| AI LLM Playground | Ask questions about PDF documents through an assistant interface. | Web |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- RafalWilinski/cloudflare-rag · Official homepage title · retained in its source language

