Skip to content

I3K-IT/RAG-Enterprise

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

  1. Open http://localhost:3000
  2. Get your admin password from the logs:
    docker compose logs backend | grep "Password:"
  3. Login with username admin and the password from logs
  4. 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

  1. Login as Super User or Admin
  2. Click "Upload Document"
  3. Select files (PDF, DOCX, TXT, MD, etc.)
  4. Wait for processing (1-2 min per document)
  5. 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

Change LLM Model

Edit docker-compose.yml:

environment:
  LLM_MODEL: qwen3:14b-q4_K_M  # or mistral:7b-instruct-q4_K_M
  EMBEDDING_MODEL: BAAI/bge-m3
  RELEVANCE_THRESHOLD: "0.35"

Then restart:

docker compose restart backend

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 "ADMIN_DEFAULT_PASSWORD=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 ADMIN_DEFAULT_PASSWORD in .env before first startup to avoid random passwords entirely:

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

Tip: If you prefer a known password, set ADMIN_DEFAULT_PASSWORD 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:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/YourFeature)
  3. Make your changes
  4. 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

About

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

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors