This is an example implementation showing how to use DocuRAG.js with Express and Server-Sent Events (SSE).
- PDF file upload and processing
- Real-time chat with streaming responses
- Beautiful UI with drag & drop
- PDF preview
- Source citations
- Node.js 18+
- Docker (for Qdrant)
- Ollama with Llama2
- Start the required services:
# Start Qdrant
docker run -p 6333:6333 qdrant/qdrant
# Start Ollama with Llama2
ollama run llama2- Install dependencies:
cd examples/express
npm install- Run the server:
npm start- Open your browser:
http://localhost:3000
POST /upload- Upload and process a PDF filePOST /chat- Chat with the processed document (SSE)POST /cleanup- Clean up resources
- Drag and drop PDF upload
- Real-time chat interface
- PDF preview panel
- Source citation display
- Error handling and loading states
- File type validation (PDF only)
- File size limits (10MB)
- CORS enabled
- Sanitized error responses