A production-ready, modular Retrieval-Augmented Generation (RAG) platform with Chain of Thought reasoning, multi-LLM support, and enterprise-grade features
๐ Quick Start โข ๐ Documentation โข ๐ ๏ธ Development โข โจ Features โข ๐ค Contributing
RAG Modulo is a production-ready Retrieval-Augmented Generation platform that provides enterprise-grade document processing, intelligent search, and AI-powered question answering with advanced Chain of Thought (CoT) reasoning. Built with modern technologies and designed for scalability, it supports multiple vector databases (Milvus, Elasticsearch, Pinecone, Weaviate, ChromaDB), LLM providers (WatsonX, OpenAI, Anthropic), and document formats including enhanced support via IBM Docling integration.
| ๐ง AI-Powered | ๐ Advanced Search | ๐ฌ Interactive UI | ๐ Production Ready |
|---|---|---|---|
| Chain of Thought reasoning Automatic pipeline resolution Multi-LLM provider support Token tracking & monitoring | Vector similarity search Hybrid search strategies Intelligent source attribution Auto-generated suggestions | Modern React interface Real-time document upload Podcast generation Voice preview features | Docker + GHCR images Multi-stage CI/CD Security scanning 947 automated tests |
| Component | Status | Progress |
|---|---|---|
| ๐๏ธ Infrastructure | โ Production Ready | Docker + GHCR + Cloud Deployment |
| ๐งช Testing | โ Comprehensive | 947 tests (atomic, unit, integration, API) |
| ๐ Core Services | โ Fully Operational | 26+ services with DI pattern |
| ๐ Documentation | โ Extensive | API docs, guides, deployment |
| ๐ง Development | โ Optimized | Containerless local dev workflow |
| ๐ Security | โ Hardened | Multi-layer scanning (Trivy, Bandit, Gitleaks) |
| Feature | Description | Benefit |
|---|---|---|
| ๐ง Chain of Thought | Automatic question decomposition with step-by-step reasoning | 40%+ better answer quality on complex queries |
| โก Auto Pipeline Resolution | Zero-config search - backend handles pipeline selection | Simplified API, reduced client complexity |
| ๐จ Reusable UI Components | 8 accessible, type-safe components (Button, Input, Modal, etc.) | 44% code reduction, consistent design system |
| ๐ Security Hardening | Multi-layer scanning (Trivy, Bandit, Gitleaks, TruffleHog) | Production-grade security posture |
| ๐ Containerless Dev | Local development without containers | 10x faster iteration, instant hot-reload |
| ๐ IBM Docling | Enhanced document processing for complex formats | Better PDF/DOCX/XLSX handling |
| ๐๏ธ Podcast Generation | AI-powered podcast creation with voice preview | Interactive content from documents |
| ๐ก Smart Suggestions | Auto-generated relevant questions | Improved user experience and discovery |
| ๐ฆ GHCR Images | Pre-built production images | Faster deployments, consistent environments |
| Tool | Version | Installation | Purpose |
|---|---|---|---|
| Python | 3.12+ | brew install [email protected] (macOS)sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install python3.12 python3.12-venv (Ubuntu 22.04)apt install python3.12 (Ubuntu 24.04+) | Backend runtime |
| Poetry | Latest | make venv (auto-installs)or curl -sSL https://install.python-poetry.org | python3 - | Python dependency management |
| Node.js | 18+ | brew install node (macOS)nvm install 18 (Linux/macOS) | Frontend development |
| Docker | Latest | Docker Desktop | Infrastructure containers |
| Docker Compose | V2 | Included with Docker Desktopapt install docker-compose-plugin (Linux) | Service orchestration |
๐ Verify Installation: Run
make check-dockerto verify Docker requirements
Best for: Daily development, feature work, rapid iteration
# 1. Clone repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
# 2. Set up environment variables
cp .env.example .env
# Edit .env with your API keys (WatsonX, OpenAI, Anthropic)
# 3. Install all dependencies (one command!)
make local-dev-setup
# This creates Python venv + installs backend (Poetry) + frontend (npm)
# 4. Start infrastructure only (Postgres, Milvus, MinIO, MLFlow)
make local-dev-infra
# 5a. Option A: Start backend and frontend in separate terminals
# Terminal 1:
make local-dev-backend
# Terminal 2:
make local-dev-frontend
# 5b. Option B: Start everything in background (easier!)
make local-dev-all
Backend (Python/Poetry):
Frontend (npm):
Infrastructure (Docker):
Access Points:
Benefits:
When to use:
Best for: Production-like testing, deployment validation
# Clone repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
# Set up environment
cp .env.example .env
# Edit .env with your API keys
# Build production images and start
make build-all
make prod-start
When to use:
Best for: Quick experimentation, onboarding, cloud development
make venv && make local-dev-infraWhen to use:
RAG Modulo follows a modern, service-based architecture with clear separation of concerns:
graph TB
subgraph "Frontend Layer"
UI[React Web UI]
CLI[Command Line Interface]
end
subgraph "API Layer"
API[FastAPI Backend]
AUTH[OIDC Authentication]
end
subgraph "Service Layer"
SEARCH[Search Service]
CONV[Conversation Service]
TOKEN[Token Tracking]
COT[Chain of Thought]
end
subgraph "Data Layer"
VDB[(Vector Database)]
PG[(PostgreSQL)]
MINIO[(MinIO Storage)]
end
subgraph "External Services"
LLM[LLM Providers]
EMB[Embedding Models]
end
UI --> API
CLI --> API
API --> SEARCH
API --> CONV
API --> TOKEN
API --> COT
SEARCH --> VDB
SEARCH --> PG
CONV --> LLM
TOKEN --> PG
COT --> LLM
API --> MINIO
Philosophy: Develop locally without containers for maximum speed, use containers only for infrastructure and production.
# ============================================================
# ONE-TIME SETUP (First Day Only)
# ============================================================
make local-dev-setup # Creates venv + installs all dependencies
# ============================================================
# DAILY ROUTINE (Every Day)
# ============================================================
# Option A: Manual Start (Recommended for debugging)
# ---------------------------------------------------
make local-dev-infra # Start infrastructure
# Terminal 1: Backend
make local-dev-backend # Auto-reload enabled
# Terminal 2: Frontend
make local-dev-frontend # Hot Module Replacement (HMR)
# Option B: Background Start (Faster)
# ---------------------------------------------------
make local-dev-all # Everything runs in background
make local-dev-status # Check what's running
# ============================================================
# DEVELOPMENT CYCLE
# ============================================================
# 1. Make code changes in your editor
# 2. See changes instantly (auto-reload for both backend/frontend)
# 3. Test via http://localhost:3000
# 4. Run quality checks before commit
make quick-check
# ============================================================
# END OF DAY
# ============================================================
make local-dev-stop # Stop all services
For the impatient developer:
# First time ever
make local-dev-setup && make local-dev-all
# Every day after
make local-dev-all
Done! Services running at:
| Command | What It Does | When to Use |
|---|---|---|
make venv | Creates Python virtual environment (auto-installs Poetry if missing) | First time setup or after clean |
make local-dev-setup | Installs ALL dependencies (backend + frontend) | First time setup or dependency updates |
make local-dev-infra | Starts infrastructure only (Postgres, Milvus, MinIO, MLFlow) | Every day before development |
make local-dev-all | Starts full stack in background | Quick startup, background development |
make local-dev-status | Shows what's running (infrastructure + backend + frontend) | Verify services are up |
make local-dev-stop | Stops ALL services (infra + backend + frontend) | End of day cleanup |
make quick-check | Fast lint + format validation | Before every commit |
# Atomic tests (fastest - no DB, no coverage)
make test-atomic
# Unit tests (mocked dependencies)
make test-unit-fast
# All local tests
make test-atomic && make test-unit-fast
# Ensure infrastructure is running
make local-dev-infra
# Run integration tests
make test-integration
# Full test suite
make test-all # atomic + unit + integration
make quick-check # Fast: format + lint (use before commit)
make lint # Full linting (ruff + mypy)
make format # Auto-fix formatting issues
make security-check # Security scans (bandit + safety)
make coverage # Generate coverage report (60% threshold)
Only for production-like testing or deployment validation:
# Build production images locally
make build-all
# Start production environment
make prod-start
# Check status
make prod-status
# View logs
make prod-logs
# Stop production
make prod-stop
Use pre-built images from GitHub Container Registry:
# Pull latest images
docker compose -f docker-compose.production.yml pull
# Start production environment
make prod-start
Available images:
ghcr.io/manavgup/rag_modulo/backend:latestghcr.io/manavgup/rag_modulo/frontend:latestRAG Modulo includes a powerful CLI for interacting with the system:
# After installation, use the CLI commands:
rag-cli --help # Main CLI help
rag-search # Search operations
rag-admin # Administrative tasks
# Example: Search a collection
rag-cli search query <collection-id> "your question here"
# Create a collection
rag-cli collection create --name "My Docs"
# Upload documents
rag-cli collection upload <collection-id> path/to/documents/
RAG Modulo supports multiple deployment strategies:
# Start production environment (all containers)
make prod-start
# Check status
make prod-status
# View logs
make prod-logs
# Stop production environment
make prod-stop
# Pull latest images and start production environment
docker compose -f docker-compose.production.yml pull
make prod-start
Available Images:
ghcr.io/manavgup/rag_modulo/backend:latestghcr.io/manavgup/rag_modulo/frontend:latest# Build local images
make build-all
# Start production services
make prod-start
# Deploy with Helm chart
helm install rag-modulo deployment/helm/rag-modulo
RAG Modulo uses a comprehensive CI/CD pipeline with multiple stages:
On Every PR (parallel, ~2-3 min total):
.github/workflows/01-lint.yml - Ruff, MyPy, Pylint, Pydocstyle (~60s).github/workflows/04-pytest.yml - Unit tests with coverage (~90s).github/workflows/07-frontend-lint.yml - ESLint for React/TypeScript (when frontend changes)On Push to Main:
.github/workflows/03-build-secure.yml - Docker builds + security scans.github/workflows/05-ci.yml - Integration tests (full stack).github/workflows/02-security.yml)Triggers: Push to main, Pull Requests
Secret Detection (3-Layer Defense):
make pre-commit-run (~1-2 sec)Scans:
.gitleaks.toml)โ ๏ธ IMPORTANT: CI now fails on ANY secret detection (no continue-on-error). This ensures no secrets make their way to the repository.
Supported Secret Types:
See: docs/development/secret-management.md for comprehensive guide
.github/workflows/deploy-docs.yml)Triggers: Push to main, changes to docs/
Actions:
Test CI pipeline locally before pushing:
# Run same checks as CI
make quick-check # Lint and format validation
make test-unit-fast # Unit tests
# Security checks
make security-check # Bandit + safety scans
make pre-commit-run # Full pre-commit hook suite
Optimized for developer velocity:
On Commit (fast, 5-10 sec):
On Push (slower, 30-60 sec):
In CI (comprehensive):
GitHub Container Registry (GHCR):
Image Tags:
latest: Latest main branch buildsha-<commit>: Specific commit<branch>: Branch-specific buildsv<version>: Release tags| Category | Count | Description | Command |
|---|---|---|---|
| โก Atomic Tests | 100+ | Schema validation, data structures | pytest -m atomic |
| ๐ Unit Tests | 83+ | Service logic, business rules | make test-unit-fast |
| ๐ Integration Tests | 43+ | Service interactions, DB integration | make test-integration |
| ๐ API Tests | 21+ | Endpoint validation, request/response | pytest -m api |
| ๐ E2E Tests | 22+ | Full workflow scenarios | pytest -m e2e |
| ๐ Total | 947 | Complete test coverage | make test-all |
# Fast local testing (no containers, recommended for development)
make test-unit-fast
# Specific test categories
make test-atomic # Schema and data structure tests
make test-integration # Service integration tests (requires infrastructure)
make test-e2e # End-to-end tests
# Full test suite with coverage
make coverage
# Run specific test file
poetry run pytest tests/unit/services/test_search_service.py -v
We welcome contributions! Please see our Contributing Guide for details.
Run these first to identify issues:
make check-docker # Verify Docker installation
make local-dev-status # Check what's running
make venv # Ensure Python environment is set up
docker compose -f docker-compose-infra.yml ps # Check infrastructure
Most Common Problems:
# Problem: "Command not found" errors
make venv # Creates Python venv (auto-installs Poetry)
source .venv/bin/activate
# Problem: Services won't start
make local-dev-stop # Stop everything cleanly
make check-docker # Verify Docker requirements
make local-dev-infra # Restart infrastructure only
# Problem: Port conflicts
make local-dev-stop # Stops all services and containers
lsof -i :8000 && kill $(lsof -t -i:8000) # Kill backend on port 8000
lsof -i :3000 && kill $(lsof -t -i:3000) # Kill frontend on port 3000
# Problem: Weird behavior after updates
make clean-venv # Remove Python venv
make local-dev-setup # Fresh install
make clean-all # Nuclear option: clean everything
# Makefile auto-installs Poetry (recommended)
make venv
# OR install manually
curl -sSL https://install.python-poetry.org | python3 -
# Check Python version
python --version # Should be 3.12+
# macOS: Install Python 3.12
brew install [email protected]
# Ubuntu/Debian: Install Python 3.12
sudo apt update
sudo apt install python3.12 python3.12-venv
# Method 1: Use Makefile (recommended)
make clean-venv
make local-dev-setup
# Method 2: Manual Poetry setup (from project root)
poetry config virtualenvs.in-project true
poetry cache clear . --all
poetry install --with dev,test --sync
source .venv/bin/activate
# Ensure you're in Poetry venv (from project root)
source .venv/bin/activate
which python # Should show: .venv/bin/python
which ruff # Should show: .venv/bin/ruff
ruff --version # Should be 0.14.0+
# If wrong version, reinstall
poetry install --with dev,test --sync
# Verify PYTHONPATH and reinstall (from project root)
source .venv/bin/activate
poetry install --with dev,test --sync
python -c "import sys; print('\n'.join(sys.path))"
# Check if Docker is installed
docker --version
docker compose version
# If missing, install:
# macOS: brew install --cask docker
# Or download Docker Desktop: https://www.docker.com/products/docker-desktop
# Ubuntu/Debian
sudo apt update
sudo apt install docker-compose-plugin
# Verify
docker compose version
# Clean restart
make local-dev-stop
docker system prune -f
make local-dev-infra
# Check what failed
docker compose -f docker-compose-infra.yml ps
docker compose -f docker-compose-infra.yml logs
# Common fixes
docker volume prune -f # Clear old volumes
make clean-all # Nuclear option
# Find what's using ports
lsof -i :8000 # Backend
lsof -i :3000 # Frontend
lsof -i :5432 # PostgreSQL
lsof -i :19530 # Milvus
# Stop conflicting services
make local-dev-stop
# Kill specific port (if needed)
kill $(lsof -t -i:8000)
# Fix volume permissions
chmod -R 777 ./volumes
docker compose -f docker-compose-infra.yml down -v
make local-dev-infra
# Ensure venv is activated (from project root)
source .venv/bin/activate
# Install test dependencies
poetry install --with test --sync
# Run specific test with verbose output
poetry run pytest tests/unit/test_example.py -vv -s
# Ensure infrastructure is running
make local-dev-infra
make local-dev-status
# Wait for services to be ready
sleep 10
# Run tests
make test-integration
# Check PYTHONPATH (from project root)
source .venv/bin/activate
poetry run pytest tests/ --collect-only # See what tests are collected
# If imports fail, reinstall
poetry install --with dev,test --sync
Development Mode (bypass authentication):
# Add to .env
SKIP_AUTH=true
DEVELOPMENT_MODE=true
ENABLE_MOCK_AUTH=true
# Restart backend
make local-dev-stop
make local-dev-backend
Production Mode (fix OIDC):
.env has correct OIDC settingstail -f /tmp/rag-backend.log# Check backend logs
tail -f /tmp/rag-backend.log
# Restart backend with debug (from project root)
source .venv/bin/activate
LOG_LEVEL=DEBUG uvicorn main:app --reload --port 8000 --app-dir backend
# Clear cache and retry
cd frontend
rm -rf node_modules package-lock.json
npm cache clean --force
npm install
# Check Node version
node --version # Should be 18+
# Update Node (macOS)
brew upgrade node
# Update Node (Linux - using nvm)
nvm install 18
nvm use 18
# Reinstall and start
cd frontend
rm -rf node_modules
npm install
npm run dev
# Clear build cache
cd frontend
rm -rf dist .vite
npm run dev
# Check if infrastructure is running locally
make local-dev-status
# Monitor resource usage
docker stats
# Check logs for bottlenecks
tail -f /tmp/rag-backend.log | grep -i "slow\|timeout\|error"
# Restart services to clear memory
make local-dev-stop
docker system prune -f
make local-dev-infra
| Resource | When to Use | Link |
|---|---|---|
| ๐ Full Documentation | Comprehensive guides and API reference | docs site |
| ๐ GitHub Issues | Report bugs or request features | issues |
| ๐ฌ Discussions | Ask questions, share ideas | discussions |
| ๐ง CLAUDE.md | Development best practices and architecture | See project root |
make local-dev-statustail -f /tmp/rag-backend.log or make logsmake local-dev-stop && make clean && make local-dev-allmake clean-all (removes everything - be careful!)make local-dev-statusThis project is licensed under the MIT License.
A production-ready, modular Retrieval-Augmented Generation (RAG) platform with Chain of Thought reasoning, multi-LLM support, and enterprise-grade features
๐ Quick Start โข ๐ Documentation โข ๐ ๏ธ Development โข โจ Features โข ๐ค Contributing
RAG Modulo is a production-ready Retrieval-Augmented Generation platform that provides enterprise-grade document processing, intelligent search, and AI-powered question answering with advanced Chain of Thought (CoT) reasoning. Built with modern technologies and designed for scalability, it supports multiple vector databases (Milvus, Elasticsearch, Pinecone, Weaviate, ChromaDB), LLM providers (WatsonX, OpenAI, Anthropic), and document formats including enhanced support via IBM Docling integration.
| ๐ง AI-Powered | ๐ Advanced Search | ๐ฌ Interactive UI | ๐ Production Ready |
|---|---|---|---|
| Chain of Thought reasoning Automatic pipeline resolution Multi-LLM provider support Token tracking & monitoring | Vector similarity search Hybrid search strategies Intelligent source attribution Auto-generated suggestions | Modern React interface Real-time document upload Podcast generation Voice preview features | Docker + GHCR images Multi-stage CI/CD Security scanning 947 automated tests |
| Component | Status | Progress |
|---|---|---|
| ๐๏ธ Infrastructure | โ Production Ready | Docker + GHCR + Cloud Deployment |
| ๐งช Testing | โ Comprehensive | 947 tests (atomic, unit, integration, API) |
| ๐ Core Services | โ Fully Operational | 26+ services with DI pattern |
| ๐ Documentation | โ Extensive | API docs, guides, deployment |
| ๐ง Development | โ Optimized | Containerless local dev workflow |
| ๐ Security | โ Hardened | Multi-layer scanning (Trivy, Bandit, Gitleaks) |
| Feature | Description | Benefit |
|---|---|---|
| ๐ง Chain of Thought | Automatic question decomposition with step-by-step reasoning | 40%+ better answer quality on complex queries |
| โก Auto Pipeline Resolution | Zero-config search - backend handles pipeline selection | Simplified API, reduced client complexity |
| ๐จ Reusable UI Components | 8 accessible, type-safe components (Button, Input, Modal, etc.) | 44% code reduction, consistent design system |
| ๐ Security Hardening | Multi-layer scanning (Trivy, Bandit, Gitleaks, TruffleHog) | Production-grade security posture |
| ๐ Containerless Dev | Local development without containers | 10x faster iteration, instant hot-reload |
| ๐ IBM Docling | Enhanced document processing for complex formats | Better PDF/DOCX/XLSX handling |
| ๐๏ธ Podcast Generation | AI-powered podcast creation with voice preview | Interactive content from documents |
| ๐ก Smart Suggestions | Auto-generated relevant questions | Improved user experience and discovery |
| ๐ฆ GHCR Images | Pre-built production images | Faster deployments, consistent environments |
| Tool | Version | Installation | Purpose |
|---|---|---|---|
| Python | 3.12+ | brew install [email protected] (macOS)sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update && sudo apt install python3.12 python3.12-venv (Ubuntu 22.04)apt install python3.12 (Ubuntu 24.04+) | Backend runtime |
| Poetry | Latest | make venv (auto-installs)or curl -sSL https://install.python-poetry.org | python3 - | Python dependency management |
| Node.js | 18+ | brew install node (macOS)nvm install 18 (Linux/macOS) | Frontend development |
| Docker | Latest | Docker Desktop | Infrastructure containers |
| Docker Compose | V2 | Included with Docker Desktopapt install docker-compose-plugin (Linux) | Service orchestration |
๐ Verify Installation: Run
make check-dockerto verify Docker requirements
Best for: Daily development, feature work, rapid iteration
# 1. Clone repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
# 2. Set up environment variables
cp .env.example .env
# Edit .env with your API keys (WatsonX, OpenAI, Anthropic)
# 3. Install all dependencies (one command!)
make local-dev-setup
# This creates Python venv + installs backend (Poetry) + frontend (npm)
# 4. Start infrastructure only (Postgres, Milvus, MinIO, MLFlow)
make local-dev-infra
# 5a. Option A: Start backend and frontend in separate terminals
# Terminal 1:
make local-dev-backend
# Terminal 2:
make local-dev-frontend
# 5b. Option B: Start everything in background (easier!)
make local-dev-all
Backend (Python/Poetry):
Frontend (npm):
Infrastructure (Docker):
Access Points:
Benefits:
When to use:
Best for: Production-like testing, deployment validation
# Clone repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
# Set up environment
cp .env.example .env
# Edit .env with your API keys
# Build production images and start
make build-all
make prod-start
When to use:
Best for: Quick experimentation, onboarding, cloud development
make venv && make local-dev-infraWhen to use:
RAG Modulo follows a modern, service-based architecture with clear separation of concerns:
graph TB
subgraph "Frontend Layer"
UI[React Web UI]
CLI[Command Line Interface]
end
subgraph "API Layer"
API[FastAPI Backend]
AUTH[OIDC Authentication]
end
subgraph "Service Layer"
SEARCH[Search Service]
CONV[Conversation Service]
TOKEN[Token Tracking]
COT[Chain of Thought]
end
subgraph "Data Layer"
VDB[(Vector Database)]
PG[(PostgreSQL)]
MINIO[(MinIO Storage)]
end
subgraph "External Services"
LLM[LLM Providers]
EMB[Embedding Models]
end
UI --> API
CLI --> API
API --> SEARCH
API --> CONV
API --> TOKEN
API --> COT
SEARCH --> VDB
SEARCH --> PG
CONV --> LLM
TOKEN --> PG
COT --> LLM
API --> MINIO
Philosophy: Develop locally without containers for maximum speed, use containers only for infrastructure and production.
# ============================================================
# ONE-TIME SETUP (First Day Only)
# ============================================================
make local-dev-setup # Creates venv + installs all dependencies
# ============================================================
# DAILY ROUTINE (Every Day)
# ============================================================
# Option A: Manual Start (Recommended for debugging)
# ---------------------------------------------------
make local-dev-infra # Start infrastructure
# Terminal 1: Backend
make local-dev-backend # Auto-reload enabled
# Terminal 2: Frontend
make local-dev-frontend # Hot Module Replacement (HMR)
# Option B: Background Start (Faster)
# ---------------------------------------------------
make local-dev-all # Everything runs in background
make local-dev-status # Check what's running
# ============================================================
# DEVELOPMENT CYCLE
# ============================================================
# 1. Make code changes in your editor
# 2. See changes instantly (auto-reload for both backend/frontend)
# 3. Test via http://localhost:3000
# 4. Run quality checks before commit
make quick-check
# ============================================================
# END OF DAY
# ============================================================
make local-dev-stop # Stop all services
For the impatient developer:
# First time ever
make local-dev-setup && make local-dev-all
# Every day after
make local-dev-all
Done! Services running at:
| Command | What It Does | When to Use |
|---|---|---|
make venv | Creates Python virtual environment (auto-installs Poetry if missing) | First time setup or after clean |
make local-dev-setup | Installs ALL dependencies (backend + frontend) | First time setup or dependency updates |
make local-dev-infra | Starts infrastructure only (Postgres, Milvus, MinIO, MLFlow) | Every day before development |
make local-dev-all | Starts full stack in background | Quick startup, background development |
make local-dev-status | Shows what's running (infrastructure + backend + frontend) | Verify services are up |
make local-dev-stop | Stops ALL services (infra + backend + frontend) | End of day cleanup |
make quick-check | Fast lint + format validation | Before every commit |
# Atomic tests (fastest - no DB, no coverage)
make test-atomic
# Unit tests (mocked dependencies)
make test-unit-fast
# All local tests
make test-atomic && make test-unit-fast
# Ensure infrastructure is running
make local-dev-infra
# Run integration tests
make test-integration
# Full test suite
make test-all # atomic + unit + integration
make quick-check # Fast: format + lint (use before commit)
make lint # Full linting (ruff + mypy)
make format # Auto-fix formatting issues
make security-check # Security scans (bandit + safety)
make coverage # Generate coverage report (60% threshold)
Only for production-like testing or deployment validation:
# Build production images locally
make build-all
# Start production environment
make prod-start
# Check status
make prod-status
# View logs
make prod-logs
# Stop production
make prod-stop
Use pre-built images from GitHub Container Registry:
# Pull latest images
docker compose -f docker-compose.production.yml pull
# Start production environment
make prod-start
Available images:
ghcr.io/manavgup/rag_modulo/backend:latestghcr.io/manavgup/rag_modulo/frontend:latestRAG Modulo includes a powerful CLI for interacting with the system:
# After installation, use the CLI commands:
rag-cli --help # Main CLI help
rag-search # Search operations
rag-admin # Administrative tasks
# Example: Search a collection
rag-cli search query <collection-id> "your question here"
# Create a collection
rag-cli collection create --name "My Docs"
# Upload documents
rag-cli collection upload <collection-id> path/to/documents/
RAG Modulo supports multiple deployment strategies:
# Start production environment (all containers)
make prod-start
# Check status
make prod-status
# View logs
make prod-logs
# Stop production environment
make prod-stop
# Pull latest images and start production environment
docker compose -f docker-compose.production.yml pull
make prod-start
Available Images:
ghcr.io/manavgup/rag_modulo/backend:latestghcr.io/manavgup/rag_modulo/frontend:latest# Build local images
make build-all
# Start production services
make prod-start
# Deploy with Helm chart
helm install rag-modulo deployment/helm/rag-modulo
RAG Modulo uses a comprehensive CI/CD pipeline with multiple stages:
On Every PR (parallel, ~2-3 min total):
.github/workflows/01-lint.yml - Ruff, MyPy, Pylint, Pydocstyle (~60s).github/workflows/04-pytest.yml - Unit tests with coverage (~90s).github/workflows/07-frontend-lint.yml - ESLint for React/TypeScript (when frontend changes)On Push to Main:
.github/workflows/03-build-secure.yml - Docker builds + security scans.github/workflows/05-ci.yml - Integration tests (full stack).github/workflows/02-security.yml)Triggers: Push to main, Pull Requests
Secret Detection (3-Layer Defense):
make pre-commit-run (~1-2 sec)Scans:
.gitleaks.toml)โ ๏ธ IMPORTANT: CI now fails on ANY secret detection (no continue-on-error). This ensures no secrets make their way to the repository.
Supported Secret Types:
See: docs/development/secret-management.md for comprehensive guide
.github/workflows/deploy-docs.yml)Triggers: Push to main, changes to docs/
Actions:
Test CI pipeline locally before pushing:
# Run same checks as CI
make quick-check # Lint and format validation
make test-unit-fast # Unit tests
# Security checks
make security-check # Bandit + safety scans
make pre-commit-run # Full pre-commit hook suite
Optimized for developer velocity:
On Commit (fast, 5-10 sec):
On Push (slower, 30-60 sec):
In CI (comprehensive):
GitHub Container Registry (GHCR):
Image Tags:
latest: Latest main branch buildsha-<commit>: Specific commit<branch>: Branch-specific buildsv<version>: Release tags| Category | Count | Description | Command |
|---|---|---|---|
| โก Atomic Tests | 100+ | Schema validation, data structures | pytest -m atomic |
| ๐ Unit Tests | 83+ | Service logic, business rules | make test-unit-fast |
| ๐ Integration Tests | 43+ | Service interactions, DB integration | make test-integration |
| ๐ API Tests | 21+ | Endpoint validation, request/response | pytest -m api |
| ๐ E2E Tests | 22+ | Full workflow scenarios | pytest -m e2e |
| ๐ Total | 947 | Complete test coverage | make test-all |
# Fast local testing (no containers, recommended for development)
make test-unit-fast
# Specific test categories
make test-atomic # Schema and data structure tests
make test-integration # Service integration tests (requires infrastructure)
make test-e2e # End-to-end tests
# Full test suite with coverage
make coverage
# Run specific test file
poetry run pytest tests/unit/services/test_search_service.py -v
We welcome contributions! Please see our Contributing Guide for details.
Run these first to identify issues:
make check-docker # Verify Docker installation
make local-dev-status # Check what's running
make venv # Ensure Python environment is set up
docker compose -f docker-compose-infra.yml ps # Check infrastructure
Most Common Problems:
# Problem: "Command not found" errors
make venv # Creates Python venv (auto-installs Poetry)
source .venv/bin/activate
# Problem: Services won't start
make local-dev-stop # Stop everything cleanly
make check-docker # Verify Docker requirements
make local-dev-infra # Restart infrastructure only
# Problem: Port conflicts
make local-dev-stop # Stops all services and containers
lsof -i :8000 && kill $(lsof -t -i:8000) # Kill backend on port 8000
lsof -i :3000 && kill $(lsof -t -i:3000) # Kill frontend on port 3000
# Problem: Weird behavior after updates
make clean-venv # Remove Python venv
make local-dev-setup # Fresh install
make clean-all # Nuclear option: clean everything
# Makefile auto-installs Poetry (recommended)
make venv
# OR install manually
curl -sSL https://install.python-poetry.org | python3 -
# Check Python version
python --version # Should be 3.12+
# macOS: Install Python 3.12
brew install [email protected]
# Ubuntu/Debian: Install Python 3.12
sudo apt update
sudo apt install python3.12 python3.12-venv
# Method 1: Use Makefile (recommended)
make clean-venv
make local-dev-setup
# Method 2: Manual Poetry setup (from project root)
poetry config virtualenvs.in-project true
poetry cache clear . --all
poetry install --with dev,test --sync
source .venv/bin/activate
# Ensure you're in Poetry venv (from project root)
source .venv/bin/activate
which python # Should show: .venv/bin/python
which ruff # Should show: .venv/bin/ruff
ruff --version # Should be 0.14.0+
# If wrong version, reinstall
poetry install --with dev,test --sync
# Verify PYTHONPATH and reinstall (from project root)
source .venv/bin/activate
poetry install --with dev,test --sync
python -c "import sys; print('\n'.join(sys.path))"
# Check if Docker is installed
docker --version
docker compose version
# If missing, install:
# macOS: brew install --cask docker
# Or download Docker Desktop: https://www.docker.com/products/docker-desktop
# Ubuntu/Debian
sudo apt update
sudo apt install docker-compose-plugin
# Verify
docker compose version
# Clean restart
make local-dev-stop
docker system prune -f
make local-dev-infra
# Check what failed
docker compose -f docker-compose-infra.yml ps
docker compose -f docker-compose-infra.yml logs
# Common fixes
docker volume prune -f # Clear old volumes
make clean-all # Nuclear option
# Find what's using ports
lsof -i :8000 # Backend
lsof -i :3000 # Frontend
lsof -i :5432 # PostgreSQL
lsof -i :19530 # Milvus
# Stop conflicting services
make local-dev-stop
# Kill specific port (if needed)
kill $(lsof -t -i:8000)
# Fix volume permissions
chmod -R 777 ./volumes
docker compose -f docker-compose-infra.yml down -v
make local-dev-infra
# Ensure venv is activated (from project root)
source .venv/bin/activate
# Install test dependencies
poetry install --with test --sync
# Run specific test with verbose output
poetry run pytest tests/unit/test_example.py -vv -s
# Ensure infrastructure is running
make local-dev-infra
make local-dev-status
# Wait for services to be ready
sleep 10
# Run tests
make test-integration
# Check PYTHONPATH (from project root)
source .venv/bin/activate
poetry run pytest tests/ --collect-only # See what tests are collected
# If imports fail, reinstall
poetry install --with dev,test --sync
Development Mode (bypass authentication):
# Add to .env
SKIP_AUTH=true
DEVELOPMENT_MODE=true
ENABLE_MOCK_AUTH=true
# Restart backend
make local-dev-stop
make local-dev-backend
Production Mode (fix OIDC):
.env has correct OIDC settingstail -f /tmp/rag-backend.log# Check backend logs
tail -f /tmp/rag-backend.log
# Restart backend with debug (from project root)
source .venv/bin/activate
LOG_LEVEL=DEBUG uvicorn main:app --reload --port 8000 --app-dir backend
# Clear cache and retry
cd frontend
rm -rf node_modules package-lock.json
npm cache clean --force
npm install
# Check Node version
node --version # Should be 18+
# Update Node (macOS)
brew upgrade node
# Update Node (Linux - using nvm)
nvm install 18
nvm use 18
# Reinstall and start
cd frontend
rm -rf node_modules
npm install
npm run dev
# Clear build cache
cd frontend
rm -rf dist .vite
npm run dev
# Check if infrastructure is running locally
make local-dev-status
# Monitor resource usage
docker stats
# Check logs for bottlenecks
tail -f /tmp/rag-backend.log | grep -i "slow\|timeout\|error"
# Restart services to clear memory
make local-dev-stop
docker system prune -f
make local-dev-infra
| Resource | When to Use | Link |
|---|---|---|
| ๐ Full Documentation | Comprehensive guides and API reference | docs site |
| ๐ GitHub Issues | Report bugs or request features | issues |
| ๐ฌ Discussions | Ask questions, share ideas | discussions |
| ๐ง CLAUDE.md | Development best practices and architecture | See project root |
make local-dev-statustail -f /tmp/rag-backend.log or make logsmake local-dev-stop && make clean && make local-dev-allmake clean-all (removes everything - be careful!)make local-dev-statusThis project is licensed under the MIT License.