← 开源
RafalWilinski

cloudflare-rag

Fullstack "Chat with your PDFs" RAG (Retrieval Augmented Generation) app built fully on Cloudflare

ApplicationsResearch & knowledgeTypeScript
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
606
Star
93
Fork
+0
本周
2
贡献者
创建于 2024-08-26 · 更新于 2026-10-01 · 今日第 16198 名
主要开发者

RafalWilinski/cloudflare-rag 排名第 16,198,有 606 个星标。

同类别比较

RafalWilinski/cloudflare-rag 排名第 16,198,此处有 8 个同类条目;CharlesPikachu/AIGames 排名第 16,195。

同类别比较
名称排名指标
zhang17173/Event-Extraction16,185
语言:
Python
星标数:
608
分叉数:
132
简介:
基于法律裁判文书的事件抽取及其应用,包括数据的分词、词性标注、命名实体识别、事件要素抽取和判决结果预测等内容
aryn-ai/sycamore16,191
语言:
Python
星标数:
607
分叉数:
71
简介:
🍁 Sycamore is an LLM-powered search and analytics platform for unstructured data.
yanx27/EverybodyDanceNow_reproduce_pytorch16,194
语言:
Python
星标数:
607
分叉数:
172
简介:
Everybody dance now reproduced in pytorch
CharlesPikachu/AIGames16,195
语言:
Python
星标数:
606
分叉数:
187
简介:
use AI to play some games.
minghao-wu/transagents16,221
星标数:
605
分叉数:
29
简介:
The official repository of the paper "(Perhaps) Beyond Human Translation: Harnessing Multi-Agent Collaboration for Translating Ultra-Long Literary Texts"
jackson-video-resources/claude-tradingview-mcp-trading16,229
语言:
JavaScript
星标数:
604
分叉数:
302
简介:
Connect Claude Code to TradingView and execute trades automatically via BitGet
mckaywrigley/repo-chat16,232
语言:
Python
星标数:
604
分叉数:
104
wexare-ai/openbrowserclaw16,234
语言:
TypeScript
星标数:
604
分叉数:
83
简介:
Browser-native personal AI assistant. Zero infrastructure, the browser is the server.
关键参数与规格
关键参数与规格
参数值
语言TypeScript
类别Applications
子类别Research & knowledge
关键词RAG, Talk-to-your-docs
星标数606
分叉数93
贡献者2
创建日期2024-08-26
更新日期2026-10-01
1 天星标数0
7 天星标数0
排名16,198
上次排名15,988
排名变化-210
7 天星标排名15,399
上次 7 天星标排名15,407
7 天星标排名变化8
总星标排名16,658
上次总星标排名16,631
总星标排名变化-27
国家Poland
README 摘录

Fullstack Cloudflare RAG This is a fullstack example of how to build a RAG (Retrieval Augmented Generation) app with Cloudflare. It uses Cloudflare Workers, Pages, D1, KV, R2, AI Gateway and Workers AI. Demo Features: Every interaction is streamed to the UI using Server-Sent Events Hybrid RAG using Full-Text Search on D1 and Vector Search on Vectorize Switchable between various providers (OpenAI, Groq, Anthropic) using AI Gateway with fallbacks Per-IP Rate limiting using Cloudflare's KV OCR is

running inside Cloudflare Worker using unpdf Smart Placement automatically places your workloads in an optimal location that minimizes latency and speeds up your applications Development Make sure you have Node, pnpm and wrangler CLI installed. Install dependencies: Deploy necessary primitives: Then, in , set the to your D1 database id and to your rate limiter KV namespace id. Then, create a file with your API keys: If you don't have these keys, will fallback to Workers AI. Run the dev server

: And access the app at . Deployment Having the necessary primitives setup, first setup secrets: Then, deploy your app to Cloudflare Pages: Hybrid Search RAG This project uses a combination of classical Full Text Search (sparse) against Cloudflare D1 and Hybrid Search with embeddings against Vectorize (dense) to provide the best of both worlds providing the most applicable context to the LLM. We take user input and we rewrite it to 5 different queries using an LLM 2. We run each

of these queries against our both datastores - D1 database using BM25 for full-text search and Vectorize for dense retrieval 3. We take the results from both datastores and we merge them together using Reciprocal Rank Fusion which provides us with a single list of results 4. We then take the top 10 results from this list and we pass them to the LLM to generate a response License This project is licensed under the terms of the MIT License

. Consulting If you need help in building AI applications, please reach out to me on Twitter or via my website.

常见问题

记录了多少星标和分叉?

RafalWilinski/cloudflare-rag 有 606 个星标和 93 个分叉。

仓库排名是多少?

RafalWilinski/cloudflare-rag 排名第 16,198。

记录的语言和类别是什么?

RafalWilinski/cloudflare-rag 有 606 个星标,语言为 TypeScript,类别为 Applications。

哪个仓库排名最接近?

RafalWilinski/cloudflare-rag 与 CharlesPikachu/AIGames 比较,后者排名第 16,195,有 606 个星标。

README

Fullstack Cloudflare RAG

This is a fullstack example of how to build a RAG (Retrieval Augmented Generation) app with Cloudflare. It uses Cloudflare Workers, Pages, D1, KV, R2, AI Gateway and Workers AI.

https://github.com/user-attachments/assets/cbaa0380-7ad6-448d-ad44-e83772a9cf3f

Demo

Features:

  • Every interaction is streamed to the UI using Server-Sent Events
  • Hybrid RAG using Full-Text Search on D1 and Vector Search on Vectorize
  • Switchable between various providers (OpenAI, Groq, Anthropic) using AI Gateway with fallbacks
  • Per-IP Rate limiting using Cloudflare's KV
  • OCR is running inside Cloudflare Worker using unpdf
  • Smart Placement automatically places your workloads in an optimal location that minimizes latency and speeds up your applications

Development

Make sure you have Node, pnpm and wrangler CLI installed.

Install dependencies:

pnpm install # or npm install

Deploy necessary primitives:

./setup.sh

Then, in wrangler.toml, set the d1_databases.database_id to your D1 database id and kv_namespaces.rate_limiter to your rate limiter KV namespace id.

Then, create a .dev.vars file with your API keys:

CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id # Required
GROQ_API_KEY=your-groq-api-key # Optional
OPENAI_API_KEY=your-openai-api-key # Optional
ANTHROPIC_API_KEY=your-anthropic-api-key # Optional

If you don't have these keys, /api/stream will fallback to Workers AI.

Run the dev server:

npm run dev

And access the app at http://localhost:5173/.

Deployment

Having the necessary primitives setup, first setup secrets:

npx wrangler secret put CLOUDFLARE_ACCOUNT_ID
npx wrangler secret put GROQ_API_KEY
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put ANTHROPIC_API_KEY

Then, deploy your app to Cloudflare Pages:

npm run deploy

Hybrid Search RAG

This project uses a combination of classical Full Text Search (sparse) against Cloudflare D1 and Hybrid Search with embeddings against Vectorize (dense) to provide the best of both worlds providing the most applicable context to the LLM.

The way it works is this:

  1. We take user input and we rewrite it to 5 different queries using an LLM
  2. We run each of these queries against our both datastores - D1 database using BM25 for full-text search and Vectorize for dense retrieval
  3. We take the results from both datastores and we merge them together using Reciprocal Rank Fusion which provides us with a single list of results
  4. We then take the top 10 results from this list and we pass them to the LLM to generate a response

License

This project is licensed under the terms of the MIT License.

Consulting

If you need help in building AI applications, please reach out to me on Twitter or via my website. Happy to help!

排名相邻
同类项目