Skip to content

RAG on Cloudflare workers with PDF, URL , Text uploads for context

Notifications You must be signed in to change notification settings

dark-faze/cf-rag-with-uploads

Repository files navigation

CloudFlare RAG App with pdf, url, text imports

A functional RAG app using D1 , Vectorize , Queues .

Features

  • Import pdf , webpage data using a url
  • Import long texts
  • Supports big imports using queues

Installation

  1. Install packages
  npm install
  1. Create d1, queue, vectorize
  npx wrangler d1 create <db_name>
  npx wrangler create queue <queue_name>
  npx wrangler vectorize create <index_name> --preset @cf/baai/bge-base-en-v1.5

( Update the values like id and name in wrangler.toml ) (Note : Don't change the bindings)

  1. Create a table in the D1 database
npx wrangler d1 execute <db_name> --command "CREATE TABLE IF NOT EXISTS texts (id INTEGER PRIMARY KEY, text TEXT NOT NULL)"
  1. Deploy (This won't work on local because queues and vectorize is not supported)
npx wrangler deploy --minify

About

RAG on Cloudflare workers with PDF, URL , Text uploads for context

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published