Wikipedia RAG is a minimal retrieval-augmented generation prototype. The app lets you ingest any Wikipedia article, chunk and embed its content with OpenAI embeddings, and chat against the stored context. The frontend provides a simple two-step flow (ingest + chat) while the backend orchestrates the pipeline and keeps conversations in memory.
- Frontend: React 19, TypeScript, Vite, Material UI.
- Backend: Effect-based HTTP server running on Node 20.
- Embeddings & LLM: OpenAI SDK (text-embedding-3-small + chat completions).
- Experimental Runtime: Effect gives us structured concurrency, typed environments, and ergonomics for async workflows.
Prerequisites: Node 20, npm 10.
- Install dependencies:
cd frontend && npm install cd ../backend && npm install
- Start the dev servers:
cd frontend && npm run dev cd ../backend && npm run dev
- Provide env vars:
- Frontend:
VITE_API_BASE_URL(e.g., http://localhost:3001). - Backend:
OPENAI_API_KEYand optionalPORT.
- Frontend:
- Test ingestion by pasting a Wikipedia URL and watching logs on the backend.
- Backend unit tests (Vitest):
The suite covers ingestion helpers, pipeline happy-path / failure scenarios, and cosine similarity math.
cd backend npm install npm run test
- Export
OPENAI_API_KEY. - Run
./deploy_local.shto build and start docker compose with published ports (frontend on 3000, backend on 3001). - Visit http://localhost:3000.
- Set
OPENAI_API_KEYand optionallyVITE_API_BASE_URLin your environment. - Run
./deploy.shto sync files via rsync and rundocker compose up -d --buildon the remote host. - Traefik labels route frontend (rag.murdix.com) and API (api.rag.murdix.com).