Quick Start
OpenRAG is an open source Retrieval Augmented Generation (RAG) solution. This guide is a step-by-step walkthrough to help you get started with OpenRAG.
Prerequisites
Section titled βPrerequisitesβ- Docker and Docker Compose
- Your hardware should meet these specifications:
- CPU deployment: Minimum 13 GiB RAM for light PDF parsers (
PyMuPDFLoader), or 23 GiB RAM for heavier parsers likeMarkerLoader(refer to this section for details) - GPU deployment: 16 GB GPU memory recommended (for systems with separate CPU and GPU memory)
- CPU deployment: Minimum 13 GiB RAM for light PDF parsers (
Installation and Configuration
Section titled βInstallation and Configurationβ1. Clone the repository:
Section titled β1. Clone the repository:βgit clone --recurse-submodules git@github.com:linagora/openrag.git
cd openrag/git checkout main # or a given release2. Create a .env File
Section titled β2. Create a .env FileβThe Docker Compose stack lives under infra/compose/, next to its .env.example template. Copy it to a .env in the same folder and fill in the blanks (LLM/VLM endpoints, embedder, and the required MinIO / Postgres secrets):
cd infra/composecp .env.example .envHere is the minimal set of variables to get started β see the full environment-variable reference for every other option:
# ============================================================================# OpenRAG β minimal .env## Only the variables you must set for the default compose stack to boot are# listed here. Every other knob (PDF/audio loaders, chunking, retriever,# reranker, Ray Serve, admin UI, OIDC/SSO, rate limiting, MCP server, web# search, β¦) has a sensible default and is documented in full at:## https://linagora.github.io/openrag/documentation/env_vars/# ============================================================================
# ββ LLM (external, OpenAI-compatible) βββββββββββββββββββββββββββββββββββββββBASE_URL=API_KEY=MODEL=LLM_SEMAPHORE=10
# ββ VLM (vision model, used for image understanding) ββββββββββββββββββββββββ# Can reuse the LLM values above if that model accepts images.VLM_BASE_URL=VLM_API_KEY=VLM_MODEL=VLM_SEMAPHORE=20
# ββ Embedder (HuggingFace model served by the bundled vLLM) βββββββββββββββββ# Point these at an external embedding service instead of the bundled vLLM:
EMBEDDER_MODEL_NAME=jinaai/jina-embeddings-v3# EMBEDDER_BASE_URL=http://vllm:8000/v1# EMBEDDER_API_KEY=EMPTY# MAX_MODEL_LEN=2047
# ββ Reranker (re-scores retrieved chunks; bundled Infinity server) βββββββββββRERANKER_PROVIDER=infinity # 'infinity' (bundled, default) or 'openai' (external endpoint)RERANKER_MODEL=Alibaba-NLP/gte-multilingual-reranker-baseRERANKER_ENABLED=true
## Point these at an external reranker instead of the bundled Infinity / VLLM(Openai) server:# RERANKER_BASE_URL=http://reranker:7997# RERANKER_API_KEY=EMPTY
# ββ PDF parser (default: PyMuPDF β lightweight, CPU-friendly) ββββββββββββββββ# Switch to MarkerLoader for OCR / scanned PDFs, complex layouts & embedded# images (heavier β more RAM/GPU). Other option: DoclingLoader.PDFLOADER=PyMuPDFLoader# Marker tuning (only when PDFLOADER=MarkerLoader):# MARKER_POOL_SIZE=1 # marker worker actors (β 1 per cluster node / Machine).# MARKER_MAX_PROCESSES=2 # concurrent PDFs per worker (raise with more GPU)
# ββ Image captioning & chunk contextualization (both ON by default) ββββββββββ# Both run during indexing and call the VLM/LLM β set to false to index# faster and cheaper (with some retrieval-quality trade-off).# IMAGE_CAPTIONING=false # stop describing images in documents via the VLM# CONTEXTUAL_RETRIEVAL=false # stop prepending LLM-generated context to each chunk (Anthropic technique)
# ββ Secrets β dev defaults so the stack boots out of the box βββββββββββββββββ# β οΈ Production: replace these with strong values, e.g. `openssl rand -hex 16`.# MINIO_* are shared by the minio service and Milvus β both sides must match.MINIO_ACCESS_KEY=minioadminMINIO_SECRET_KEY=minioadminPOSTGRES_PASSWORD=postgres# POSTGRES_USER=root
# ββ API and Chainlit (chat interface) authentication ββββββββββββββββββββββββββββββ# Bearer token that bootstraps the admin user and guards the API.# β οΈ Production: replace with a strong value, e.g. `openssl rand -hex 16`.# For SSO instead, see https://linagora.github.io/openrag/documentation/oidc/AUTH_TOKEN=or-openrag-1234# AUTH_MODE=token # 'token' (default) or 'oidc' for SSO# SUPER_ADMIN_MODE=true
# # FastAPI port (the API and Chainlit chat interface share the same port).# APP_PORT=8080
# # Rate limiting, activated by default (recommended).# RATE_LIMIT_ENABLED=false
# ββββββββββββββββ Chainlit: Chat interface ββββββββββββββββ# Session-cookie signing secret β required once auth is enabled; keep it stable.# β οΈ Production: replace with a generated value:# python -c "import secrets; print(secrets.token_urlsafe(32))"CHAINLIT_AUTH_SECRET=openrag-dev-secret
# ββββββββββββββββ Admin / Indexer UI (React SPA) ββββββββββββββββ# Host port for the admin UI β the document ingestion, indexing & management# interface, served at http://<host>:<ADMIN_UI_PORT>/app/. It also proxies the# API/auth, so it is the OIDC front door. Zero-config otherwise (same-origin, no# CORS); VITE_* build-time options are documented in the env vars reference.# ADMIN_UI_PORT=8081
# ββ Ray (kept as-is by the compose stack; see the docs for what each does) βββRAY_DEDUP_LOGS=0RAY_ENABLE_RECORD_ACTOR_TASK_LOGGING=1RAY_task_retry_delay_ms=3000RAY_ENABLE_UV_RUN_RUNTIME_ENV=0
# RAY_memory_monitor_refresh_ms=0
# ββ Logging (DEBUG on dev, INFO on prod) ββLOG_LEVEL=DEBUG3. File Parser configuration
Section titled β3. File Parser configurationβAll supported file format parsers are pre-configured. For PDF processing, PyMuPDFLoader is the default parser β a lightweight, fast, CPU-friendly engine well suited to searchable PDFs and quick local testing.
4. Run OpenRAG
Section titled β4. Run OpenRAGβAll deployment assets now live under infra/:
Directoryinfra/
Directorycompose/ full stack (recommended)
- docker-compose.yaml
- .env.example
- .env your configured env
Directorydocker/ Dockerfiles
- β¦
Directoryansible/ remote deployment
- β¦
Directoryopenrag/ application code
- β¦
Directoryconf/ YAML configuration
- β¦
Run the stack from infra/compose/, where the .env you just created lives. Use the GPU tab on a machine with an NVIDIA GPU, or the CPU tab otherwise.
cd infra/composedocker compose up -d
# stop it later with:# docker compose downcd infra/composedocker compose --profile cpu up -d
# stop it later with:# docker compose --profile cpu downInference services
Section titled βInference servicesβThe LLM and VLM are always external OpenAI-compatible endpoints β set BASE_URL/MODEL/API_KEY (and the VLM_* equivalents) in .env.
The embedder and reranker, by contrast, are bundled: docker compose up -d starts a vllm container serving EMBEDDER_MODEL_NAME and a reranker container (RERANKER_PROVIDER, default Infinity). No extra step is needed to use them.
cd infra/composedocker compose up -d # GPU β core stack + bundled embedder & reranker# docker compose --profile cpu up -d # CPU-only hostTo use external embedding/reranking instead β reusing existing inference servers and keeping the footprint small:
- Embedder β set
EMBEDDER_BASE_URL(+EMBEDDER_API_KEY) to your endpoint, then stop the local server by commenting out thevllm-gpu/vllm-cpuservice ininfra/compose/docker-compose.yaml. - Reranker β set
RERANKER_ENABLED=falseto skip reranking, or point it at an endpoint withRERANKER_PROVIDER=openaiandRERANKER_BASE_URL(+RERANKER_API_KEY); to also stop the container, comment out theextern/reranker/β¦line in theinclude:block.
Once the app is up and running, you can access the provided services β see Default ports below.
Ansible
Section titled βAnsibleβClone the repository, then run the deployment script from infra/ansible/ and follow the interactive prompts:
git clone --recurse-submodules https://github.com/linagora/openrag.gitcd openrag/infra/ansible./deploy.shDefault ports
Section titled βDefault portsβOnce the stack is up, OpenRAG exposes the following services by default:
| Service | Port | Description |
|---|---|---|
| API Documentation | 8080/docs | Main FastAPI for document ingestion and querying. See this |
| Chainlit UI | 8080/chainlit | User interface for interacting with the RAG system |
| Ray Dashboard | 8265 | Ray dashboard for monitoring and managing tasks |
| Admin UI | 8081/app/ | Main user interface for indexing and viewing indexed documents |
More information about each service is available in its respective documentation page.