Loading repository dataβ¦
Loading repository dataβ¦
MERakram / repository
π Production-ready modular RAG monorepo: Local LLM inference (vLLM) β’ Hybrid retrieval with Qdrant β’ Semantic caching β’ Docling document parsing β’ Cross-encoder reranking β’ DeepEval evaluation β’ Full observability with Langfuse β’ Open WebUI chat interface β’ OpenAI-compatible API β’ Fully Dockerized
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A production-ready Retrieval-Augmented Generation (RAG) platform featuring local LLM inference, hybrid retrieval, multi-agent orchestration, semantic caching, and full observability.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Open WebUI β
β (localhost:3000) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RAG Backend (FastAPI) β
β (localhost:5002) β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Semantic β β Query β β Re-Ranker β β Model β β
β β Cache β β Rewriting β β (Cross-Enc)β β Router β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
β Qdrant β β vLLM β β OpenRouter API β
β (Vector DB) β β (Local LLM) β β (Cloud Fallback) β
β localhost:6333 β β localhost:9999 β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Observability Stack β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Langfuse β β ClickHouse β β MinIO β β Redis β β
β β (UI:3001) β β (OLAP) β β (S3) β β (Queue) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Container | Image | Port | Purpose |
|---|---|---|---|
rag-open-webui | ghcr.io/open-webui/open-webui | 3000 | Chat UI (like ChatGPT) |
rag-backend | Custom (Dockerfile) | 5002 | FastAPI RAG orchestrator |
rag-vllm | vllm/vllm-openai | 9999 | Local LLM inference |
rag-qdrant | qdrant/qdrant | 6333 | Vector database |
rag-langfuse | langfuse/langfuse:3 | 3001 | Observability UI |
rag-langfuse-worker | langfuse/langfuse-worker:3 | 3030 | Trace processing |
rag-clickhouse | clickhouse/clickhouse-server | 18123 | Trace storage (OLAP) |
rag-minio | minio/minio | 9090/9091 | S3-compatible blob storage |
rag-redis | redis:7.2 | 6379 | Queue & cache |
rag-langfuse-db | postgres:16 | - | Langfuse metadata DB |
git clone https://github.com/yourusername/Advanced-RAG.git
cd Advanced-RAG
# Copy environment template
cp .env.example .env
# Edit .env with your API keys (OpenRouter, etc.)
docker compose up -d
admin@rag.localragadmin123| Variable | Description | Default |
|---|---|---|
OPENROUTER_API_KEY | API key for cloud LLM fallback | Required for cloud models |
LOCAL_MODEL_NAME | Model to run with vLLM | Qwen/Qwen2.5-0.5B-Instruct |
ENABLE_OCR | Enable OCR for image files (GPU intensive) | false |
LANGFUSE_DEBUG | Enable Langfuse debug logging | false |
WEBUI_SECRET_KEY | Secret for Open WebUI sessions | Set in compose |
See .env.example for the full list.
Advanced-RAG/
βββ src/
β βββ main.py # FastAPI app & endpoints
β βββ config.py # Model & provider configuration
β βββ ingestion/ # Document processing pipeline
β β βββ router.py # Ingestion orchestrator
β β βββ docling_parser.py # PDF/DOCX parser
β β βββ deepseek_ocr.py # OCR for images (optional)
β β βββ metadata.py # LLM-based metadata extraction
β β βββ chunking.py # Hierarchical chunking
β βββ retrieval/ # Search & retrieval
β β βββ engine.py # Query rewriting, HyDE
β β βββ qdrant_client.py # Vector DB operations
β β βββ reranker.py # Cross-encoder reranking
β βββ generation/ # Response generation
β β βββ agents.py # Multi-agent orchestration
β β βββ router.py # Model routing (local/cloud)
β β βββ semantic_cache.py # Query caching
β βββ observability/ # Monitoring
β βββ config.py # Langfuse setup
βββ docker-compose.yml # All services
βββ Dockerfile # RAG backend image
βββ pyproject.toml # Python dependencies
βββ requirements.txt # Pip dependencies
Access the Langfuse dashboard at http://localhost:3001
Open WebUI automatically sends session headers when ENABLE_OPENWEBUI_USER_HEADERS=true:
X-OpenWebUI-Chat-Id β Groups all messages in a conversationX-OpenWebUI-User-Id β Links traces to users# Install dependencies
pip install poetry
poetry install
# Start backend
poetry run uvicorn src.main:app --reload --port 8000
After running poetry install, you can use these commands to manage Docker services:
| Command | Description |
|---|---|
poetry run llm-up | Start vLLM service (local LLM inference) |
poetry run llm-down | Stop vLLM service |
poetry run trace-up | Start Langfuse + dependencies (observability) |
poetry run trace-down | Stop Langfuse + dependencies |
poetry run app-up | Start RAG backend + Qdrant + Open WebUI |
poetry run app-build | Rebuild and start the RAG backend |
poetry run app-down | Stop RAG backend + Qdrant + Open WebUI |
poetry run start-all | π Start all services |
poetry run stop-all | Stop all services |
poetry run status | Show status of all containers |
Example workflow:
# Start everything at once
poetry run start-all
# Or start services individually
poetry run trace-up # Start observability first
poetry run llm-up # Start local LLM
poetry run app-up # Start the RAG application
# Check what's running
poetry run status
# Stop everything
poetry run stop-all
Edit src/config.py to add new models:
ModelConfig(
id="your-model-id",
name="Display Name",
provider=Provider.OPENROUTER, # or Provider.VLLM
context_window=8192,
)
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)This project is licensed under the MIT License - see the LICENSE file for details.