I3K-IT
RAG-Enterprise
Python

๐Ÿš€ 100% local RAG system with one-command setup. Your data never leaves your server. AGPL-3.0

Last updated Jul 11, 2026
57
Stars
10
Forks
0
Issues
0
Stars/day
Attention Score
57
Language breakdown
Python 58.4%
JavaScript 25.7%
Shell 14.4%
Dockerfile 0.8%
CSS 0.5%
HTML 0.2%
โ–ธ Files click to expand
README

RAG Enterprise - Local RAG System

100% local Retrieval-Augmented Generation (RAG) system for businesses that need complete data privacy and control.

License: AGPL-3.0 Python 3.10+ Docker PRs Welcome DOI

One command. Full RAG system. Your data stays yours.

Why RAG Enterprise?

  • โœ… 100% Local: No data leaves your infrastructure
  • ๐Ÿš€ One-Command Setup: Automated installation script (~1 hour / ~15 min with fast connection)
  • ๐Ÿค– Modern LLMs: Qwen3, Mistral 7B (Q4 quantized)
  • ๐Ÿ” Multi-user Auth: JWT-based with role-based access control
  • ๐Ÿ’พ Backup & Restore: Full system backup with 70+ cloud providers via rclone
  • ๐Ÿ“Š Production-Ready: Designed for 10,000+ documents
  • ๐ŸŒ Multilingual: Supports 29 languages
  • ๐ŸŽจ Clean UI: Modern React interface
  • ๐Ÿ“ Multiple Formats: PDF, DOCX, TXT, MD, PPTX, XLSX, and more

Quick Start

Prerequisites

  • OS: Ubuntu 20.04+ (22.04 recommended)
  • GPU: NVIDIA (CUDA), AMD (ROCm), or CPU-only
- NVIDIA: 8-16GB VRAM, drivers pre-installed - AMD: ROCm-compatible GPU, ROCm drivers pre-installed - CPU: No GPU required (slower inference)
  • RAM: 16GB minimum, 32GB recommended
  • Storage: 50GB+ available
  • Connection: 80+ Mbit/s recommended

Automated Installation

# 1. Clone repository
git clone https://github.com/I3K-IT/RAG-Enterprise.git
cd RAG-Enterprise/rag-enterprise-structure

2. Run setup script (installs everything)

./setup.sh standard

3. Follow prompts - you'll need to logout/login once during setup

Setup time: ~1 hour (80 Mbit/s) / ~10-15 min (400+ Mbit/s)

4. Access the application

Frontend: http://localhost:3000

Get admin password: docker compose logs backend | grep "Password:"

What Gets Installed

The setup script automatically installs and configures:

  • Docker Engine + Docker Compose
  • GPU toolkit (NVIDIA Container Toolkit or AMD ROCm, based on your selection)
  • All required Docker images (CUDA or ROCm variant)
  • Ollama with LLM model (Mistral 7B or Qwen3:14b)
  • Qdrant vector database
  • Backend + Frontend services
First Startup: After setup completes, the backend downloads the embedding model (~2.3GB) on first startup. This takes ~9 minutes (80 Mbit/s) or ~2 minutes (400+ Mbit/s). Check status with:

docker compose logs backend -f

Once you see "Application startup complete", open http://localhost:3000 and login.


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  React + Vite Frontend (Port 3000)     โ”‚
โ”‚  - JWT Authentication                   โ”‚
โ”‚  - Document Management                  โ”‚
โ”‚  - Conversation History                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚ REST API
                  โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  FastAPI Backend (Port 8000)           โ”‚
โ”‚  - RAG Pipeline (LangChain)            โ”‚
โ”‚  - Role-Based Access Control           โ”‚
โ”‚  - Backup & Restore (rclone)           โ”‚
โ”‚  - OCR (Apache Tika + Tesseract)       โ”‚
โ”‚  - Embeddings (BAAI/bge-m3)            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ†“                           โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Qdrant (6333) โ”‚   โ”‚  Ollama (11434) โ”‚
โ”‚  Vector DB     โ”‚   โ”‚  LLM Server     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

User Roles

  • User: Query documents (read-only)
  • Super User: Upload and delete documents
  • Admin: Full access including user management

Usage

First Login

  • Open http://localhost:3000
  • Get your admin password from the logs:
docker compose logs backend | grep "Password:"
  • Login with username admin and the password from logs
  • Create additional users in Admin panel
Note: The admin password is randomly generated at first startup for security.
It is not a fixed default like admin123. If you don't see it in the logs, see Password Recovery below.

Upload Documents

  • Login as Super User or Admin
  • Click "Upload Document"
  • Select files (PDF, DOCX, TXT, MD, etc.)
  • Wait for processing (1-2 min per document)
  • Start querying your documents

