Configuration and Deployment
Ragty backend settings use the M8TY_RAGTY_ prefix and are read from environment variables or backend/.env. Frontend routing has a separate build-time base-path setting.
Required backend settings
These values have no application default and must be supplied to the backend and worker. They are the only settings that are always mandatory; every other setting below is optional (its default applies) or conditional (required only in the noted situation), as marked in the Required column of each table.
Variable | Purpose |
|---|---|
| Signs local session JWTs |
| Async SQLAlchemy PostgreSQL URL |
| Direct Redis endpoint, or Redis data-node credentials/TLS/database settings when Sentinel is enabled |
| S3-compatible object-storage endpoint |
| Object-storage access key |
| Object-storage secret key |
| Master material used to encrypt stored provider and connector credentials |
When M8TY_RAGTY_APP_ENV=production, the JWT and credential-encryption secrets must each contain at least 32 characters. Keep all secrets in a secret manager or Kubernetes Secret, never in a frontend variable or image layer.
Application and authentication
The Required column states whether a value must be supplied. "No" means the listed default applies when unset. "Conditional" means it is required only in the noted situation.
Variable | Required | Description | Default |
|---|---|---|---|
| No |
|
|
| No | Application log level |
|
| No | FastAPI root path when the backend is externally mounted under a prefix | empty |
| No (recommended in production) | Canonical browser-visible frontend URL used for invitations and OAuth callbacks |
|
| No |
|
|
| Conditional — required in | OIDC issuer | empty |
| No | Expected OIDC audience |
|
| No | Allow public local account registration |
|
| No | Create an unknown validated OIDC identity on first login |
|
| No — set with the password to seed the first superadmin | First platform-superadmin email | empty |
| Conditional — required with the bootstrap email | Bootstrap password, at least 12 characters | empty |
| No | Bootstrap display name |
|
| No | Maximum direct document-upload size in bytes (range 1 KiB–1 GiB) |
|
| No | Enable the main-API HTTP rate limiter (fails closed with |
|
| No | Requests per rolling 60s window per caller (range 1–100000) |
|
| No | Argon2id iterations for password hashing (range 1–10) |
|
| No | Argon2id memory cost in KiB (range 8192–1048576) |
|
| No | Argon2id parallelism lanes (range 1–16) |
|
| No | Comma-separated internal CIDR allowlist for the web crawler/SSRF guard; loopback, link-local, and metadata ranges stay blocked | empty |
Bootstrap email and password must be configured together. Bootstrap is available only in local or both mode, not pure oidc mode. Legacy bcrypt password hashes remain verifiable and are upgraded to Argon2id on the next successful login.
Storage and vector backend
Variable | Required | Description | Default |
|---|---|---|---|
| No | Qdrant URL; an empty value selects PostgreSQL/pgvector | empty |
| No | Qdrant collection |
|
| No | S3 signing region |
|
| No | Document-artifact bucket |
|
PostgreSQL remains required when Qdrant is enabled because it stores application metadata and authorization state. The default Compose deployment uses pgvector/pgvector:pg16 and does not start a Qdrant container.
Redis and workers
Variable | Required | Description | Default |
|---|---|---|---|
| No | Comma-separated Sentinel | empty |
| Conditional — used when Sentinel nodes are set | Sentinel master group |
|
| No | Optional password for Sentinel control connections | empty |
| No | Prefix for Ragty-owned Redis keys and the ARQ queue |
|
| No | Process-count setting for deployment launchers that consume it; the direct ARQ command starts one process |
|
| No | Concurrent jobs per ARQ worker |
|
| No | Maximum runtime for one document-processing job (must be positive) |
|
| No | Processing-lease refresh interval (must be lower than the lease timeout) |
|
| No | Stale-processing lease timeout (must be below job timeout + ARQ's 10s grace) |
|
| No | Concurrent GPU parsing work |
|
The worker health key belongs to the namespaced ARQ queue and is refreshed every 10 seconds. A shutting-down worker removes its registration; another running worker can then create the key on its next health interval. The processing-health endpoint reports availability, not the exact replica count.
Models and observability
Variable | Required | Description | Default |
|---|---|---|---|
| No | Optional fallback key for OpenAI embeddings | empty |
| No | Ollama endpoint |
|
| No | Optional LiteLLM/OpenAI-compatible endpoint |
|
| No | Optional LiteLLM key | empty |
| No | Optional Langfuse public key | empty |
| No | Optional Langfuse secret key | empty |
| No | Langfuse host |
|
| No | Additional exact operator-allowlisted hosts for custom model, provider-verification, reranker, ingestion-provider, and Langfuse endpoints; non-allowlisted hosts fail closed | empty |
Provider and model records configured in Settings → Providers take precedence for their respective workloads.
Email and connector OAuth
Variable | Required | Description | Default |
|---|---|---|---|
| No | Enable invitation email |
|
| Conditional — required when SMTP is enabled | SMTP host | empty |
| No | SMTP port |
|
| No | SMTP username | empty |
| No | SMTP password | empty |
| Conditional — required when SMTP is enabled | Sender address | empty |
| No | Enable SMTP TLS |
|
OAuth connectors use matching M8TY_RAGTY_<PROVIDER>_OAUTH_CLIENT_ID and M8TY_RAGTY_<PROVIDER>_OAUTH_CLIENT_SECRET pairs. All OAuth client settings are optional and default to empty; the corresponding OAuth flow returns an error only when its client is required but unset. Supported provider prefixes are GOOGLE, SLACK, CONFLUENCE, JIRA, BOX, GITHUB, and DROPBOX.
Delegated end-user isolation
These settings gate and tune delegated end-user isolation. They are consumed by both the API and the ingestion worker, and the trusted registry is server-owned deployment configuration — never accept registry fields from request parameters or manifests. The feature is off by default; enabling it requires a non-empty trusted issuer registry and verified ownership storage, or startup fails closed.
Variable | Required | Description | Default |
|---|---|---|---|
| No | Single on/off gate. When |
|
| Conditional — required when | JSON array of trusted issuers; each entry requires |
|
| No | Raw-subject UTF-8 size limit before hashing (range 1–4096) |
|
| No | Maximum encoded end-user assertion size (range 1024–65536) |
|
| No | Request-header budget for delegated auth; must be ≥ the assertion limit (range 1024–131072) |
|
| No | Assertion time-claim allowance (range 0–300) |
|
| No | Connect timeout for pinned JWKS requests (0 < value ≤ 30) |
|
| No | Read timeout for pinned JWKS responses (0 < value ≤ 30) |
|
| No | Successful-JWKS cache TTL (range 30–3600) |
|
| No | JWKS response size limit; oversized responses fail closed (range 1024–5242880) |
|
The raw external subject and JWTs are never logged or persisted; startup diagnostics identify only safe issuer IDs, the enabled flag, and validation categories. Prepare and verify ownership storage with backend/scripts/migrate_delegated_subject_storage.py before setting M8TY_RAGTY_DELEGATED_ENABLED=true. Disabling the flag after delegated documents exist would re-expose them to member searches, so treat activation as one-way in production.
Frontend settings
Variable | Phase | Required | Description | Default |
|---|---|---|---|---|
| Build time | No | Next.js base path such as | empty |
| Runtime, server side | No | Internal backend URL used by the Next.js administration proxy |
|
Browser administration calls are same-origin requests to <base-path>/admin-api/*. Do not expose the internal backend URL through a NEXT_PUBLIC_* variable.
HTTP boundaries
Boundary | Path | Exposure |
|---|---|---|
Frontend and administration proxy |
| Browser-facing |
Public integrations |
| Externally routable where required |
MCP Streamable HTTP |
| Externally routable for MCP clients |
Health |
| Probe or operations boundary |
Internal administration API |
| Reached through the frontend proxy; do not publish as the browser API |
/mcp redirects to /mcp/ because the MCP server is mounted as a sub-application. Configure clients with the trailing slash to avoid redirect-sensitive POST behavior.
Run with Docker Compose
Use this procedure for a local development or evaluation installation. The Compose defaults contain development credentials and must not be reused for a production deployment.
1. Install prerequisites
Install:
Docker Engine with the Docker Compose plugin, or Docker Desktop;
curlandunzipto prepare the DeepDoc model build context;enough free disk space for the container images, model assets, and persistent PostgreSQL and MinIO data.
Run all following commands from the Ragty repository root—the directory that contains docker-compose.yml.
2. Download DeepDoc assets
The backend image is intentionally built for offline model execution. The ignored backend/deepdoc-models/ build context must therefore exist before the first build.
These are the same model and Natural Language Toolkit (NLTK) resources prepared by the GitLab image-build job. Repeat the download only when the model bundle is missing or deliberately refreshed.
3. Configure the first administrator
A fresh database has no login account, and public registration is disabled by default. Create a repository-root .env file with the initial administrator:
Docker Compose reads this .env file for variable interpolation. It is ignored by Git and must remain local. Bootstrap runs only while the user table is empty; later restarts do not reset the account or password.
4. Build and start the stack
The first build can take several minutes because it installs the parser stack and copies the offline model bundle. The current Compose file starts:
Service | Host port | Purpose |
|---|---|---|
|
| Next.js UI and same-origin administration proxy |
|
| FastAPI application, public API, and MCP |
| none | ARQ parsing and data-source synchronization |
|
| Relational metadata and default pgvector store |
|
| Queue, worker health, and application cache |
|
| S3-compatible artifacts |
Inside Compose, use service DNS names such as postgres, redis, and minio. A provider running on the Docker host may require host.docker.internal; a provider in Compose should use its service name.
5. Verify startup
A healthy default installation returns:
Open http://localhost:8080 and sign in with the bootstrap email and password. MinIO's administration console is available at http://localhost:9001 with the development credentials minioadmin/minioadmin.
If a service does not become healthy, inspect the API, worker, and frontend logs:
Press Ctrl+C to stop following logs; the containers keep running in detached mode.
Rebuild or restart
Rebuild after pulling application or dependency changes:
Restart existing containers without rebuilding images:
Stop or reset
Stop containers while preserving PostgreSQL and MinIO named volumes:
To remove the local database and uploaded artifacts as well, explicitly delete the named volumes:
The --volumes form is destructive. The next start creates an empty database and runs bootstrap again from the configured environment.
Optional Qdrant backend
The supplied Compose stack uses pgvector and does not contain a Qdrant service. To use Qdrant, add a local docker-compose.override.yml that starts or reaches Qdrant and passes M8TY_RAGTY_QDRANT_URL to both backend and worker:
The override file is ignored by Git. Pin the Qdrant image version and replace all development credentials before using a derivative configuration outside a local environment. PostgreSQL remains required for Ragty application data.
Reverse proxies and base paths
Frontend and backend prefixes are independent:
Build the frontend with
NEXT_PUBLIC_BASE_PATH=/ragtywhen it is served at/ragty.Set
M8TY_RAGTY_FRONTEND_URL=https://example.com/ragtyso generated links and OAuth callbacks use the canonical public URL.Keep
M8TY_RAGTY_BACKEND_URL=http://backend:8000unprefixed when the frontend proxy reaches the backend over the internal network.Set
M8TY_RAGTY_ROOT_PATHonly when FastAPI itself is externally mounted beneath a prefix.
Preserve the frontend base path when proxying to Next.js. For example, a trailing slash on this proxy_pass would strip /ragty and is therefore intentionally omitted:
Terminate TLS at the trusted ingress or reverse proxy and overwrite forwarded host and protocol headers there. Register OAuth callback URLs against the same canonical hostname and frontend base path.
Kubernetes guidance
Scale stateless backend replicas behind a service.
Scale worker replicas by queue demand while keeping per-worker GPU concurrency bounded.
Use managed PostgreSQL, Redis/Sentinel, and object storage where availability requirements justify it.
Give Qdrant persistent storage when it is selected as the vector backend.
Route only the documented public boundaries; keep
/admin-api/v1/*internal.Use
GET /healthfor the backend readiness signal and the internalGET /admin-api/v1/health/processingendpoint for worker availability.
Health responses
GET /health reports the selected vector backend after initialization:
If vector-store initialization failed, it reports a degraded result: