A functional RAG app using D1 , Vectorize , Queues .
- Import pdf , webpage data using a url
- Import long texts
- Supports big imports using queues
- Install packages
npm install
- 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)
- 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)"
- Deploy (This won't work on local because queues and vectorize is not supported)
npx wrangler deploy --minify