Supported Formats

  • โœ… PDF (with OCR)
  • โœ… DOCX/DOC
  • โœ… PPTX/PPT
  • โœ… XLSX/XLS
  • โœ… TXT, MD
  • โœ… ODT, RTF, HTML, XML

Backup & Restore

RAG Enterprise includes a complete backup system that protects your entire deployment โ€” database, documents, and vector store โ€” with support for 70+ cloud providers via rclone.

Backup Management Panel

Key Features

  • One-click backup: Create full system backups from the admin panel
  • 10 provider types: Mega, S3/MinIO, Google Drive, OneDrive, Dropbox, WebDAV (Nextcloud), FTP, SFTP, Backblaze B2, pCloud
  • Automatic scheduling: Cron-based with configurable retention policies
  • Selective restore: Choose which components to restore (database, documents, vectors)
  • Zero-downtime backup: SQLite safe backup API, no service interruption

Quick Example

# Add a Mega cloud provider
curl -X POST http://localhost:8000/api/admin/backup/providers \
  -H "Authorization: Bearer TOKEN" \
  -d '{"name": "my-mega", "type": "mega", "config": {"user": "email@example.com", "pass": "password"}}'

Run backup + upload to cloud

curl -X POST http://localhost:8000/api/admin/backup/run \ -H "Authorization: Bearer TOKEN" \ -d '{"provider": "my-mega"}'

Schedule daily backups at 2 AM

curl -X POST http://localhost:8000/api/admin/backup/schedule \ -H "Authorization: Bearer TOKEN" \ -d '{"cron": "0 2 *", "provider": "my-mega", "retention": 5, "enabled": true}'
Full documentation: See docs/BACKUP.md for complete setup guide, all provider configurations, API reference, and troubleshooting.

Configuration

All configuration is done via the .env file. Copy the example and edit:

cp .env.example .env
nano .env

After any change, restart the stack:

docker compose down && docker compose up -d

Change LLM Model

The default model is Qwen3:14b (~10-12 GB VRAM). If it's too heavy for your hardware, switch to a lighter model in .env:

| Model | VRAM | Best for | |-------|------|----------| | qwen3:14b-q4KM | ~10-12 GB | Best quality (default) | | qwen3:8b-q4KM | ~5 GB | Good balance quality/speed | | qwen3:4b-q4KM | ~3 GB | Fast, works on most GPUs | | qwen3:1.7b-q4KM | ~1.5 GB | Ultra-light, works on CPU | | mistral:7b | ~5 GB | Proven alternative, English-focused |

# .env
LLMMODEL=qwen3:8b-q4K_M

The new model is pulled automatically on next startup.

LLM Timeout

The LLM_TIMEOUT variable controls how long the backend waits for the model to generate a response. Default is 120 seconds (2 minutes), suitable for GPU inference.

On CPU-only setups, larger models can take 5-10+ minutes per query. Increase the timeout accordingly:

| Setup | Recommended timeout | |-------|-------------------| | GPU (NVIDIA/AMD) | 120 (default) | | CPU + light model (4B/1.7B) | 300 | | CPU + large model (8B/14B) | 600 |

# .env โ€” example for CPU-only with 14B model
LLM_TIMEOUT=600

Customize Branding

See LOGO_SETUP.md for logo and company name customization.


Useful Commands

System Management

# View all logs
docker compose logs -f

View backend logs only

docker compose logs -f backend

Check service status

docker compose ps

Restart services

docker compose restart

Stop everything

docker compose down

Start everything

docker compose up -d

Health checks

curl http://localhost:8000/health curl http://localhost:3000

Cleanup & Reinstall

If you need to start fresh:

# Complete cleanup (removes everything)
./cleanup.sh

Logout and login again

Run setup from scratch

./setup.sh standard

Troubleshooting

Backend shows "unhealthy"

Wait 3-5 minutes on first startup - it's downloading the embedding model:

docker compose logs backend -f

Look for "Application startup complete" message.

Admin password lost / not in logs

The admin password is randomly generated on first startup. If the logs have been cleared and you can't find it:

Option A: Set a custom password and recreate the admin user:

# 1. Add to your .env file echo "ADMINDEFAULTPASSWORD=your-secure-password" >> .env

2. Delete the user database to force recreation

docker compose exec backend rm /app/data/rag_users.db

3. Restart the backend

docker compose restart backend

Option B: Set ADMINDEFAULTPASSWORD in .env before first startup to avoid random passwords entirely:

# In .env - the admin account will use this password ADMINDEFAULTPASSWORD=your-secure-password

Tip: If you prefer a known password, set ADMINDEFAULTPASSWORD in .env before first startup. Otherwise, the system generates a secure random password shown only once in the logs.

Can't login / Frontend not loading

Check all services are running:

docker compose ps

All should show "Up" status

If backend is "unhealthy", wait a few more minutes

GPU not detected

NVIDIA:

