Full-stack RAG Q&A System — Retrieval-Augmented Generation powered by React 19 + NestJS
OpenAI-compatible APIs (OpenAI, DeepSeek, Claude) + Google Gemini native SDK with configurable LLM, Embedding, and Rerank models.
Fast Mode via Apache Tika for text extraction, and High-Precision Mode via Vision Pipeline for mixed image/text documents.
Vector + keyword search with Elasticsearch, source citation, similarity scoring, and configurable chunk size & overlap.
JWT authentication with per-user knowledge bases. Each user has isolated data and configurations.
Real-time streaming via Server-Sent Events (SSE) for smooth, low-latency chat interactions.
Interface supports Japanese, Chinese, and English with full internationalization for error and API response messages.
Quick text extraction, no API cost
Preserves layout, charts, and images
| Service | Port | Purpose |
|---|---|---|
| Elasticsearch | 9200 | Vector storage & hybrid search |
| Apache Tika | 9998 | Document text extraction |
| LibreOffice Server | 8100 | Document format conversion |
| Backend API | 3001 | NestJS REST API |
| Frontend (dev) | 13001 | Vite dev server |
| Frontend (prod) | 80 / 443 | Nginx reverse proxy |
Key environment variables in server/.env
| Variable | Default | Description |
|---|---|---|
| OPENAI_API_KEY | — | OpenAI-compatible API key |
| GEMINI_API_KEY | — | Google Gemini API key |
| ELASTICSEARCH_HOST | http://localhost:9200 | Elasticsearch URL |
| TIKA_HOST | http://localhost:9998 | Apache Tika URL |
| LIBREOFFICE_URL | http://localhost:8100 | LibreOffice server URL |
| JWT_SECRET | — | JWT signing secret |
cd server && yarn formatcd server && yarn lintserver/src/*.spec.ts filesweb/components/web/types.tsweb/services/Check memory limits in docker-compose.yml
Ensure uploads/ and temp/ directories exist with proper permissions
Verify LibreOffice server is running and accessible at port 8100
Check environment variables in server/.env
Delete server/data/metadata.db and Elasticsearch data volume