You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 272b72c
Browse filesBrowse the repository at this point in the historyBrowse files
A fully containerized Document RAG demo with a dark-themed web UI. Upload documents, chat with your knowledge base.
3
+
A containerized document RAG demo: offline ingest into VortexDB, query via a FastAPI backend, and chat through a React frontend. Embeddings and LLM calls use [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) through the OpenAI-compatible API.
4
4
5
5
## Quick Start
6
6
7
7
```bash
8
-
# 1. Fill in your API key
8
+
# 1. Configure credentials
9
9
cp .env.example .env
10
-
#Edit .env and set OPENAI_API_KEY=sk-your-key-here
10
+
#Set OPENAI_API_KEY (Cloudflare API token) and ACCOUNT_ID
11
11
12
-
# 2. Build and start everything
12
+
# 2. Add documents to ingest
13
+
cp /path/to/your/files/* documents/
14
+
15
+
# 3. Start the stack (builds images, ingests docs, starts API + UI)
13
16
docker compose up -d --build
14
17
15
-
#3. Open browser
18
+
#4. Open the UI
16
19
open http://localhost:3035
17
20
```
18
21
19
-
That's it! No other setup required.
22
+
On startup, Docker will:
23
+
24
+
1. Start VortexDB and wait until healthy
25
+
2. Run ingest on `./documents` (TXT, MD, PDF, DOCX, CSV)
26
+
3. Start the backend API
27
+
4. Start the frontend
28
+
29
+
To re-ingest after adding or changing documents:
30
+
31
+
```bash
32
+
docker compose up ingest --force-recreate
33
+
docker compose up -d backend
34
+
```
20
35
21
-
## Features
36
+
## Ports
22
37
23
-
-**File Upload** - Drag & drop or browse documents (PDF, TXT, MD, DOCX, CSV)
24
-
-**Chat Interface** - Ask questions, get AI-powered answers
25
-
-**Fully Containerized** - VortexDB + Backend + Frontend in Docker
| POST |`/chat`|`{"query": "..."}`| RAG answer + sources |
61
+
| POST |`/query`|`{"query": "..."}`| Retrieval only (no LLM) |
62
+
63
+
Example:
64
+
65
+
```bash
66
+
curl -X POST http://localhost:8000/chat \
67
+
-H "Content-Type: application/json" \
68
+
-d '{"query": "What embedding model is used?"}'
38
69
```
39
70
40
71
## Configuration
41
72
42
-
### .env file
73
+
All settings live in `.env`. See `.env.example` for the full list.
43
74
44
75
```env
45
-
OPENAI_API_KEY=sk-your-api-key-here
46
-
VORTEXDB_HOST=vortexdb
47
-
VORTEXDB_PORT=3000
48
-
EMBEDDING_MODEL=text-embedding-3-small
49
-
LLM_MODEL=gpt-4o-mini
76
+
OPENAI_API_KEY=your-cloudflare-api-token
77
+
ACCOUNT_ID=your-account-id
78
+
79
+
EMBEDDING_MODEL=@cf/qwen/qwen3-embedding-0.6b
80
+
LLM_MODEL=@cf/openai/gpt-oss-20b
81
+
VECTOR_SIZE=1024
82
+
50
83
CHUNK_SIZE=512
51
84
CHUNK_OVERLAP=50
52
85
TOP_K=5
86
+
EMBEDDING_BATCH_SIZE=64
87
+
DOCS_DIRECTORY=./documents
88
+
```
89
+
90
+
Get credentials from the [Cloudflare dashboard](https://dash.cloudflare.com/) → Workers AI → **Use REST API**. The API token needs Workers AI read access. `VECTOR_SIZE` must match VortexDB's `DIMENSION` in `docker-compose.yml` (default `1024`).
91
+
92
+
Inside Docker Compose, `VORTEXDB_HOST` and `VORTEXDB_PORT` are overridden to `vortexdb:3000` automatically.
0 commit comments