nvidia-smi docker run --rm --gpus all nvidia/cuda:12.9.0-runtime-ubuntu22.04 nvidia-smi

AMD (ROCm):

ls /dev/kfd /dev/dri 

Verify ROCm: https://rocm.docs.amd.com

CPU-only: No GPU needed โ€” set GPU_TYPE=cpu in .env (or select option 3 during setup).

No results from queries

Lower the similarity threshold in docker-compose.yml:

RELEVANCE_THRESHOLD: "0.3"  # Lower = more results

Then docker compose restart backend.


Performance

Expected Speed (RTX 4070, 12GB VRAM)

  • Setup time: ~1 hour (80 Mbit/s) / ~10-15 min (400+ Mbit/s)
  • First startup: +9 min (80 Mbit/s) / +2 min (400+ Mbit/s) for embedding model
  • Total ready: ~1h 10min (80 Mbit/s) / ~15-20 min (fast connection)
  • Query response: 2-4 seconds
  • Generation speed: 80-100 tokens/s
  • Document capacity: 1,000-10,000 documents
  • Upload speed: 1-2 documents/minute

Community Benchmarks

Real-world performance results from the community. Run python benchmark/rag_benchmark.py to test your hardware and contribute your results!

Hardware Configurations Tested

| Hardware | CPU | RAM | GPU | VRAM | |----------|-----|-----|-----|------| | Config #1 | AMD Ryzen 9 5950X (32 cores) | 64 GB | RTX 5070 Ti | 16 GB |

Upload Performance (seconds)

| Hardware | Mean | Median | Min | Max | |----------|------|--------|-----|-----| | Config #1 | 10.96s | 9.31s | 0.59s | 24.62s |

Query Performance (seconds)

| Hardware | Mean | Median | Min | Max | P95 | |----------|------|--------|-----|-----|-----| | Config #1 | 4.31s | 3.63s | 2.09s | 8.78s | 8.78s |

Test Documents

| Document | Type | Size | Upload Time (Config #1) | |----------|------|------|-------------------------| | Mueller Report (2019) | Legal | 11 MB | 17.72s | | 9/11 Commission Report | Legal | 7.4 MB | 24.62s | | Bitcoin Whitepaper | Technical | 180 KB | 0.59s | | Attention Is All You Need | Technical | 2.2 MB | 0.91s |

Query Accuracy (Similarity Scores)

| Query Type | Config #1 | |------------|-----------| | Factual lookups | 65-69% | | Conceptual questions | 50-62% | | Complex analysis | 45-55% |

Want to contribute? Run the benchmark on your hardware and open an issue with your results!
See benchmark/README.md for instructions.

Privacy & Security

  • โœ… Zero external calls: Everything runs locally
  • โœ… No telemetry: No tracking or analytics
  • โœ… Local models: LLM and embeddings on-premise
  • โœ… AGPL-3.0 License: If you modify and deploy as a service, you must share source code
Ideal for: Law firms, healthcare, finance, government, enterprises with sensitive data.

How to cite

If you use RAG Enterprise in academic research, EU grant proposals, or technical publications, please cite it as:

APA:

Marchetti, F. (2026). RAG Enterprise โ€” Self-hosted document intelligence platform (Version 1.2.1) [Software]. Zenodo. https://doi.org/10.5281/zenodo.20413005

BibTeX:

@software{marchetti2026ragenterprise,
  author       = {Marchetti, Francesco},
  title        = {RAG Enterprise: Self-hosted document intelligence platform},
  year         = {2026},
  publisher    = {Zenodo},
  version      = {v1.2.1},
  doi          = {10.5281/zenodo.20413005},
  url          = {https://doi.org/10.5281/zenodo.20413005},
  license      = {AGPL-3.0},
  note         = {Sovereign GDPR-compliant Retrieval-Augmented Generation system for regulated industries; Community (AGPL-3.0) and Pro (commercial) editions}
}

Plain text:

Francesco Marchetti. (2026). RAG Enterprise โ€” Self-hosted document intelligence platform (v1.2.1) [Software]. https://doi.org/10.5281/zenodo.20413005


License

This project is licensed under AGPL-3.0 - see LICENSE file.

What this means:

  • โœ… Free to use and modify
  • โœ… Must share modifications if you offer it as a service
  • โœ… Protects against proprietary SaaS parasites
  • โœ… Still fully open-source

Contributing

We welcome contributions! Please read our guidelines:

Quick start:
  • Fork the repository
  • Create feature branch (git checkout -b feature/YourFeature)
  • Make your changes
  • Open Pull Request

Support


Star History

If you find this project useful, please consider giving it a star! It helps others discover the project.

Star History Chart


Credits

Built with:


Author

Francesco Marchetti - Creator & Lead Developer


Made with โค๏ธ by I3K Technologies for privacy-conscious enterprises

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท I3K-IT/RAG-Enterprise ยท Updated daily from GitHub