The official repository of the paper "(Perhaps) Beyond Human Translation: Harnessing Multi-Agent Collaboration for Translating Ultra-Long Literary Texts"
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.
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.
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:
We take user input and we rewrite it to 5 different queries using an LLM
We run each of these queries against our both datastores - D1 database using BM25 for full-text search and Vectorize for dense retrieval
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
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!