diff --git a/.env.example b/.env.example index a5b110bc..21fda238 100644 --- a/.env.example +++ b/.env.example @@ -1,38 +1,4 @@ -# make one like so https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key -LANGFLOW_SECRET_KEY= -# flow ids for chat and ingestion flows -LANGFLOW_CHAT_FLOW_ID=1098eea1-6649-4e1d-aed1-b77249fb8dd0 -LANGFLOW_INGEST_FLOW_ID=5488df7c-b93f-4f87-a446-b67028bc0813 -# must match the hashed password in secureconfig, must change for secure deployment!!! -OPENSEARCH_PASSWORD= -# make here https://console.cloud.google.com/apis/credentials -GOOGLE_OAUTH_CLIENT_ID= -GOOGLE_OAUTH_CLIENT_SECRET= -# Azure app registration credentials for SharePoint/OneDrive -MICROSOFT_GRAPH_OAUTH_CLIENT_ID= -MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET= -# OPTIONAL: dns routable from google (etc.) to handle continous ingest (something like ngrok works). This enables continous ingestion -WEBHOOK_BASE_URL= - -OPENAI_API_KEY= - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= - -# OPTIONAL url for openrag link to langflow in the UI -LANGFLOW_PUBLIC_URL= - -# Langflow auth -LANGFLOW_AUTO_LOGIN=False -LANGFLOW_SUPERUSER= -LANGFLOW_SUPERUSER_PASSWORD= -LANGFLOW_NEW_USER_IS_ACTIVE=False -LANGFLOW_ENABLE_SUPERUSER_CLI=False - - - -# Ingestion Mode Configuration -# Options: "langflow" (default) or "openrag" -# - langflow: Use Langflow pipeline for document ingestion (upload -> ingest -> delete) -# - openrag: Use traditional OpenRAG processor for document ingestion -INGEST_MODE=langflow \ No newline at end of file +# Ingestion Configuration +# Set to true to disable Langflow ingestion and use traditional OpenRAG processor +# If unset or false, Langflow pipeline will be used (default: upload -> ingest -> delete) +DISABLE_INGEST_WITH_LANGFLOW=false diff --git a/Dockerfile.frontend b/Dockerfile.frontend index a60e3d34..f46b431d 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -11,7 +11,7 @@ RUN npm install COPY frontend/ ./ # Build frontend -RUN npm run build +RUN npm run build # Expose frontend port EXPOSE 3000 diff --git a/README.md b/README.md index d92fd65c..6f1ca8a0 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ cp .env.example .env - `LANGFLOW_INGEST_FLOW_ID`: ID of your Langflow ingestion flow **Ingestion Configuration:** -- `INGEST_MODE`: Controls how default documents are ingested (default: `langflow`) - - `langflow`: Uses Langflow pipeline for document ingestion (upload → ingest → delete) - - `openrag`: Uses traditional OpenRAG processor for document ingestion +- `DISABLE_INGEST_WITH_LANGFLOW`: Disable Langflow ingestion pipeline (default: `false`) + - `false` or unset: Uses Langflow pipeline (upload → ingest → delete) + - `true`: Uses traditional OpenRAG processor for document ingestion **Optional:** - `LANGFLOW_PUBLIC_URL`: Public URL for Langflow (default: `http://localhost:7860`) diff --git a/docker-compose-cpu.yml b/docker-compose-cpu.yml index 30bb2960..3fea0090 100644 --- a/docker-compose-cpu.yml +++ b/docker-compose-cpu.yml @@ -54,7 +54,7 @@ services: - LANGFLOW_SUPERUSER_PASSWORD=${LANGFLOW_SUPERUSER_PASSWORD} - LANGFLOW_CHAT_FLOW_ID=${LANGFLOW_CHAT_FLOW_ID} - LANGFLOW_INGEST_FLOW_ID=${LANGFLOW_INGEST_FLOW_ID} - - INGEST_MODE=${INGEST_MODE:-langflow} + - DISABLE_INGEST_WITH_LANGFLOW=${DISABLE_INGEST_WITH_LANGFLOW:-false} - OPENSEARCH_PORT=9200 - OPENSEARCH_USERNAME=admin - OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD} diff --git a/docker-compose.yml b/docker-compose.yml index a5a57446..85ca9512 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,6 +54,7 @@ services: - LANGFLOW_SUPERUSER_PASSWORD=${LANGFLOW_SUPERUSER_PASSWORD} - LANGFLOW_CHAT_FLOW_ID=${LANGFLOW_CHAT_FLOW_ID} - LANGFLOW_INGEST_FLOW_ID=${LANGFLOW_INGEST_FLOW_ID} + - DISABLE_INGEST_WITH_LANGFLOW=${DISABLE_INGEST_WITH_LANGFLOW:-false} - OPENSEARCH_PORT=9200 - OPENSEARCH_USERNAME=admin - OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD} diff --git a/src/config/settings.py b/src/config/settings.py index 8f7334c9..8dcdc18b 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -45,8 +45,8 @@ SESSION_SECRET = os.getenv("SESSION_SECRET", "your-secret-key-change-in-producti GOOGLE_OAUTH_CLIENT_ID = os.getenv("GOOGLE_OAUTH_CLIENT_ID") GOOGLE_OAUTH_CLIENT_SECRET = os.getenv("GOOGLE_OAUTH_CLIENT_SECRET") -# Ingestion mode configuration -INGEST_MODE = os.getenv("INGEST_MODE", "langflow").lower() # "langflow" or "openrag" +# Ingestion configuration +DISABLE_INGEST_WITH_LANGFLOW = os.getenv("DISABLE_INGEST_WITH_LANGFLOW", "false").lower() in ("true", "1", "yes") def is_no_auth_mode(): diff --git a/src/main.py b/src/main.py index 1a3e66cc..bfd03ea3 100644 --- a/src/main.py +++ b/src/main.py @@ -41,9 +41,9 @@ from auth_middleware import optional_auth, require_auth # Configuration and setup from config.settings import ( + DISABLE_INGEST_WITH_LANGFLOW, INDEX_BODY, INDEX_NAME, - INGEST_MODE, SESSION_SECRET, clients, is_no_auth_mode, @@ -227,7 +227,7 @@ async def init_index_when_ready(): async def ingest_default_documents_when_ready(services): """Scan the local documents folder and ingest files like a non-auth upload.""" try: - logger.info("Ingesting default documents when ready", ingest_mode=INGEST_MODE) + logger.info("Ingesting default documents when ready", disable_langflow_ingest=DISABLE_INGEST_WITH_LANGFLOW) base_dir = os.path.abspath(os.path.join(os.getcwd(), "documents")) if not os.path.isdir(base_dir): logger.info( @@ -249,10 +249,10 @@ async def ingest_default_documents_when_ready(services): ) return - if INGEST_MODE == "langflow": - await _ingest_default_documents_langflow(services, file_paths) - else: + if DISABLE_INGEST_WITH_LANGFLOW: await _ingest_default_documents_openrag(services, file_paths) + else: + await _ingest_default_documents_langflow(services, file_paths) except Exception as e: logger.error("Default documents ingestion failed", error=str(e))