Compare commits

..

No commits in common. "main" and "feat/configured-providers-in-models" have entirely different histories.

294 changed files with 27467 additions and 43181 deletions

View file

@ -2,14 +2,6 @@
# 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
# Langflow HTTP timeout configuration (in seconds)
# For large documents (300+ pages), ingestion can take 30+ minutes
# Increase these values if you experience timeouts with very large PDFs
# Default: 2400 seconds (40 minutes) total timeout, 30 seconds connection timeout
# LANGFLOW_TIMEOUT=2400
# LANGFLOW_CONNECT_TIMEOUT=30
# make one like so https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key
LANGFLOW_SECRET_KEY=
@ -25,7 +17,7 @@ NUDGES_FLOW_ID=ebc01d31-1976-46ce-a385-b0240327226c
# container startup from this value. Do not commit real secrets.
# must match the hashed password in secureconfig, must change for secure deployment!!!
# NOTE: if you set this by hand, it must be a complex password:
# The password must contain at least 8 characters, and must contain at least one uppercase letter, one lowercase letter, one digit, and one special character.
The password must contain at least 8 characters, and must contain at least one uppercase letter, one lowercase letter, one digit, and one special character.
OPENSEARCH_PASSWORD=
# Path to persist OpenSearch data (indices, documents, cluster state)
@ -40,36 +32,17 @@ GOOGLE_OAUTH_CLIENT_SECRET=
MICROSOFT_GRAPH_OAUTH_CLIENT_ID=
MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=
# AWS Access Key ID and Secret Access Key with access to your S3 instance
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# OPTIONAL: dns routable from google (etc.) to handle continous ingest (something like ngrok works). This enables continous ingestion
WEBHOOK_BASE_URL=
# Model Provider API Keys
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
OLLAMA_ENDPOINT=
WATSONX_API_KEY=
WATSONX_ENDPOINT=
WATSONX_PROJECT_ID=
# LLM Provider configuration. Providers can be "anthropic", "watsonx", "ibm" or "ollama".
LLM_PROVIDER=
LLM_MODEL=
# Embedding provider configuration. Providers can be "watsonx", "ibm" or "ollama".
EMBEDDING_PROVIDER=
EMBEDDING_MODEL=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# OPTIONAL url for openrag link to langflow in the UI
LANGFLOW_PUBLIC_URL=
# OPTIONAL: Override the full docling-serve URL (e.g., for remote instances)
# If not set, auto-detects host and uses port 5001
# DOCLING_SERVE_URL=http://my-docling-server:5001
# OPTIONAL: Override host for docling service (for special networking setups)
# HOST_DOCKER_INTERNAL=host.containers.internal
@ -79,10 +52,3 @@ LANGFLOW_SUPERUSER=
LANGFLOW_SUPERUSER_PASSWORD=
LANGFLOW_NEW_USER_IS_ACTIVE=False
LANGFLOW_ENABLE_SUPERUSER_CLI=False
# Langfuse tracing (optional)
# Get keys from https://cloud.langfuse.com or your self-hosted instance
LANGFUSE_SECRET_KEY=
LANGFUSE_PUBLIC_KEY=
# Leave empty for Langfuse Cloud, or set for self-hosted (e.g., http://localhost:3002)
LANGFUSE_HOST=

View file

@ -1,155 +0,0 @@
name: Bug Report
description: Report a bug or unexpected behavior in OpenRAG
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug! Please fill out the form below to help us understand and fix the issue.
- type: input
id: openrag-version
attributes:
label: OpenRAG Version
description: What version of OpenRAG are you using? Run `openrag --version` or check your package version.
placeholder: "e.g., 0.1.0"
validations:
required: true
- type: dropdown
id: deployment-method
attributes:
label: Deployment Method
description: How are you running OpenRAG?
options:
- uvx (uvx openrag)
- uv add (installed in project)
- Docker
- Podman
- Local development (make dev)
- Other
validations:
required: true
- type: input
id: os
attributes:
label: Operating System
description: What operating system are you using?
placeholder: "e.g., macOS 14.0, Ubuntu 22.04, Windows 11"
validations:
required: true
- type: input
id: python-version
attributes:
label: Python Version
description: What Python version are you using? Run `python --version` to check.
placeholder: "e.g., 3.13.0"
validations:
required: false
- type: dropdown
id: affected-area
attributes:
label: Affected Area
description: Which area(s) of OpenRAG does this bug affect? Select all that apply.
multiple: true
options:
- Ingestion (document processing, upload, Docling)
- Retrieval (search, OpenSearch, hybrid search)
- Chat (chat interface, conversations, AI responses)
- Knowledge Filters (partitions, document filtering)
- Settings (configuration, model providers)
- TUI (Terminal User Interface)
- Connectors (Google Drive, OneDrive, SharePoint)
- Frontend (Next.js UI, components)
- Backend/API (Python/Starlette)
- Infrastructure (Docker, OpenSearch, Langflow)
- SDK (Python or TypeScript SDK)
- Onboarding (setup wizard, initial configuration)
- Authentication (OIDC, API keys)
- Other
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: A clear and concise description of what the bug is.
placeholder: Describe the bug...
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
placeholder: What should have happened?
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: A clear and concise description of what actually happened.
placeholder: What actually happened?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant Logs
description: |
Please copy and paste any relevant log output.
You can get logs using `make logs` for Docker deployments or check the terminal output.
This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context about the problem here (e.g., browser version, specific document types, model provider being used).
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Please confirm the following before submitting.
options:
- label: I have searched existing issues to ensure this bug hasn't been reported before.
required: true
- label: I have provided all the requested information.
required: true

View file

@ -1,15 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: OpenRAG Documentation
url: https://docs.openr.ag/
about: Learn more about OpenRAG's features, installation, and configuration.
- name: Troubleshooting Guide
url: https://docs.openr.ag/support/troubleshoot
about: Check the troubleshooting guide for common issues and solutions.
- name: GitHub Discussions
url: https://github.com/langflow-ai/openrag/discussions
about: Ask questions and discuss ideas with the community.
- name: Contributing Guide
url: https://github.com/langflow-ai/openrag/blob/main/CONTRIBUTING.md
about: Learn how to contribute to OpenRAG development.

View file

@ -1,106 +0,0 @@
name: Documentation Issue
description: Report an issue with documentation or request new documentation
title: "[Docs]: "
labels: ["documentation"]
body:
- type: markdown
attributes:
value: |
Thanks for helping improve OpenRAG's documentation! Please provide details about the issue or your request.
- type: dropdown
id: issue-type
attributes:
label: Issue Type
description: What type of documentation issue is this?
options:
- Incorrect information
- Missing documentation
- Outdated content
- Unclear or confusing
- Typo or grammatical error
- Broken links
- Request for new documentation
- Other
validations:
required: true
- type: dropdown
id: doc-area
attributes:
label: Documentation Area
description: Which area of documentation does this relate to?
multiple: true
options:
- Getting Started / Quickstart
- Installation (uvx, Docker, Podman)
- Configuration / Settings
- Ingestion & Document Processing
- Search & Retrieval
- Chat Interface
- Knowledge Filters
- Connectors (Google Drive, OneDrive, SharePoint)
- TUI (Terminal User Interface)
- API Reference
- SDK Documentation (Python/TypeScript)
- Troubleshooting
- Contributing Guide
- Other
validations:
required: true
- type: input
id: doc-url
attributes:
label: Documentation URL
description: If applicable, provide a link to the specific documentation page.
placeholder: "https://docs.openr.ag/..."
validations:
required: false
- type: textarea
id: current-content
attributes:
label: Current Content
description: If reporting an issue, what does the documentation currently say?
placeholder: Quote or describe the current documentation content.
validations:
required: false
- type: textarea
id: issue-description
attributes:
label: Issue Description
description: Describe the problem or what documentation you'd like to see added.
placeholder: |
For issues: Explain what's wrong or confusing about the current documentation.
For requests: Describe what topic you'd like documented and why it would be helpful.
validations:
required: true
- type: textarea
id: suggested-content
attributes:
label: Suggested Content
description: If you have suggestions for how to fix or improve the documentation, please share them.
placeholder: Provide suggested text, corrections, or an outline for new documentation.
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context, screenshots, or examples here.
validations:
required: false
- type: checkboxes
id: contribution
attributes:
label: Contribution
description: Would you be interested in contributing to fix this documentation issue?
options:
- label: I would be willing to submit a pull request to fix this issue.
required: false

View file

@ -1,113 +0,0 @@
name: Feature Request
description: Suggest a new feature or enhancement for OpenRAG
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a feature! Please provide as much detail as possible to help us understand your request.
- type: dropdown
id: feature-area
attributes:
label: Feature Area
description: Which area(s) of OpenRAG does this feature relate to?
multiple: true
options:
- Ingestion (document processing, upload, Docling)
- Retrieval (search, OpenSearch, hybrid search)
- Chat (chat interface, conversations, AI responses)
- Knowledge Filters (partitions, document filtering)
- Settings (configuration, model providers)
- TUI (Terminal User Interface)
- Connectors (Google Drive, OneDrive, SharePoint)
- Frontend (Next.js UI, components)
- Backend/API (Python/Starlette)
- Infrastructure (Docker, OpenSearch, Langflow)
- SDK (Python or TypeScript SDK)
- Onboarding (setup wizard, initial configuration)
- Authentication (OIDC, API keys)
- New Area
validations:
required: true
- type: textarea
id: problem-description
attributes:
label: Problem Description
description: Is your feature request related to a problem? Please describe.
placeholder: A clear and concise description of what the problem is. E.g., "I'm always frustrated when..."
validations:
required: true
- type: textarea
id: proposed-solution
attributes:
label: Proposed Solution
description: Describe the solution you'd like to see implemented.
placeholder: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use Case
description: Describe your use case and how this feature would benefit you or others.
placeholder: |
As a [type of user], I want [goal] so that [benefit].
Example: As a developer, I want to filter documents by custom metadata so that I can organize my knowledge base more effectively.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Describe any alternative solutions or features you've considered.
placeholder: What other approaches have you thought about? Why wouldn't they work as well?
validations:
required: false
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is this feature to your workflow?
options:
- Nice to have
- Would improve my workflow
- Critical for my use case
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context, mockups, screenshots, or examples about the feature request here.
validations:
required: false
- type: checkboxes
id: contribution
attributes:
label: Contribution
description: Would you be interested in contributing to this feature?
options:
- label: I would be willing to help implement this feature.
required: false
- label: I can help test this feature once implemented.
required: false
- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Please confirm the following before submitting.
options:
- label: I have searched existing issues and discussions to ensure this feature hasn't been requested before.
required: true

View file

@ -1,11 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "build(deps):"
include: scope

View file

@ -14,7 +14,6 @@ jobs:
outputs:
skip_release: ${{ steps.version.outputs.skip_release }}
version: ${{ steps.version.outputs.version }}
docker_version: ${{ steps.version.outputs.docker_version }}
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
steps:
- name: Checkout
@ -27,12 +26,6 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
# Normalize version per PEP 440 for Docker tags
# e.g., "0.1.53-rc2" -> "0.1.53rc2" to match Python's importlib.metadata
DOCKER_VERSION=$(echo "$VERSION" | sed -E 's/-?(rc|alpha|beta|dev|post)/\1/g')
echo "docker_version=$DOCKER_VERSION" >> $GITHUB_OUTPUT
echo "Docker Version: $DOCKER_VERSION"
# Check if tag already exists
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists, skipping release"
@ -60,58 +53,58 @@ jobs:
# backend
- image: backend
file: ./Dockerfile.backend
tag: langflowai/openrag-backend
tag: phact/openrag-backend
platform: linux/amd64
arch: amd64
runs-on: ubuntu-latest-16-cores
- image: backend
file: ./Dockerfile.backend
tag: langflowai/openrag-backend
tag: phact/openrag-backend
platform: linux/arm64
arch: arm64
runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]
runs-on: [self-hosted, linux, ARM64, langflow-ai-arm64-2]
# frontend
- image: frontend
file: ./Dockerfile.frontend
tag: langflowai/openrag-frontend
tag: phact/openrag-frontend
platform: linux/amd64
arch: amd64
runs-on: ubuntu-latest-16-cores
- image: frontend
file: ./Dockerfile.frontend
tag: langflowai/openrag-frontend
tag: phact/openrag-frontend
platform: linux/arm64
arch: arm64
runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]
runs-on: [self-hosted, linux, ARM64, langflow-ai-arm64-2]
# langflow
- image: langflow
file: ./Dockerfile.langflow
tag: langflowai/openrag-langflow
tag: phact/openrag-langflow
platform: linux/amd64
arch: amd64
runs-on: ubuntu-latest-16-cores
- image: langflow
file: ./Dockerfile.langflow
tag: langflowai/openrag-langflow
tag: phact/openrag-langflow
platform: linux/arm64
arch: arm64
runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]
runs-on: self-hosted
# opensearch
- image: opensearch
file: ./Dockerfile
tag: langflowai/openrag-opensearch
tag: phact/openrag-opensearch
platform: linux/amd64
arch: amd64
runs-on: ubuntu-latest-16-cores
- image: opensearch
file: ./Dockerfile
tag: langflowai/openrag-opensearch
tag: phact/openrag-opensearch
platform: linux/arm64
arch: arm64
runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]
runs-on: [self-hosted, linux, ARM64, langflow-ai-arm64-2]
runs-on: ${{ matrix.runs-on }}
@ -119,6 +112,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -136,7 +136,7 @@ jobs:
file: ${{ matrix.file }}
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ matrix.tag }}:${{ needs.check-version.outputs.docker_version }}-${{ matrix.arch }}
tags: ${{ matrix.tag }}:${{ steps.version.outputs.version }}-${{ matrix.arch }}
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.arch }}
@ -148,6 +148,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
@ -156,43 +162,43 @@ jobs:
- name: Create and push multi-arch manifests
run: |
VERSION=${{ needs.check-version.outputs.docker_version }}
VERSION=${{ steps.version.outputs.version }}
# Create versioned tags
docker buildx imagetools create -t langflowai/openrag-backend:$VERSION \
langflowai/openrag-backend:$VERSION-amd64 \
langflowai/openrag-backend:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-backend:$VERSION \
phact/openrag-backend:$VERSION-amd64 \
phact/openrag-backend:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-frontend:$VERSION \
langflowai/openrag-frontend:$VERSION-amd64 \
langflowai/openrag-frontend:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-frontend:$VERSION \
phact/openrag-frontend:$VERSION-amd64 \
phact/openrag-frontend:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-langflow:$VERSION \
langflowai/openrag-langflow:$VERSION-amd64 \
langflowai/openrag-langflow:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-langflow:$VERSION \
phact/openrag-langflow:$VERSION-amd64 \
phact/openrag-langflow:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-opensearch:$VERSION \
langflowai/openrag-opensearch:$VERSION-amd64 \
langflowai/openrag-opensearch:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-opensearch:$VERSION \
phact/openrag-opensearch:$VERSION-amd64 \
phact/openrag-opensearch:$VERSION-arm64
# Only update latest tags if version is numeric
if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then
echo "Updating latest tags for production release: $VERSION"
docker buildx imagetools create -t langflowai/openrag-backend:latest \
langflowai/openrag-backend:$VERSION-amd64 \
langflowai/openrag-backend:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-backend:latest \
phact/openrag-backend:$VERSION-amd64 \
phact/openrag-backend:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-frontend:latest \
langflowai/openrag-frontend:$VERSION-amd64 \
langflowai/openrag-frontend:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-frontend:latest \
phact/openrag-frontend:$VERSION-amd64 \
phact/openrag-frontend:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-langflow:latest \
langflowai/openrag-langflow:$VERSION-amd64 \
langflowai/openrag-langflow:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-langflow:latest \
phact/openrag-langflow:$VERSION-amd64 \
phact/openrag-langflow:$VERSION-arm64
docker buildx imagetools create -t langflowai/openrag-opensearch:latest \
langflowai/openrag-opensearch:$VERSION-amd64 \
langflowai/openrag-opensearch:$VERSION-arm64
docker buildx imagetools create -t phact/openrag-opensearch:latest \
phact/openrag-opensearch:$VERSION-amd64 \
phact/openrag-opensearch:$VERSION-arm64
else
echo "Skipping latest tags - version: $VERSION (not numeric)"
fi
@ -206,13 +212,20 @@ jobs:
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Build wheel and source distribution
run: |
uv build
@ -235,8 +248,8 @@ jobs:
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check-version.outputs.version }}
name: Release ${{ needs.check-version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
draft: false
prerelease: ${{ needs.check-version.outputs.is_prerelease }}
generate_release_notes: true
@ -246,8 +259,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
run: |
uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
# - name: Publish to PyPI
# run: |
# uv publish
# env:
# UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}

View file

@ -1,66 +0,0 @@
name: "CodeQL"
on:
push:
branches: [ 'main' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ 'main' ]
schedule:
- cron: '17 2 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View file

@ -1,60 +0,0 @@
name: Dependency Audit
on:
schedule:
# Run Monday, Thursday at 9am UTC
- cron: '0 9 * * 1,4'
workflow_dispatch: # Allow manual trigger
jobs:
npm-audit:
name: NPM Audit
runs-on: ubuntu-latest
strategy:
matrix:
directory: ['frontend', 'docs', 'sdks/typescript']
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run npm audit
working-directory: ${{ matrix.directory }}
run: |
echo "::group::NPM Audit for ${{ matrix.directory }}"
npm audit --audit-level=moderate || echo "::warning::NPM audit found vulnerabilities in ${{ matrix.directory }}"
echo "::endgroup::"
- name: Check for outdated packages
working-directory: ${{ matrix.directory }}
run: |
echo "::group::Outdated packages in ${{ matrix.directory }}"
npm outdated || true
echo "::endgroup::"
python-audit:
name: Python Audit
runs-on: ubuntu-latest
strategy:
matrix:
directory: ['.', 'sdks/python']
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install pip-audit
run: pip install pip-audit
- name: Run pip-audit
working-directory: ${{ matrix.directory }}
run: |
echo "::group::Python Audit for ${{ matrix.directory }}"
pip-audit --desc || echo "::warning::pip-audit found vulnerabilities in ${{ matrix.directory }}"
echo "::endgroup::"

View file

@ -23,9 +23,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.20.0
cache: npm
cache-dependency-path: ./docs/package-lock.json
node-version: 20
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Validate Branch Names
run: |
@ -74,14 +74,14 @@ jobs:
echo "url=${{ vars.DOCS_DRAFT_BASE_URL }}/langflow-drafts/${{ steps.extract_branch.outputs.draft_directory }}/index.html" >> $GITHUB_OUTPUT
- name: Install dependencies
run: cd docs && npm install
run: cd docs && yarn install
- name: Build website
if: success()
run: |
set -o pipefail
cd docs
npm run build |& tee $GITHUB_WORKSPACE/build.log
yarn build |& tee $GITHUB_WORKSPACE/build.log
env:
BASE_URL: /langflow-drafts/${{ steps.extract_branch.outputs.draft_directory }}
FORCE_COLOR: 0 # Disable color output

View file

@ -16,14 +16,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.20.0
cache: npm
cache-dependency-path: ./docs/package-lock.json
node-version: 20
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Install dependencies
run: cd docs && npm install
run: cd docs && yarn install
- name: Build website
run: cd docs && npm run build
run: cd docs && yarn build
# env:
# SEGMENT_PUBLIC_WRITE_KEY: ${{ vars.DOCS_PROD_SEGMENT_PUBLIC_WRITE_KEY }}

View file

@ -1,59 +0,0 @@
name: Publish Python SDK
on:
push:
branches:
- main
paths:
- 'sdks/python/pyproject.toml'
workflow_dispatch:
jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/python
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if version already published
id: check
run: |
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://pypi.org/pypi/openrag-sdk/${{ steps.version.outputs.version }}/json)
if [ "$HTTP_STATUS" = "200" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Build package
if: steps.check.outputs.exists == 'false'
run: uv build
- name: Publish to PyPI
if: steps.check.outputs.exists == 'false'
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
- name: Skip publish (version exists)
if: steps.check.outputs.exists == 'true'
run: echo "Version ${{ steps.version.outputs.version }} already exists on PyPI, skipping publish"

View file

@ -1,64 +0,0 @@
name: Publish TypeScript SDK
on:
push:
branches:
- main
paths:
- 'sdks/typescript/package.json'
workflow_dispatch:
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: sdks/typescript
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Update npm to latest
run: npm install -g npm@latest
- name: Extract version from package.json
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if version already published
id: check
run: |
if npm view openrag-sdk@${{ steps.version.outputs.version }} version 2>/dev/null; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
if: steps.check.outputs.exists == 'false'
run: npm ci
- name: Build
if: steps.check.outputs.exists == 'false'
run: npm run build
- name: Publish to npm
if: steps.check.outputs.exists == 'false'
run: npm publish --access public --provenance
- name: Skip publish (version exists)
if: steps.check.outputs.exists == 'true'
run: echo "Version ${{ steps.version.outputs.version }} already exists on npm, skipping publish"

View file

@ -7,7 +7,6 @@ on:
- 'tests/**.py'
- 'pyproject.toml'
- 'uv.lock'
- 'sdks/**'
- '.github/workflows/test-integration.yml'
workflow_dispatch:
inputs:
@ -15,7 +14,7 @@ on:
description: 'Build images locally instead of pulling from DockerHub'
required: false
type: boolean
default: true
default: false
jobs:
tests:
@ -28,47 +27,24 @@ jobs:
LANGFLOW_NEW_USER_IS_ACTIVE: "True"
LANGFLOW_ENABLE_SUPERUSER_CLI: "True"
LANGFLOW_CHAT_FLOW_ID: ${{ vars.LANGFLOW_CHAT_FLOW_ID || '1098eea1-6649-4e1d-aed1-b77249fb8dd0' }}
LANGFLOW_INGEST_FLOW_ID: ${{ vars.LANGFLOW_INGEST_FLOW_ID || '5488df7c-b93f-4f87-a446-b67028bc0813' }}
NUDGES_FLOW_ID: ${{ vars.NUDGES_FLOW_ID || 'ebc01d31-1976-46ce-a385-b0240327226c' }}
steps:
- run: df -h
- name: Cleanup Docker cache
run: |
docker system prune -af || true
docker builder prune -af || true
docker-compose -f docker-compose.yml down -v --remove-orphans || true
- name: Cleanup root-owned files (OpenSearch data, config)
run: |
for i in 1 2 3; do
docker run --rm -v $(pwd):/work alpine sh -c "rm -rf /work/opensearch-data /work/config" && break
echo "Attempt $i failed, retrying in 5s..."
sleep 5
done || true
#- name: "node-cleanup"
#run: |
# sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
# sudo docker image prune --all --force
# sudo docker builder prune -a
- run: df -h
- name: Checkout
uses: actions/checkout@v4
- name: Verify workspace
run: |
echo "Current directory: $(pwd)"
echo "Workspace: ${GITHUB_WORKSPACE}"
ls -la
- name: Set up UV
uses: astral-sh/setup-uv@v3
with:
version: latest
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Python version
run: uv python install 3.13
@ -88,10 +64,7 @@ jobs:
# Disable startup ingest noise unless a test enables it
DISABLE_STARTUP_INGEST: "true"
run: |
# For PRs, always build locally since we're testing new code
# For workflow_dispatch, use the input (defaults to true)
USE_LOCAL="${{ inputs.use_local_images }}"
if [ "${{ github.event_name }}" == "pull_request" ] || [ "$USE_LOCAL" != "false" ]; then
if [ "${{ inputs.use_local_images }}" == "true" ]; then
echo "Running tests with locally built images..."
make test-ci-local
else

View file

@ -1,52 +0,0 @@
name: Update uv.lock on version bump
on:
push:
branches:
- main
paths:
- 'pyproject.toml'
workflow_dispatch:
jobs:
update-lock:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Update uv.lock
run: uv sync
- name: Check for changes
id: changes
run: |
if git diff --quiet uv.lock; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No changes to uv.lock"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "uv.lock has been updated"
fi
- name: Commit and push uv.lock
if: steps.changes.outputs.changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add uv.lock
git commit -m "chore: update uv.lock after version bump [skip ci]"
git push

5
.gitignore vendored
View file

@ -17,9 +17,6 @@ wheels/
1001*.pdf
*.json
!**/package.json
!**/package-lock.json
!**/tsconfig.json
!flows/*.json
!src/tui/_assets/flows/*.json
!src/tui/_assets/flows/components/*.json
@ -32,5 +29,3 @@ config/
# OpenSearch data directory
opensearch-data/
node_modules

View file

@ -1,7 +0,0 @@
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline", "--exclude-lines", "code_hash"]

View file

@ -1,180 +0,0 @@
{
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "GitLabTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "IPPublicDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "OpenAIDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "PypiTokenDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TelegramBotTokenDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.regex.should_exclude_file",
"pattern": [
"flows/.*\\.json$"
]
},
{
"path": "detect_secrets.filters.regex.should_exclude_line",
"pattern": [
"code_hash"
]
}
],
"results": {
"docs/docs/_partial-integrate-chat.mdx": [
{
"type": "Secret Keyword",
"filename": "docs/docs/_partial-integrate-chat.mdx",
"hashed_secret": "e42fd8b9ad15d8fa5f4718cad7cf19b522807996",
"is_verified": false,
"line_number": 30
}
],
"src/main.py": [
{
"type": "Base64 High Entropy String",
"filename": "src/main.py",
"hashed_secret": "131a83e9ef8660d7dd0771da7ce5954d9ea801ee",
"is_verified": false,
"line_number": 404
}
],
"src/models/processors.py": [
{
"type": "Base64 High Entropy String",
"filename": "src/models/processors.py",
"hashed_secret": "131a83e9ef8660d7dd0771da7ce5954d9ea801ee",
"is_verified": false,
"line_number": 763
}
],
"src/services/langflow_file_service.py": [
{
"type": "Base64 High Entropy String",
"filename": "src/services/langflow_file_service.py",
"hashed_secret": "131a83e9ef8660d7dd0771da7ce5954d9ea801ee",
"is_verified": false,
"line_number": 97
}
]
},
"generated_at": "2025-12-09T20:33:13Z"
}

View file

@ -1,79 +1,18 @@
########################################
# Stage 1: Upstream OpenSearch with plugins
########################################
FROM opensearchproject/opensearch:3.2.0 AS upstream_opensearch
# Remove plugins
RUN opensearch-plugin remove opensearch-neural-search || true && \
opensearch-plugin remove opensearch-knn || true && \
# removing this one due to Netty CVE-2025-58056, can bring it back in the future
opensearch-plugin remove opensearch-security-analytics || true
# Prepare jvector plugin artifacts
RUN mkdir -p /tmp/opensearch-jvector-plugin && \
curl -L -s https://github.com/opensearch-project/opensearch-jvector/releases/download/3.2.0.0/artifacts.tar.gz \
| tar zxvf - -C /tmp/opensearch-jvector-plugin
# Prepare neural-search plugin
RUN mkdir -p /tmp/opensearch-neural-search && \
curl -L -s https://storage.googleapis.com/opensearch-jvector/opensearch-neural-search-3.2.0.0-20251029200300.zip \
> /tmp/opensearch-neural-search/plugin.zip
# Install additional plugins
RUN opensearch-plugin install --batch file:///tmp/opensearch-jvector-plugin/repository/org/opensearch/plugin/opensearch-jvector-plugin/3.2.0.0/opensearch-jvector-plugin-3.2.0.0.zip && \
opensearch-plugin install --batch file:///tmp/opensearch-neural-search/plugin.zip && \
opensearch-plugin install --batch repository-gcs && \
opensearch-plugin install --batch repository-azure && \
# opensearch-plugin install --batch repository-s3 && \
opensearch-plugin install --batch https://github.com/opensearch-project/opensearch-prometheus-exporter/releases/download/3.2.0.0/prometheus-exporter-3.2.0.0.zip
# Apply Netty patch
COPY patch-netty.sh /tmp/
RUN whoami && bash /tmp/patch-netty.sh
# Set permissions for OpenShift compatibility before copying
RUN chmod -R g=u /usr/share/opensearch
########################################
# Stage 2: UBI9 runtime image
########################################
FROM registry.access.redhat.com/ubi9/ubi:latest
FROM opensearchproject/opensearch:3.0.0
USER root
# Update packages and install required tools
# TODO bring back iostat somehow? sysstat isn't in ubi
# TODO bring back 'perf' package, but what did we need it for?
RUN dnf update -y && \
dnf install -y --allowerasing \
less procps-ng findutils sudo curl tar gzip shadow-utils which && \
dnf clean all
RUN echo y | dnf install less procps-ng findutils sysstat perf sudo
# Create opensearch user and group
ARG UID=1000
ARG GID=1000
ARG OPENSEARCH_HOME=/usr/share/opensearch
# Grant the opensearchuser sudo privileges
# 'wheel' is the sudo group in Amazon Linux
RUN usermod -aG wheel opensearch
WORKDIR $OPENSEARCH_HOME
# Change the sudoers file to allow passwordless sudo
RUN echo "opensearch ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN groupadd -g $GID opensearch && \
adduser -u $UID -g $GID -d $OPENSEARCH_HOME opensearch
# Grant the opensearch user sudo privileges (passwordless sudo)
RUN usermod -aG wheel opensearch && \
echo "opensearch ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Copy OpenSearch from the upstream stage
COPY --from=upstream_opensearch --chown=$UID:0 $OPENSEARCH_HOME $OPENSEARCH_HOME
ARG OPENSEARCH_VERSION=3.2.0
########################################
# Async-profiler (multi-arch like your original)
########################################
# Handle different architectures for async-profiler
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then \
export ASYNC_PROFILER_URL=https://github.com/async-profiler/async-profiler/releases/download/v4.0/async-profiler-4.0-linux-x64.tar.gz; \
elif [ "$TARGETARCH" = "arm64" ]; then \
@ -85,22 +24,32 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
curl -s -L $ASYNC_PROFILER_URL | tar zxvf - --strip-components=1 -C /opt/async-profiler && \
chown -R opensearch:opensearch /opt/async-profiler
# Create profiling script (as in your original Dockerfile)
RUN echo "#!/bin/bash" > /usr/share/opensearch/profile.sh && \
echo "export PATH=\$PATH:/opt/async-profiler/bin" >> /usr/share/opensearch/profile.sh && \
echo "echo 1 | sudo tee /proc/sys/kernel/perf_event_paranoid >/dev/null" >> /usr/share/opensearch/profile.sh && \
echo "echo 0 | sudo tee /proc/sys/kernel/kptr_restrict >/dev/null" >> /usr/share/opensearch/profile.sh && \
echo "asprof \$@" >> /usr/share/opensearch/profile.sh && \
chmod 777 /usr/share/opensearch/profile.sh
########################################
# Security config (OIDC/DLS) and setup script
########################################
RUN echo "#!/bin/bash" > /usr/share/opensearch/profile.sh
RUN echo "export PATH=\$PATH:/opt/async-profiler/bin" >> /usr/share/opensearch/profile.sh
RUN echo "echo 1 | sudo tee /proc/sys/kernel/perf_event_paranoid >/dev/null" >> /usr/share/opensearch/profile.sh
RUN echo "echo 0 | sudo tee /proc/sys/kernel/kptr_restrict >/dev/null" >> /usr/share/opensearch/profile.sh
RUN echo "asprof \$@" >> /usr/share/opensearch/profile.sh
# Copy OIDC and DLS security configuration (as root, like before)
RUN chmod 777 /usr/share/opensearch/profile.sh
# Copy OIDC and DLS security configuration (as root)
COPY securityconfig/ /usr/share/opensearch/securityconfig/
RUN chown -R opensearch:opensearch /usr/share/opensearch/securityconfig/
USER opensearch
RUN opensearch-plugin remove opensearch-neural-search
RUN opensearch-plugin remove opensearch-knn
# FIXME installing the prom exporter plugin ahead of time isn't compatible with the operator, for now
# RUN opensearch-plugin install https://github.com/Virtimo/prometheus-exporter-plugin-for-opensearch/releases/download/v2.18.0/prometheus-exporter-2.18.0.0.zip
RUN echo y | opensearch-plugin install https://repo1.maven.org/maven2/org/opensearch/plugin/opensearch-jvector-plugin/3.0.0.3/opensearch-jvector-plugin-3.0.0.3.zip
RUN echo y | opensearch-plugin install repository-gcs
RUN echo y | opensearch-plugin install repository-azure
RUN echo y | opensearch-plugin install repository-s3
# Create a script to apply security configuration after OpenSearch starts
RUN echo '#!/bin/bash' > /usr/share/opensearch/setup-security.sh && \
echo 'echo "Waiting for OpenSearch to start..."' >> /usr/share/opensearch/setup-security.sh && \
@ -121,18 +70,3 @@ RUN echo '#!/bin/bash' > /usr/share/opensearch/setup-security.sh && \
echo ' -key /usr/share/opensearch/config/kirk-key.pem' >> /usr/share/opensearch/setup-security.sh && \
echo 'echo "Security configuration applied successfully"' >> /usr/share/opensearch/setup-security.sh && \
chmod +x /usr/share/opensearch/setup-security.sh
########################################
# Final runtime settings
########################################
USER opensearch
WORKDIR $OPENSEARCH_HOME
ENV JAVA_HOME=$OPENSEARCH_HOME/jdk
ENV PATH=$PATH:$JAVA_HOME/bin:$OPENSEARCH_HOME/bin
# Expose ports
EXPOSE 9200 9300 9600 9650
ENTRYPOINT ["./opensearch-docker-entrypoint.sh"]
CMD ["opensearch"]

View file

@ -21,7 +21,7 @@ COPY pyproject.toml uv.lock ./
RUN uv sync
# Copy sample document and warmup script for docling
COPY openrag-documents/warmup_ocr.pdf ./
COPY documents/warmup_ocr.pdf ./
COPY warm_up_docling.py ./
RUN uv run docling-tools models download
RUN uv run python - <<'PY'

View file

@ -1,4 +1,4 @@
FROM node:20.20.0-slim
FROM node:18-slim
# Set working directory
WORKDIR /app

View file

@ -1,4 +1,4 @@
FROM langflowai/langflow-nightly:1.7.0.dev21
FROM langflowai/langflow-nightly:1.7.0.dev5
EXPOSE 7860

140
Makefile
View file

@ -11,7 +11,7 @@ ifneq (,$(wildcard .env))
endif
.PHONY: help dev dev-cpu dev-local infra stop clean build logs shell-backend shell-frontend install \
test test-integration test-ci test-ci-local test-sdk \
test test-integration test-ci test-ci-local \
backend frontend install-be install-fe build-be build-fe logs-be logs-fe logs-lf logs-os \
shell-be shell-lf shell-os restart status health db-reset flow-upload quick setup
@ -46,19 +46,15 @@ help:
@echo "Testing:"
@echo " test - Run all backend tests"
@echo " test-integration - Run integration tests (requires infra)"
@echo " test-ci - Start infra, run integration + SDK tests, tear down (uses DockerHub images)"
@echo " test-ci - Start infra, run integration tests, tear down (uses DockerHub images)"
@echo " test-ci-local - Same as test-ci but builds all images locally"
@echo " test-sdk - Run SDK integration tests (requires running OpenRAG at localhost:3000)"
@echo " lint - Run linting checks"
@echo ""
# Development environments
# Use centralized env file from TUI if it exists, otherwise fall back to local .env
OPENRAG_ENV_FILE := $(shell if [ -f ~/.openrag/tui/.env ]; then echo "--env-file ~/.openrag/tui/.env"; fi)
dev:
@echo "🚀 Starting OpenRAG with GPU support..."
docker compose $(OPENRAG_ENV_FILE) -f docker-compose.yml -f docker-compose.gpu.yml up -d
docker compose up -d
@echo "✅ Services started!"
@echo " Backend: http://localhost:8000"
@echo " Frontend: http://localhost:3000"
@ -68,7 +64,7 @@ dev:
dev-cpu:
@echo "🚀 Starting OpenRAG with CPU only..."
docker compose $(OPENRAG_ENV_FILE) up -d
docker compose -f docker-compose-cpu.yml up -d
@echo "✅ Services started!"
@echo " Backend: http://localhost:8000"
@echo " Frontend: http://localhost:3000"
@ -78,7 +74,7 @@ dev-cpu:
dev-local:
@echo "🔧 Starting infrastructure only (for local development)..."
docker compose $(OPENRAG_ENV_FILE) up -d opensearch dashboards langflow
docker compose up -d opensearch dashboards langflow
@echo "✅ Infrastructure started!"
@echo " Langflow: http://localhost:7860"
@echo " OpenSearch: http://localhost:9200"
@ -88,7 +84,7 @@ dev-local:
infra:
@echo "🔧 Starting infrastructure services only..."
docker compose $(OPENRAG_ENV_FILE) up -d opensearch dashboards langflow
docker compose up -d opensearch dashboards langflow
@echo "✅ Infrastructure services started!"
@echo " Langflow: http://localhost:7860"
@echo " OpenSearch: http://localhost:9200"
@ -96,7 +92,7 @@ infra:
infra-cpu:
@echo "🔧 Starting infrastructure services only..."
docker compose $(OPENRAG_ENV_FILE) up -d opensearch dashboards langflow
docker-compose -f docker-compose-cpu.yml up -d opensearch dashboards langflow
@echo "✅ Infrastructure services started!"
@echo " Langflow: http://localhost:7860"
@echo " OpenSearch: http://localhost:9200"
@ -105,13 +101,15 @@ infra-cpu:
# Container management
stop:
@echo "🛑 Stopping all containers..."
docker compose $(OPENRAG_ENV_FILE) down
docker compose down
docker compose -f docker-compose-cpu.yml down 2>/dev/null || true
restart: stop dev
clean: stop
@echo "🧹 Cleaning up containers and volumes..."
docker compose $(OPENRAG_ENV_FILE) down -v --remove-orphans
docker compose down -v --remove-orphans
docker compose -f docker-compose-cpu.yml down -v --remove-orphans 2>/dev/null || true
docker system prune -f
# Local development
@ -139,53 +137,50 @@ install-fe:
# Building
build:
@echo "Building all Docker images locally..."
docker build -t langflowai/openrag-opensearch:latest -f Dockerfile .
docker build -t langflowai/openrag-backend:latest -f Dockerfile.backend .
docker build -t langflowai/openrag-frontend:latest -f Dockerfile.frontend .
docker build -t langflowai/openrag-langflow:latest -f Dockerfile.langflow .
@echo "🔨 Building Docker images..."
docker compose build
build-be:
@echo "Building backend image..."
docker build -t langflowai/openrag-backend:latest -f Dockerfile.backend .
@echo "🔨 Building backend image..."
docker build -t openrag-backend -f Dockerfile.backend .
build-fe:
@echo "Building frontend image..."
docker build -t langflowai/openrag-frontend:latest -f Dockerfile.frontend .
@echo "🔨 Building frontend image..."
docker build -t openrag-frontend -f Dockerfile.frontend .
# Logging and debugging
logs:
@echo "📋 Showing all container logs..."
docker compose $(OPENRAG_ENV_FILE) logs -f
docker compose logs -f
logs-be:
@echo "📋 Showing backend logs..."
docker compose $(OPENRAG_ENV_FILE) logs -f openrag-backend
docker compose logs -f openrag-backend
logs-fe:
@echo "📋 Showing frontend logs..."
docker compose $(OPENRAG_ENV_FILE) logs -f openrag-frontend
docker compose logs -f openrag-frontend
logs-lf:
@echo "📋 Showing langflow logs..."
docker compose $(OPENRAG_ENV_FILE) logs -f langflow
docker compose logs -f langflow
logs-os:
@echo "📋 Showing opensearch logs..."
docker compose $(OPENRAG_ENV_FILE) logs -f opensearch
docker compose logs -f opensearch
# Shell access
shell-be:
@echo "🐚 Opening shell in backend container..."
docker compose $(OPENRAG_ENV_FILE) exec openrag-backend /bin/bash
docker compose exec openrag-backend /bin/bash
shell-lf:
@echo "🐚 Opening shell in langflow container..."
docker compose $(OPENRAG_ENV_FILE) exec langflow /bin/bash
docker compose exec langflow /bin/bash
shell-os:
@echo "🐚 Opening shell in opensearch container..."
docker compose $(OPENRAG_ENV_FILE) exec opensearch /bin/bash
docker compose exec opensearch /bin/bash
# Testing and quality
test:
@ -211,13 +206,13 @@ test-ci:
chmod 644 keys/public_key.pem 2>/dev/null || true; \
fi; \
echo "Cleaning up old containers and volumes..."; \
docker compose down -v 2>/dev/null || true; \
docker compose -f docker-compose-cpu.yml down -v 2>/dev/null || true; \
echo "Pulling latest images..."; \
docker compose pull; \
docker compose -f docker-compose-cpu.yml pull; \
echo "Building OpenSearch image override..."; \
docker build --no-cache -t langflowai/openrag-opensearch:latest -f Dockerfile .; \
echo "Starting infra (OpenSearch + Dashboards + Langflow + Backend + Frontend) with CPU containers"; \
docker compose up -d opensearch dashboards langflow openrag-backend openrag-frontend; \
docker build --no-cache -t phact/openrag-opensearch:latest -f Dockerfile .; \
echo "Starting infra (OpenSearch + Dashboards + Langflow) with CPU containers"; \
docker compose -f docker-compose-cpu.yml up -d opensearch dashboards langflow; \
echo "Starting docling-serve..."; \
DOCLING_ENDPOINT=$$(uv run python scripts/docling_ctl.py start --port 5001 | grep "Endpoint:" | awk '{print $$2}'); \
echo "Docling-serve started at $$DOCLING_ENDPOINT"; \
@ -262,21 +257,6 @@ test-ci:
uv run pytest tests/integration -vv -s -o log_cli=true --log-cli-level=DEBUG; \
TEST_RESULT=$$?; \
echo ""; \
echo "Waiting for frontend at http://localhost:3000..."; \
for i in $$(seq 1 60); do \
curl -s http://localhost:3000/ >/dev/null 2>&1 && break || sleep 2; \
done; \
echo "Running Python SDK integration tests"; \
cd sdks/python && \
uv sync --extra dev && \
OPENRAG_URL=http://localhost:3000 uv run pytest tests/test_integration.py -vv -s || TEST_RESULT=1; \
cd ../..; \
echo "Running TypeScript SDK integration tests"; \
cd sdks/typescript && \
npm install && npm run build && \
OPENRAG_URL=http://localhost:3000 npm test || TEST_RESULT=1; \
cd ../..; \
echo ""; \
echo "=== Post-test JWT diagnostics ==="; \
echo "Generating test JWT token..."; \
TEST_TOKEN=$$(uv run python -c "from src.session_manager import SessionManager, AnonymousUser; sm = SessionManager('test'); print(sm.create_jwt_token(AnonymousUser()))" 2>/dev/null || echo ""); \
@ -289,7 +269,7 @@ test-ci:
echo ""; \
echo "Tearing down infra"; \
uv run python scripts/docling_ctl.py stop || true; \
docker compose down -v 2>/dev/null || true; \
docker compose -f docker-compose-cpu.yml down -v 2>/dev/null || true; \
exit $$TEST_RESULT
# CI-friendly integration test target with local builds: builds all images, brings up infra, waits, runs tests, tears down
@ -306,14 +286,14 @@ test-ci-local:
chmod 644 keys/public_key.pem 2>/dev/null || true; \
fi; \
echo "Cleaning up old containers and volumes..."; \
docker compose down -v 2>/dev/null || true; \
docker compose -f docker-compose-cpu.yml down -v 2>/dev/null || true; \
echo "Building all images locally..."; \
docker build -t langflowai/openrag-opensearch:latest -f Dockerfile .; \
docker build -t langflowai/openrag-backend:latest -f Dockerfile.backend .; \
docker build -t langflowai/openrag-frontend:latest -f Dockerfile.frontend .; \
docker build -t langflowai/openrag-langflow:latest -f Dockerfile.langflow .; \
echo "Starting infra (OpenSearch + Dashboards + Langflow + Backend + Frontend) with CPU containers"; \
docker compose up -d opensearch dashboards langflow openrag-backend openrag-frontend; \
docker build -t phact/openrag-opensearch:latest -f Dockerfile .; \
docker build -t phact/openrag-backend:latest -f Dockerfile.backend .; \
docker build -t phact/openrag-frontend:latest -f Dockerfile.frontend .; \
docker build -t phact/openrag-langflow:latest -f Dockerfile.langflow .; \
echo "Starting infra (OpenSearch + Dashboards + Langflow) with CPU containers"; \
docker compose -f docker-compose-cpu.yml up -d opensearch dashboards langflow; \
echo "Starting docling-serve..."; \
DOCLING_ENDPOINT=$$(uv run python scripts/docling_ctl.py start --port 5001 | grep "Endpoint:" | awk '{print $$2}'); \
echo "Docling-serve started at $$DOCLING_ENDPOINT"; \
@ -358,21 +338,6 @@ test-ci-local:
uv run pytest tests/integration -vv -s -o log_cli=true --log-cli-level=DEBUG; \
TEST_RESULT=$$?; \
echo ""; \
echo "Waiting for frontend at http://localhost:3000..."; \
for i in $$(seq 1 60); do \
curl -s http://localhost:3000/ >/dev/null 2>&1 && break || sleep 2; \
done; \
echo "Running Python SDK integration tests"; \
cd sdks/python && \
uv sync --extra dev && \
OPENRAG_URL=http://localhost:3000 uv run pytest tests/test_integration.py -vv -s || TEST_RESULT=1; \
cd ../..; \
echo "Running TypeScript SDK integration tests"; \
cd sdks/typescript && \
npm install && npm run build && \
OPENRAG_URL=http://localhost:3000 npm test || TEST_RESULT=1; \
cd ../..; \
echo ""; \
echo "=== Post-test JWT diagnostics ==="; \
echo "Generating test JWT token..."; \
TEST_TOKEN=$$(uv run python -c "from src.session_manager import SessionManager, AnonymousUser; sm = SessionManager('test'); print(sm.create_jwt_token(AnonymousUser()))" 2>/dev/null || echo ""); \
@ -383,32 +348,11 @@ test-ci-local:
fi; \
echo "================================="; \
echo ""; \
if [ $$TEST_RESULT -ne 0 ]; then \
echo "=== Tests failed, dumping container logs ==="; \
echo ""; \
echo "=== Langflow logs (last 500 lines) ==="; \
docker logs langflow 2>&1 | tail -500 || echo "Could not get Langflow logs"; \
echo ""; \
echo "=== Backend logs (last 200 lines) ==="; \
docker logs openrag-backend 2>&1 | tail -200 || echo "Could not get backend logs"; \
echo ""; \
fi; \
echo "Tearing down infra"; \
uv run python scripts/docling_ctl.py stop || true; \
docker compose down -v 2>/dev/null || true; \
docker compose -f docker-compose-cpu.yml down -v 2>/dev/null || true; \
exit $$TEST_RESULT
# SDK integration tests (requires running OpenRAG instance)
test-sdk:
@echo "Running SDK integration tests..."
@echo "Make sure OpenRAG is running at localhost:3000 (make up)"
@echo ""
@echo "Running Python SDK tests..."
cd sdks/python && uv sync --extra dev && OPENRAG_URL=http://localhost:3000 uv run pytest tests/test_integration.py -vv -s
@echo ""
@echo "Running TypeScript SDK tests..."
cd sdks/typescript && npm install && npm run build && OPENRAG_URL=http://localhost:3000 npm test
lint:
@echo "🔍 Running linting checks..."
cd frontend && npm run lint
@ -417,7 +361,7 @@ lint:
# Service status
status:
@echo "📊 Container status:"
@docker compose $(OPENRAG_ENV_FILE) ps 2>/dev/null || echo "No containers running"
@docker compose ps 2>/dev/null || echo "No containers running"
health:
@echo "🏥 Health check:"
@ -432,10 +376,6 @@ db-reset:
curl -X DELETE "http://localhost:9200/knowledge_filters" -u admin:$${OPENSEARCH_PASSWORD} || true
@echo "Indices reset. Restart backend to recreate."
clear-os-data:
@echo "🧹 Clearing OpenSearch data directory..."
@uv run python scripts/clear_opensearch_data.py
# Flow management
flow-upload:
@echo "📁 Uploading flow to Langflow..."

View file

@ -15,20 +15,66 @@ OpenRAG is a comprehensive Retrieval-Augmented Generation platform that enables
<a href="https://deepwiki.com/langflow-ai/openrag"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
## Install OpenRAG
</div>
<div align="center">
<a href="#quickstart" style="color: #0366d6;">Quickstart</a> &nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#tui-interface" style="color: #0366d6;">TUI Interface</a> &nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#docker-deployment" style="color: #0366d6;">Docker Deployment</a> &nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#development" style="color: #0366d6;">Development</a> &nbsp;&nbsp;|&nbsp;&nbsp;
<a href="#troubleshooting" style="color: #0366d6;">Troubleshooting</a>
</div>
To get started with OpenRAG, see the installation guides in the OpenRAG documentation:
## Quickstart
* [Quickstart](https://docs.openr.ag/quickstart)
* [Install the OpenRAG Python package](https://docs.openr.ag/install-options)
* [Deploy self-managed services with Docker or Podman](https://docs.openr.ag/docker)
To quickly run OpenRAG without creating or modifying any project files, use `uvx`:
## Development
```bash
uvx openrag
```
This runs OpenRAG without installing it to your project or globally.
To run a specific version of OpenRAG, add the version to the command, such as: `uvx --from openrag==0.1.25 openrag`.
For developers who want to [contribute to OpenRAG](https://docs.openr.ag/support/contribute) or set up a development environment, see [CONTRIBUTING.md](CONTRIBUTING.md).
## Install Python package
To first set up a project and then install the OpenRAG Python package, do the following:
1. Create a new project with a virtual environment using `uv init`.
```bash
uv init YOUR_PROJECT_NAME
cd YOUR_PROJECT_NAME
```
The `(venv)` prompt doesn't change, but `uv` commands will automatically use the project's virtual environment.
For more information on virtual environments, see the [uv documentation](https://docs.astral.sh/uv/pip/environments).
2. Add OpenRAG to your project.
```bash
uv add openrag
```
To add a specific version of OpenRAG:
```bash
uv add openrag==0.1.25
```
3. Start the OpenRAG TUI.
```bash
uv run openrag
```
4. Continue with the [Quickstart](https://docs.openr.ag/quickstart).
For the full TUI installation guide, see [TUI](https://docs.openr.ag/install).
## Docker or Podman installation
For more information, see [Install OpenRAG containers](https://docs.openr.ag/docker).
## Troubleshooting
For assistance with OpenRAG, see [Troubleshoot OpenRAG](https://docs.openr.ag/support/troubleshoot) and visit the [Discussions page](https://github.com/langflow-ai/openrag/discussions).
For common issues and fixes, see [Troubleshoot](https://docs.openr.ag/support/troubleshoot).
To report a bug or submit a feature request, visit the [Issues page](https://github.com/langflow-ai/openrag/issues).
## Development
For developers wanting to contribute to OpenRAG or set up a development environment, see [CONTRIBUTING.md](CONTRIBUTING.md).

View file

@ -1,64 +0,0 @@
# OpenRAG security policy and responsible disclosure
## Security policy
This security policy applies to all public projects under the langflow-ai organization on GitHub. We prioritize security and continuously work to safeguard our systems. However, vulnerabilities can still exist. If you identify a security issue, please report it to us so we can address it promptly.
### Security and bug fix versions
- Fixes are released either as part of the next minor version (e.g., 1.3.0 → 1.4.0) or as an on-demand patch version (e.g., 1.3.0 → 1.3.1)
- Security fixes are given priority and might be enough to cause a new version to be released
## Report a vulnerability
We encourage responsible disclosure of security vulnerabilities. If you find or suspect a security issue, please discreetly report it to us so we can address it promptly:
### Submit a report
Go to the [OpenRAG Security page](https://github.com/langflow-ai/openrag/security), and then click **Report a vulnerability** to start a private conversation between you and the repository's maintainers.
Provide as many specific details as possible to help us reproduce and fix the issue quickly, including the following:
- Steps to reproduce the issue
- Potential impact or concerns
- Any suggested fixes
Your report is kept confidential, and these details aren't shared without your consent.
### Response timeline
We will acknowledge your report within 5 business days.
We will provide an estimated resolution timeline.
We will keep you updated on our progress.
### Disclosure guidelines
- Don't publicly disclose vulnerabilities until we have assessed, resolved, and notified affected users.
- If you plan to present your research (e.g., at a conference or in a blog), share a draft with us at least 30 days in advance for review.
- Disclosures must not include the following:
- Data from any OpenRAG customer projects
- OpenRAG user/customer information
- Details about OpenRAG employees, contractors, or partners
We appreciate your efforts in helping us maintain a secure platform, and we look forward to working together to resolve any issues responsibly.
## Known vulnerabilities
The following known vulnerabilities are for the OpenRAG codebase.
This list doesn't include vulnerabilities within OpenRAG dependencies like OpenSearch and Langflow.
For Langflow vulnerabilities, see the [Langflow SECURITY.md](https://github.com/langflow-ai/langflow/blob/main/SECURITY.md).
There are no known vulnerabilities exclusive to the OpenRAG application at this time.
## Security configuration guidelines
### Start the Langflow server with authentication enabled
It is recommended that you set a Langflow password (`LANGFLOW_SUPERUSER_PASSWORD`) so the Langflow server starts with authentication enabled and the `langflow superuser` command disabled.
You can set this password when you install OpenRAG, or you can [edit the OpenRAG `.env` file and redeploy the OpenRAG containers](https://docs.openr.ag/reference/configuration#set-environment-variables).
For more information, see [OpenRAG's Langflow settings reference](https://docs.openr.ag/reference/configuration#langflow-settings).

141
docker-compose-cpu.yml Normal file
View file

@ -0,0 +1,141 @@
services:
opensearch:
image: phact/openrag-opensearch:${OPENRAG_VERSION:-latest}
#build:
# context: .
# dockerfile: Dockerfile
container_name: os
depends_on:
- openrag-backend
environment:
- discovery.type=single-node
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD}
# Run security setup in background after OpenSearch starts
command: >
bash -c "
# Ensure data directory has correct permissions
sudo chown -R opensearch:opensearch /usr/share/opensearch/data || true
# Start OpenSearch in background
/usr/share/opensearch/opensearch-docker-entrypoint.sh opensearch &
# Wait a bit for OpenSearch to start, then apply security config
sleep 10 && /usr/share/opensearch/setup-security.sh &
# Wait for background processes
wait
"
ports:
- "9200:9200"
- "9600:9600"
volumes:
- ${OPENSEARCH_DATA_PATH:-./opensearch-data}:/usr/share/opensearch/data:Z
dashboards:
image: opensearchproject/opensearch-dashboards:3.0.0
container_name: osdash
depends_on:
- opensearch
environment:
OPENSEARCH_HOSTS: '["https://opensearch:9200"]'
OPENSEARCH_USERNAME: "admin"
OPENSEARCH_PASSWORD: ${OPENSEARCH_PASSWORD}
ports:
- "5601:5601"
openrag-backend:
image: phact/openrag-backend:${OPENRAG_VERSION:-latest}
# build:
# context: .
# dockerfile: Dockerfile.backend
container_name: openrag-backend
depends_on:
- langflow
environment:
- OPENSEARCH_HOST=opensearch
- LANGFLOW_URL=http://langflow:7860
- LANGFLOW_PUBLIC_URL=${LANGFLOW_PUBLIC_URL}
- LANGFLOW_AUTO_LOGIN=${LANGFLOW_AUTO_LOGIN}
- LANGFLOW_SECRET_KEY=${LANGFLOW_SECRET_KEY}
- LANGFLOW_SUPERUSER=${LANGFLOW_SUPERUSER}
- LANGFLOW_SUPERUSER_PASSWORD=${LANGFLOW_SUPERUSER_PASSWORD}
- LANGFLOW_CHAT_FLOW_ID=${LANGFLOW_CHAT_FLOW_ID}
- LANGFLOW_INGEST_FLOW_ID=${LANGFLOW_INGEST_FLOW_ID}
- LANGFLOW_URL_INGEST_FLOW_ID=${LANGFLOW_URL_INGEST_FLOW_ID}
- DISABLE_INGEST_WITH_LANGFLOW=${DISABLE_INGEST_WITH_LANGFLOW:-false}
- NUDGES_FLOW_ID=${NUDGES_FLOW_ID}
- OPENSEARCH_PORT=9200
- OPENSEARCH_USERNAME=admin
- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WATSONX_API_KEY=${WATSONX_API_KEY}
- WATSONX_ENDPOINT=${WATSONX_ENDPOINT}
- WATSONX_PROJECT_ID=${WATSONX_PROJECT_ID}
- OLLAMA_ENDPOINT=${OLLAMA_ENDPOINT}
- GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID}
- GOOGLE_OAUTH_CLIENT_SECRET=${GOOGLE_OAUTH_CLIENT_SECRET}
- MICROSOFT_GRAPH_OAUTH_CLIENT_ID=${MICROSOFT_GRAPH_OAUTH_CLIENT_ID}
- MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=${MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET}
- WEBHOOK_BASE_URL=${WEBHOOK_BASE_URL}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
volumes:
- ./documents:/app/documents:Z
- ./keys:/app/keys:Z
- ./flows:/app/flows:U,z
openrag-frontend:
image: phact/openrag-frontend:${OPENRAG_VERSION:-latest}
# build:
# context: .
# dockerfile: Dockerfile.frontend
container_name: openrag-frontend
depends_on:
- openrag-backend
environment:
- OPENRAG_BACKEND_HOST=openrag-backend
ports:
- "3000:3000"
langflow:
volumes:
- ./flows:/app/flows:U,z
image: phact/openrag-langflow:${LANGFLOW_VERSION:-latest}
# build:
# context: .
# dockerfile: Dockerfile.langflow
container_name: langflow
ports:
- "7860:7860"
environment:
- LANGFLOW_DEACTIVATE_TRACING=true
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WATSONX_API_KEY=${WATSONX_API_KEY}
- WATSONX_ENDPOINT=${WATSONX_ENDPOINT}
- WATSONX_PROJECT_ID=${WATSONX_PROJECT_ID}
- OLLAMA_BASE_URL=${OLLAMA_ENDPOINT}
- LANGFLOW_LOAD_FLOWS_PATH=/app/flows
- LANGFLOW_SECRET_KEY=${LANGFLOW_SECRET_KEY}
- JWT=None
- OWNER=None
- OWNER_NAME=None
- OWNER_EMAIL=None
- CONNECTOR_TYPE=system
- CONNECTOR_TYPE_URL=url
- OPENRAG-QUERY-FILTER="{}"
- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD}
- FILENAME=None
- MIMETYPE=None
- FILESIZE=0
- LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=JWT,OPENRAG-QUERY-FILTER,OPENSEARCH_PASSWORD,OWNER,OWNER_NAME,OWNER_EMAIL,CONNECTOR_TYPE,FILENAME,MIMETYPE,FILESIZE
- LANGFLOW_LOG_LEVEL=DEBUG
- LANGFLOW_AUTO_LOGIN=${LANGFLOW_AUTO_LOGIN}
- LANGFLOW_SUPERUSER=${LANGFLOW_SUPERUSER}
- LANGFLOW_SUPERUSER_PASSWORD=${LANGFLOW_SUPERUSER_PASSWORD}
- LANGFLOW_NEW_USER_IS_ACTIVE=${LANGFLOW_NEW_USER_IS_ACTIVE}
- LANGFLOW_ENABLE_SUPERUSER_CLI=${LANGFLOW_ENABLE_SUPERUSER_CLI}
# - DEFAULT_FOLDER_NAME=OpenRAG
- HIDE_GETTING_STARTED_PROGRESS=true

View file

@ -1,12 +0,0 @@
services:
openrag-backend:
environment:
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- NVIDIA_VISIBLE_DEVICES=all
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]

View file

@ -1,6 +1,6 @@
services:
opensearch:
image: langflowai/openrag-opensearch:${OPENRAG_VERSION:-latest}
image: phact/openrag-opensearch:${OPENRAG_VERSION:-latest}
#build:
#context: .
#dockerfile: Dockerfile
@ -29,7 +29,7 @@ services:
- "9200:9200"
- "9600:9600"
volumes:
- ${OPENSEARCH_DATA_PATH:-./opensearch-data}:/usr/share/opensearch/data:U,z
- ${OPENSEARCH_DATA_PATH:-./opensearch-data}:/usr/share/opensearch/data:Z
dashboards:
image: opensearchproject/opensearch-dashboards:3.0.0
@ -44,10 +44,10 @@ services:
- "5601:5601"
openrag-backend:
image: langflowai/openrag-backend:${OPENRAG_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile.backend
image: phact/openrag-backend:${OPENRAG_VERSION:-latest}
# build:
# context: .
# dockerfile: Dockerfile.backend
container_name: openrag-backend
depends_on:
- langflow
@ -72,6 +72,8 @@ services:
- WATSONX_ENDPOINT=${WATSONX_ENDPOINT}
- WATSONX_PROJECT_ID=${WATSONX_PROJECT_ID}
- OLLAMA_ENDPOINT=${OLLAMA_ENDPOINT}
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- NVIDIA_VISIBLE_DEVICES=all
- GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID}
- GOOGLE_OAUTH_CLIENT_SECRET=${GOOGLE_OAUTH_CLIENT_SECRET}
- MICROSOFT_GRAPH_OAUTH_CLIENT_ID=${MICROSOFT_GRAPH_OAUTH_CLIENT_ID}
@ -80,45 +82,42 @@ services:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
volumes:
- ${OPENRAG_DOCUMENTS_PATH:-./openrag-documents}:/app/openrag-documents:Z
- ${OPENRAG_KEYS_PATH:-./keys}:/app/keys:U,z
- ${OPENRAG_FLOWS_PATH:-./flows}:/app/flows:U,z
- ${OPENRAG_CONFIG_PATH:-./config}:/app/config:Z
- ${OPENRAG_DATA_PATH:-./data}:/app/data:Z
- ./documents:/app/documents:Z
- ./keys:/app/keys:Z
- ./flows:/app/flows:U,z
gpus: all
openrag-frontend:
image: langflowai/openrag-frontend:${OPENRAG_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile.frontend
image: phact/openrag-frontend:${OPENRAG_VERSION:-latest}
# build:
# context: .
# dockerfile: Dockerfile.frontend
container_name: openrag-frontend
depends_on:
- openrag-backend
environment:
- OPENRAG_BACKEND_HOST=openrag-backend
ports:
- "3003:3003"
- "3000:3000"
langflow:
volumes:
- ${OPENRAG_FLOWS_PATH:-./flows}:/app/flows:U,z
image: langflowai/openrag-langflow:${OPENRAG_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile.langflow
- ./flows:/app/flows:U,z
image: langflowai/langflow-nightly:${LANGFLOW_VERSION:-1.7.0.dev5}
# build:
# context: .
# dockerfile: Dockerfile.langflow
container_name: langflow
ports:
- "7860:7860"
environment:
- LANGFUSE_SECRET_KEY=${LANGFUSE_SECRET_KEY:-}
- LANGFUSE_PUBLIC_KEY=${LANGFUSE_PUBLIC_KEY:-}
- LANGFUSE_HOST=${LANGFUSE_HOST:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-None}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-None}
- WATSONX_API_KEY=${WATSONX_API_KEY:-None}
- WATSONX_ENDPOINT=${WATSONX_ENDPOINT:-None}
- WATSONX_PROJECT_ID=${WATSONX_PROJECT_ID:-None}
- OLLAMA_BASE_URL=${OLLAMA_ENDPOINT:-None}
- LANGFLOW_DEACTIVATE_TRACING=true
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WATSONX_API_KEY=${WATSONX_API_KEY}
- WATSONX_ENDPOINT=${WATSONX_ENDPOINT}
- WATSONX_PROJECT_ID=${WATSONX_PROJECT_ID}
- OLLAMA_BASE_URL=${OLLAMA_ENDPOINT}
- LANGFLOW_LOAD_FLOWS_PATH=/app/flows
- LANGFLOW_SECRET_KEY=${LANGFLOW_SECRET_KEY}
- JWT=None
@ -128,12 +127,11 @@ services:
- CONNECTOR_TYPE=system
- CONNECTOR_TYPE_URL=url
- OPENRAG-QUERY-FILTER="{}"
- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD}
- FILENAME=None
- MIMETYPE=None
- FILESIZE=0
- SELECTED_EMBEDDING_MODEL=${SELECTED_EMBEDDING_MODEL:-}
- LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=JWT,OPENRAG-QUERY-FILTER,OPENSEARCH_PASSWORD,OWNER,OWNER_NAME,OWNER_EMAIL,CONNECTOR_TYPE,FILENAME,MIMETYPE,FILESIZE,SELECTED_EMBEDDING_MODEL,OPENAI_API_KEY,ANTHROPIC_API_KEY,WATSONX_API_KEY,WATSONX_ENDPOINT,WATSONX_PROJECT_ID,OLLAMA_BASE_URL
- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD}
- LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=JWT,OPENRAG-QUERY-FILTER,OPENSEARCH_PASSWORD,OWNER,OWNER_NAME,OWNER_EMAIL,CONNECTOR_TYPE,FILENAME,MIMETYPE,FILESIZE
- LANGFLOW_LOG_LEVEL=DEBUG
- LANGFLOW_AUTO_LOGIN=${LANGFLOW_AUTO_LOGIN}
- LANGFLOW_SUPERUSER=${LANGFLOW_SUPERUSER}

View file

@ -5,13 +5,13 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
## Installation
```bash
npm install
yarn
```
## Local Development
```bash
npm start
yarn start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
@ -19,7 +19,7 @@ This command starts a local development server and opens up a browser window. Mo
## Build
```bash
npm run build
yarn build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@ -29,20 +29,20 @@ This command generates static content into the `build` directory and can be serv
Using SSH:
```bash
USE_SSH=true npm run deploy
USE_SSH=true yarn deploy
```
Not using SSH:
```bash
GIT_USER=<Your GitHub username> npm run deploy
GIT_USER=<Your GitHub username> yarn deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
## Update the OpenRAG documentation PDF
The documentation PDF at `openrag/openrag-documents/openrag-documentation.pdf` is used by the OpenRAG application, so keep it up to date.
The documentation PDF at `openrag/documents/openrag-documentation.pdf` is used by the OpenRAG application, so keep it up to date.
To update the PDF, do the following:
@ -68,7 +68,7 @@ To remove these items, give the following prompt or something similar to your ID
2. Check your `.mdx` files to confirm these elements are removed.
Don't commit the changes.
3. From `openrag/docs`, run this command to build the site with the changes, and create a PDF at `openrag/openrag-documents`.
3. From `openrag/docs`, run this command to build the site with the changes, and create a PDF at `openrag/documents`.
```
npm run build:pdf

View file

@ -28,6 +28,7 @@ docs: {
See the [Docusaurus docs](https://docusaurus.io/docs/versioning) for more info.
1. Use the Docusaurus CLI command to create a version.
You can use `yarn` instead of `npm`.
```bash
# Create version 1.0.0 from current docs
npm run docusaurus docs:version 1.0.0

View file

@ -1 +0,0 @@
In no-auth mode, all documents are attributed to **Anonymous User** because there is no distinct document ownership or unique JWTs. For more control over document ownership and visibility, use OAuth mode. For more information, see [OpenSearch authentication and document access](/knowledge#auth).

View file

@ -1,9 +0,0 @@
```bash title="Docker"
docker compose down --volumes --remove-orphans --rmi local
docker system prune -f
```
```bash title="Podman"
podman compose down --volumes --remove-orphans --rmi local
podman system prune -f
```

View file

@ -1,7 +0,0 @@
```bash title="Docker"
docker compose up -d
```
```bash title="Podman"
podman compose up -d
```

View file

@ -1,49 +0,0 @@
1. Remove all containers, including stopped containers:
```bash title="Docker"
docker rm --force $(docker ps -aq)
```
```bash title="Podman"
podman rm --all --force
```
2. Remove all images:
```bash title="Docker"
docker rmi --force $(docker images -q)
```
```bash title="Podman"
podman rmi --all --force
```
3. Remove all volumes:
```bash title="Docker"
docker volume prune --force
```
```bash title="Podman"
podman volume prune --force
```
4. Remove all networks except the default network:
```bash title="Docker"
docker network prune --force
```
```bash title="Podman"
podman network prune --force
```
5. Clean up any leftover data:
```bash title="Docker"
docker system prune --all --force --volumes
```
```bash title="Podman"
podman system prune --all --force --volumes
```

View file

@ -1,7 +0,0 @@
```bash title="Docker"
docker stop $(docker ps -q)
```
```bash title="Podman"
podman stop --all
```

View file

@ -1 +0,0 @@
1. If you modified the built-in flows or created custom flows in your [OpenRAG Langflow instance](/agents), [export your flows](https://docs.langflow.org/concepts-flows-import) before starting this process. Although OpenRAG can preserve changes to the built-in flows, it doesn't preserve user-created flows. As a general best practice, exporting your flows is recommended to create backups of your customizations. Afterwards, you can reimport your flows or reference the exported flow JSON as needed.

View file

@ -1,22 +0,0 @@
:::warning
This is a destructive operation that does the following:
* Destroys all OpenRAG containers, volumes, and local images.
* Prunes any additional container objects.
* Deletes the contents of the `~/.openrag` directory _except_ for OpenRAG's `.env` file and the `/documents` subdirectory.
<p/>Destroyed containers and deleted data are lost and cannot be recovered after running this operation.
:::
<!--
Author's note: Don't remove the <p/> tag!
For some reason, this specific usage consistently enforces the line break and indentation whether the partial is nested or not.
Without the <p/> tag, when this partial is used inside a list (ex. nested under a step in a numbered list), there is no implicit line break after the last bullet.
When this partial is used outside of a list (as a top-level paragraph), there is an implicit line break after the last bullet.
Neither <br/> nor wrapping the entire line in <p> </p> worked consistently for both use cases.
Either the line break was missing or the indentation was incorrect.
This behavior was observed in Docusaurus 3.9.2 on 05 Dec 2025. In a future release, if this is not longer an issue, you can remove the tag and this note. :)
-->

View file

@ -1,5 +0,0 @@
GPU acceleration isn't required for most use cases.
OpenRAG's CPU-only deployment doesn't prevent you from using GPU acceleration in external services, such as Ollama servers.
GPU acceleration is required only for specific use cases, typically involving customization of the ingestion flows or ingestion logic.
For example, writing alternate ingest logic in OpenRAG that uses GPUs directly in the container, or customizing the ingestion flows to use Langflow's Docling component with GPU acceleration instead of OpenRAG's Docling Serve service.

View file

@ -1,24 +0,0 @@
<details>
<summary>About the OpenSearch Ingestion flow</summary>
When you upload documents locally or with OAuth connectors, the **OpenSearch Ingestion** flow runs in the background.
By default, this flow uses Docling Serve to import and process documents.
Like all [OpenRAG flows](/agents), you can [inspect the flow in Langflow](/agents#inspect-and-modify-flows), and you can customize it if you want to change the knowledge ingestion settings.
The **OpenSearch Ingestion** flow is comprised of several components that work together to process and store documents in your knowledge base:
* [**Docling Serve** component](https://docs.langflow.org/bundles-docling#docling-serve): Ingests files and processes them by connecting to OpenRAG's local Docling Serve service. The output is `DoclingDocument` data that contains the extracted text and metadata from the documents.
* [**Export DoclingDocument** component](https://docs.langflow.org/bundles-docling#export-doclingdocument): Exports processed `DoclingDocument` data to Markdown format with image placeholders. This conversion standardizes the document data in preparation for further processing.
* [**DataFrame Operations** component](https://docs.langflow.org/dataframe-operations): Three of these components run sequentially to add metadata to the document data: `filename`, `file_size`, and `mimetype`.
* [**Split Text** component](https://docs.langflow.org/split-text): Splits the processed text into chunks, based on the configured [chunk size and overlap settings](/knowledge#knowledge-ingestion-settings).
* **Secret Input** component: If needed, four of these components securely fetch the [OAuth authentication](/knowledge#auth) configuration variables: `CONNECTOR_TYPE`, `OWNER`, `OWNER_EMAIL`, and `OWNER_NAME`.
* **Create Data** component: Combines the authentication credentials from the **Secret Input** components into a structured data object that is associated with the document embeddings.
* [**Embedding Model** component](https://docs.langflow.org/components-embedding-models): Generates vector embeddings using your selected [embedding model](/knowledge#set-the-embedding-model-and-dimensions).
* [**OpenSearch** component](https://docs.langflow.org/bundles-elastic#opensearch): Stores the processed documents and their embeddings in a `documents` index of your OpenRAG [OpenSearch knowledge base](/knowledge).
The default address for the OpenSearch instance is `https://opensearch:9200`. To change this address, edit the `OPENSEARCH_PORT` [environment variable](/reference/configuration#opensearch-settings).
The default authentication method is JSON Web Token (JWT) authentication. If you [edit the flow](/agents#inspect-and-modify-flows), you can select `basic` auth mode, which uses the `OPENSEARCH_USERNAME` and `OPENSEARCH_PASSWORD` [environment variables](/reference/configuration#opensearch-settings) for authentication instead of JWT.
</details>

View file

@ -1,5 +0,0 @@
## Next steps
* Try some of OpenRAG's core features in the [quickstart](/quickstart#chat-with-documents).
* Learn how to [manage OpenRAG services](/manage-services).
* [Upload documents](/ingestion), and then use the [**Chat**](/chat) to explore your data.

View file

@ -1,114 +0,0 @@
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
1. Open the **OpenRAG OpenSearch Agent** flow in the Langflow visual editor: Click <Icon name="Settings2" aria-hidden="true"/> **Settings**, click **Edit in Langflow**, and then click **Proceed**.
2. Optional: If you don't want to use the Langflow API key that is generated automatically when you install OpenRAG, you can create a [Langflow API key](https://docs.langflow.org/api-keys-and-authentication).
This key doesn't grant access to OpenRAG; it is only for authenticating with the Langflow API.
1. In the Langflow visual editor, click your user icon in the header, and then select **Settings**.
2. Click **Langflow API Keys**, and then click <Icon name="Plus" aria-hidden="true"/> **Add New**.
3. Name your key, and then click **Create API Key**.
4. Copy the API key and store it securely.
5. Exit the Langflow **Settings** page to return to the visual editor.
3. Click **Share**, and then select **API access** to get pregenerated code snippets that call the Langflow API and run the flow.
These code snippets construct API requests with your Langflow server URL (`LANGFLOW_SERVER_ADDRESS`), the flow to run (`FLOW_ID`), required headers (`LANGFLOW_API_KEY`, `Content-Type`), and a payload containing the required inputs to run the flow, including a default chat input message.
In production, you would modify the inputs to suit your application logic. For example, you could replace the default chat input message with dynamic user input.
<Tabs>
<TabItem value="python" label="Python">
```python
import requests
import os
import uuid
api_key = 'LANGFLOW_API_KEY'
url = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow
# Request payload configuration
payload = {
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
}
payload["session_id"] = str(uuid.uuid4())
headers = {"x-api-key": api_key}
try:
# Send API request
response = requests.request("POST", url, json=payload, headers=headers)
response.raise_for_status() # Raise exception for bad status codes
# Print response
print(response.text)
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
except ValueError as e:
print(f"Error parsing response: {e}")
```
</TabItem>
<TabItem value="typescript" label="TypeScript">
```typescript
const crypto = require('crypto');
const apiKey = 'LANGFLOW_API_KEY';
const payload = {
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
};
payload.session_id = crypto.randomUUID();
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
"x-api-key": apiKey
},
body: JSON.stringify(payload)
};
fetch('http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID', options)
.then(response => response.json())
.then(response => console.warn(response))
.catch(err => console.error(err));
```
</TabItem>
<TabItem value="curl" label="curl">
```bash
curl --request POST \
--url 'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false' \
--header 'Content-Type: application/json' \
--header "x-api-key: LANGFLOW_API_KEY" \
--data '{
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
}'
```
</TabItem>
</Tabs>
4. Copy your preferred snippet, and then run it:
* **Python**: Paste the snippet into a `.py` file, save it, and then run it with `python filename.py`.
* **TypeScript**: Paste the snippet into a `.ts` file, save it, and then run it with `ts-node filename.ts`.
* **curl**: Paste and run snippet directly in your terminal.
If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more.
In production, you won't pass the raw response to the user in its entirety.
Instead, you extract and reformat relevant fields for different use cases, as demonstrated in the [Langflow quickstart](https://docs.langflow.org/get-started-quickstart#extract-data-from-the-response).
For example, you could pass the chat output text to a front-end user-facing application, and store specific fields in logs and backend data stores for monitoring, chat history, or analytics.
You could also pass the output from one flow as input to another flow.

View file

@ -0,0 +1,5 @@
import Icon from "@site/src/components/icon/icon";
All flows included with OpenRAG are designed to be modular, performant, and provider-agnostic.
To modify a flow, click <Icon name="Settings2" aria-hidden="true"/> **Settings**, and click **Edit in Langflow**.
OpenRAG's visual editor is based on the [Langflow visual editor](https://docs.langflow.org/concepts-overview), so you can edit your flows to match your specific use case.

View file

@ -1,13 +0,0 @@
OpenRAG isn't guaranteed to be compatible with all models that are available through Ollama.
For example, some models might produce unexpected results, such as JSON-formatted output instead of natural language responses, and some models aren't appropriate for the types of tasks that OpenRAG performs, such as those that generate media.
The OpenRAG team recommends the following models when using Ollama as your model provider:
* **Language models**: `gpt-oss:20b` or `mistral-nemo:12b`.
If you choose `gpt-oss:20b`, consider using Ollama Cloud or running Ollama on a remote machine because this model requires at least 16GB of RAM.
* **Embedding models**: [`nomic-embed-text:latest`](https://ollama.com/library/nomic-embed-text), `mxbai-embed-large:latest`, or `embeddinggemma:latest`.
You can experiment with other models, but if you encounter issues that you are unable to resolve through other RAG best practices (like context filters and prompt engineering), try switching to one of the recommended models.
You can submit an [OpenRAG GitHub issue](https://github.com/langflow-ai/openrag/issues) to request support for specific models.

View file

@ -0,0 +1,24 @@
import Icon from "@site/src/components/icon/icon";
Using Ollama for your OpenRAG language model provider offers greater flexibility and configuration, but can also be overwhelming to start.
These recommendations are a reasonable starting point for users with at least one GPU and experience running LLMs locally.
For best performance, OpenRAG recommends OpenAI's `gpt-oss:20b` language model. However, this model uses 16GB of RAM, so consider using Ollama Cloud or running Ollama on a remote machine.
For generating embeddings, OpenRAG recommends the [`nomic-embed-text`](https://ollama.com/library/nomic-embed-text) embedding model, which provides high-quality embeddings optimized for retrieval tasks.
To run models in [**Ollama Cloud**](https://docs.ollama.com/cloud), follow these steps:
1. Sign in to Ollama Cloud.
In a terminal, enter `ollama signin` to connect your local environment with Ollama Cloud.
2. To run the model, in Ollama, select the `gpt-oss:20b-cloud` model, or run `ollama run gpt-oss:20b-cloud` in a terminal.
Ollama Cloud models are run at the same URL as your local Ollama server at `http://localhost:11434`, and automatically offloaded to Ollama's cloud service.
3. Connect OpenRAG to the same local Ollama server as you would for local models in onboarding, using the default address of `http://localhost:11434`.
4. In the **Language model** field, select the `gpt-oss:20b-cloud` model.
<br></br>
To run models on a **remote Ollama server**, follow these steps:
1. Ensure your remote Ollama server is accessible from your OpenRAG instance.
2. In the **Ollama Base URL** field, enter your remote Ollama server's base URL, such as `http://your-remote-server:11434`.
OpenRAG connects to the remote Ollama server and populates the lists with the server's available models.
3. Select your **Embedding model** and **Language model** from the available options.

View file

@ -1,136 +1,74 @@
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
import PartialOllama from '@site/docs/_partial-ollama.mdx';
## Complete the application onboarding process {#application-onboarding}
## Application onboarding
The first time you start the OpenRAG application, you must complete the application onboarding process to select language and embedding models that are essential for OpenRAG features like the [**Chat**](/chat).
The first time you start OpenRAG, whether using the TUI or a `.env` file, you must complete application onboarding.
Some of these variables, such as the embedding models, can be changed seamlessly after onboarding.
Others are immutable and require you to destroy and recreate the OpenRAG containers.
For more information, see the [OpenRAG environment variables reference](/reference/configuration).
:::warning
Most values from onboarding can be changed later in the OpenRAG **Settings** page, but there are important restrictions.
You can use different providers for your language model and embedding model, such as Anthropic for the language model and OpenAI for the embedding model.
Additionally, you can set multiple embedding models.
The **language model provider** and **embeddings model provider** can only be selected at onboarding.
To change your provider selection later, you must [reinstall OpenRAG](/install#reinstall).
You only need to complete onboarding for your preferred providers.
<Tabs groupId="Provider">
<TabItem value="Anthropic" label="Anthropic" default>
:::info
Anthropic doesn't provide embedding models. If you select Anthropic for your language model, you must select a different provider for the embedding model.
You can use different providers for your language model and embedding model, such as Anthropic for the language model and OpenAI for the embeddings model.
:::
1. Enter your Anthropic API key, or enable **Use environment API key** to pull the key from your [OpenRAG `.env` file](/reference/configuration).
Choose one LLM provider and complete these steps:
2. Under **Advanced settings**, select the language model that you want to use.
<Tabs groupId="Provider">
<TabItem value="Anthropic" label="Anthropic" default>
:::info
Anthropic does not provide embedding models. If you select Anthropic for your language model, you must then select a different provider for embeddings.
:::
1. Enable **Use environment Anthropic API key** to automatically use your key from the `.env` file.
Alternatively, paste an Anthropic API key into the field.
2. Under **Advanced settings**, select your **Language Model**.
3. Click **Complete**.
4. In the second onboarding panel, select a provider for embeddings and select your **Embedding Model**.
5. To complete the onboarding tasks, click **What is OpenRAG**, and then click **Add a Document**.
Alternatively, click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
6. Continue with the [Quickstart](/quickstart).
3. Click **Complete**.
</TabItem>
<TabItem value="OpenAI" label="OpenAI">
1. Enable **Get API key from environment variable** to automatically enter your key from the TUI-generated `.env` file.
Alternatively, paste an OpenAI API key into the field.
2. Under **Advanced settings**, select your **Language Model**.
3. Click **Complete**.
4. In the second onboarding panel, select a provider for embeddings and select your **Embedding Model**.
5. To complete the onboarding tasks, click **What is OpenRAG**, and then click **Add a Document**.
Alternatively, click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
6. Continue with the [Quickstart](/quickstart).
4. Select a provider for embeddings, provide the required information, and then select the embedding model you want to use.
For information about another provider's credentials and settings, see the instructions for that provider.
</TabItem>
<TabItem value="IBM watsonx.ai" label="IBM watsonx.ai">
1. Complete the fields for **watsonx.ai API Endpoint**, **IBM Project ID**, and **IBM API key**.
These values are found in your IBM watsonx deployment.
2. Under **Advanced settings**, select your **Language Model**.
3. Click **Complete**.
4. In the second onboarding panel, select a provider for embeddings and select your **Embedding Model**.
5. To complete the onboarding tasks, click **What is OpenRAG**, and then click **Add a Document**.
Alternatively, click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
6. Continue with the [Quickstart](/quickstart).
5. Click **Complete**.
After you configure the embedding model, OpenRAG uses your credentials and models to ingest some [initial documents](/knowledge#default-documents). This tests the connection, and it allows you to ask OpenRAG about itself in the [**Chat**](/chat).
If there is a problem with the model configuration, an error occurs and you are redirected back to the application onboarding screen.
Verify that the credential is valid and has access to the selected model, and then click **Complete** to retry ingestion.
6. Continue through the overview slides for a brief introduction to OpenRAG, or click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
The overview demonstrates some basic functionality that is covered in the [quickstart](/quickstart#chat-with-documents) and in other parts of the OpenRAG documentation.
</TabItem>
<TabItem value="IBM watsonx.ai" label="IBM watsonx.ai">
1. For **watsonx.ai API Endpoint**, select the base URL for your watsonx.ai model deployment.
2. Enter your watsonx.ai deployment's project ID and API key.
You can enable **Use environment API key** to pull the key from your [OpenRAG `.env` file](/reference/configuration).
3. Under **Advanced settings**, select the language model that you want to use.
4. Click **Complete**.
5. Select a provider for embeddings, provide the required information, and then select the embedding model you want to use.
For information about another provider's credentials and settings, see the instructions for that provider.
6. Click **Complete**.
After you configure the embedding model, OpenRAG uses your credentials and models to ingest some [initial documents](/knowledge#default-documents). This tests the connection, and it allows you to ask OpenRAG about itself in the [**Chat**](/chat).
If there is a problem with the model configuration, an error occurs and you are redirected back to the application onboarding screen.
Verify that the credentials are valid and have access to the selected model, and then click **Complete** to retry ingestion.
7. Continue through the overview slides for a brief introduction to OpenRAG, or click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
The overview demonstrates some basic functionality that is covered in the [quickstart](/quickstart#chat-with-documents) and in other parts of the OpenRAG documentation.
</TabItem>
<TabItem value="Ollama" label="Ollama">
Using Ollama as your language and embedding model provider offers greater flexibility and configuration options for hosting models.
However, it requires additional setup because Ollama isn't included with OpenRAG.
You must deploy Ollama separately if you want to use Ollama as a model provider.
:::info
<PartialOllamaModels />
:::
1. [Install Ollama locally or on a remote server](https://docs.ollama.com/), or [run models in Ollama Cloud](https://docs.ollama.com/cloud).
If you are running a remote server, it must be accessible from your OpenRAG deployment.
2. In the OpenRAG onboarding dialog, enter your Ollama server's base URL:
* **Local Ollama server**: Enter your Ollama server's base URL and port. The default Ollama server address is `http://localhost:11434`.
* **Ollama Cloud**: Because Ollama Cloud models run at the same address as a local Ollama server and automatically offload to Ollama's cloud service, you can use the same base URL and port as you would for a local Ollama server. The default address is `http://localhost:11434`.
* **Remote server**: Enter your remote Ollama server's base URL and port, such as `http://your-remote-server:11434`.
3. Select the language model that your Ollama server is running.
If your server isn't running any language models, you must either deploy a language model on your Ollama server, or use another provider for the language model.
Language model and embedding model selections are independent.
You can use the same or different servers for each model.
To use different providers for each model, you must configure both providers, and select the relevant model for each provider.
4. Click **Complete**.
5. Select a provider for embeddings, provide the required information, and then select the embedding model you want to use.
For information about another provider's credentials and settings, see the instructions for that provider.
6. Click **Complete**.
After you configure the embedding model, OpenRAG uses your credentials and models to ingest some [initial documents](/knowledge#default-documents). This tests the connection, and it allows you to ask OpenRAG about itself in the [**Chat**](/chat).
If there is a problem with the model configuration, an error occurs and you are redirected back to the application onboarding screen.
Verify that the server address is valid, and that the selected model is running on the server.
Then, click **Complete** to retry ingestion.
7. Continue through the overview slides for a brief introduction to OpenRAG, or click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
The overview demonstrates some basic functionality that is covered in the [quickstart](/quickstart#chat-with-documents) and in other parts of the OpenRAG documentation.
</TabItem>
<TabItem value="OpenAI" label="OpenAI (default)">
1. Enter your OpenAI API key, or enable **Use environment API key** to pull the key from your [OpenRAG `.env` file](/reference/configuration).
2. Under **Advanced settings**, select the language model that you want to use.
3. Click **Complete**.
4. Select a provider for embeddings, provide the required information, and then select the embedding model you want to use.
For information about another provider's credentials and settings, see the instructions for that provider.
5. Click **Complete**.
After you configure the embedding model, OpenRAG uses your credentials and models to ingest some [initial documents](/knowledge#default-documents). This tests the connection, and it allows you to ask OpenRAG about itself in the [**Chat**](/chat).
If there is a problem with the model configuration, an error occurs and you are redirected back to the application onboarding screen.
Verify that the credential is valid and has access to the selected model, and then click **Complete** to retry ingestion.
6. Continue through the overview slides for a brief introduction to OpenRAG, or click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
The overview demonstrates some basic functionality that is covered in the [quickstart](/quickstart#chat-with-documents) and in other parts of the OpenRAG documentation.
</TabItem>
</Tabs>
</TabItem>
<TabItem value="Ollama" label="Ollama">
:::tip
Ollama is not included with OpenRAG. To install Ollama, see the [Ollama documentation](https://docs.ollama.com/).
:::
1. To connect to an Ollama server running on your local machine, enter your Ollama server's base URL address.
The default Ollama server address is `http://localhost:11434`.
OpenRAG connects to the Ollama server and populates the model lists with the server's available models.
2. Select the **Embedding Model** and **Language Model** your Ollama server is running.
<details closed>
<summary>Ollama model selection and external server configuration</summary>
<PartialOllama />
</details>
3. Click **Complete**.
4. To complete the onboarding tasks, click **What is OpenRAG**, and then click **Add a Document**.
5. Continue with the [Quickstart](/quickstart).
</TabItem>
</Tabs>

View file

@ -1,11 +0,0 @@
* **No-auth mode**: If you select **Basic Setup** in the [TUI](/tui), or your [OpenRAG `.env` file](/reference/configuration) doesn't include OAuth credentials, then the OpenRAG OpenSearch instance runs in no-auth mode.
This mode uses one anonymous JWT token for OpenSearch authentication.
There is no differentiation between users; all users that access your OpenRAG instance can access all documents uploaded to your knowledge base.
* **OAuth mode**: If you select **Advanced Setup** in the [TUI](/tui), or your [OpenRAG `.env` file](/reference/configuration) includes OAuth credentials, then the OpenRAG OpenSearch instance runs in OAuth mode.
This mode uses a unique JWT token for each OpenRAG user, and each document is tagged with user ownership.
Documents are filtered by user owner; users see only the documents that they uploaded or have access to through their cloud storage accounts.
To enable OAuth mode after initial setup, see [Ingest files with OAuth connectors](/ingestion#oauth-ingestion).

View file

@ -1,20 +0,0 @@
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
* Gather the credentials and connection details for your preferred model providers.
You must have access to at least one language model and one embedding model.
If a provider offers both types, you can use the same provider for both models.
If a provider offers only one type, you must select two providers.
* **OpenAI**: Create an [OpenAI API key](https://platform.openai.com/api-keys).
* **Anthropic**: Create an [Anthropic API key](https://www.anthropic.com/docs/api/reference).
Anthropic provides language models only; you must select an additional provider for embeddings.
* **IBM watsonx.ai**: Get your watsonx.ai API endpoint, IBM project ID, and IBM API key from your watsonx deployment.
* **Ollama**: Deploy an [Ollama instance and models](https://docs.ollama.com/) locally, in the cloud, or on a remote server. Then, get your Ollama server's base URL and the names of the models that you want to use.
:::info
<PartialOllamaModels />
:::
* Optional: Install GPU support with an NVIDIA GPU, [CUDA](https://docs.nvidia.com/cuda/) support, and compatible NVIDIA drivers on the OpenRAG host machine.
If you don't have GPU capabilities, OpenRAG provides an alternate CPU-only deployment that is suitable for most use cases.
The default CPU-only deployment doesn't prevent you from using GPU acceleration in external services, such as Ollama servers.

View file

@ -1,10 +0,0 @@
* Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
* Install [Podman](https://podman.io/docs/installation) (recommended) or [Docker](https://docs.docker.com/get-docker/).
The OpenRAG team recommends, at minimum, 8 GB of RAM for container VMs.
However, if you plan to upload large files regularly, more RAM is recommended.
For more information, see [Troubleshoot OpenRAG](/support/troubleshoot).
* Install [`podman-compose`](https://docs.podman.io/en/latest/markdown/podman-compose.1.html) or [Docker Compose](https://docs.docker.com/compose/install/).
To use Docker Compose with Podman, you must alias Docker Compose commands to Podman commands.

View file

@ -1 +0,0 @@
* Install [Python](https://www.python.org/downloads/release/python-3100/) version 3.13 or later.

View file

@ -1,2 +0,0 @@
* For Microsoft Windows, you must use the Windows Subsystem for Linux (WSL).
See [Install OpenRAG on Windows](/install-windows) before proceeding.

View file

@ -1,126 +0,0 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOpenSearchAuthMode from '@site/docs/_partial-opensearch-auth-mode.mdx';
You can use either **Basic Setup** or **Advanced Setup** to configure OpenRAG.
This choice determines how OpenRAG authenticates with your deployment's [OpenSearch instance](/knowledge), and it controls user access to documents stored in your OpenSearch knowledge base:
<PartialOpenSearchAuthMode />
:::info
You must use **Advanced Setup** if you want to [use OAuth connectors to upload documents from cloud storage](/ingestion#oauth-ingestion).
:::
If OpenRAG detects OAuth credentials during setup, it recommends **Advanced Setup** in the TUI.
<Tabs groupId="Setup method">
<TabItem value="Basic setup" label="Basic setup" default>
1. In the TUI, select **Basic Setup**.
2. Enter administrator passwords for the OpenRAG OpenSearch and Langflow services.
The OpenSearch password is required, and a secure password is automatically generated if you don't provide one manually.
The Langflow password is recommended but optional.
If the Langflow password is empty, the Langflow server starts without authentication enabled. For more information, see [Langflow settings](/reference/configuration#langflow-settings).
You can click **Generate Password** to create a Langflow password and username automatically.
3. Optional: Under **API Keys**, enter your model provider credentials, or leave these fields empty if you want to configure model provider credentials during the application onboarding process.
There is no material difference between providing these values now or during the [application onboarding process](#application-onboarding).
If you provide a credential now, it can be populated automatically during the application onboarding process if you enable the **Use environment API key** option.
OpenRAG's core functionality requires access to language and embedding models.
By default, OpenRAG uses OpenAI models.
If you aren't sure which models or providers to use, you must provide an OpenAI API key to use OpenRAG's default model configuration.
4. Optional: Under **Others**, edit the [knowledge base](/knowledge) paths if you don't want to use the default paths:
* **Documents Paths**: One or more paths to directories are where OpenRAG looks for documents to ingest.
* **OpenSearch Data Path**: Specify the path where you want OpenRAG to create your OpenSearch index.
5. Click **Save Configuration**.
Your passwords and API keys, if provided, are stored in the [OpenRAG `.env` file](/reference/configuration) at `~/.openrag/tui`.
If you modified any credentials that were pulled from an existing `.env` file, those values are updated in the `.env` file.
6. Click **Start OpenRAG** to start the OpenRAG services.
This process can take some time while OpenRAG pulls and runs the container images.
If all services start successfully, the TUI prints a confirmation message:
```text
Services started successfully
Command completed successfully
```
7. Click **Close**, and then click **Launch OpenRAG** or navigate to `localhost:3000` in your browser.
8. Continue with the [application onboarding process](#application-onboarding).
</TabItem>
<TabItem value="Advanced setup" label="Advanced setup">
1. In the TUI, select **Advanced Setup**.
2. Enter administrator passwords for the OpenRAG OpenSearch and Langflow services.
The OpenSearch password is required, and a secure password is automatically generated if you don't provide one manually.
The Langflow password is recommended but optional.
If the Langflow password is empty, the Langflow server starts without authentication enabled. For more information, see [Langflow settings](/reference/configuration#langflow-settings).
You can click **Generate Password** to create a Langflow password and username automatically.
3. Optional: Under **API Keys**, enter your model provider credentials, or leave the **OpenAI**, **Anthropic**, **Ollama**, and **IBM watsonx.ai** fields empty if you want to configure model provider credentials during the application onboarding process.
There is no material difference between providing these values now or during the [application onboarding process](#application-onboarding).
If you provide a credential now, it can be populated automatically during the application onboarding process if you enable the **Use environment API key** option.
OpenRAG's core functionality requires access to language and embedding models.
By default, OpenRAG uses OpenAI models.
If you aren't sure which models or providers to use, you must provide an OpenAI API key to use OpenRAG's default model configuration.
4. Recommended: To upload documents from external storage, such as Google Drive, add the required OAuth credentials for the connectors that you want to use under **API Keys**. These settings can be populated automatically if OpenRAG detects these credentials in an [OpenRAG `.env` file](/reference/configuration) at `~/.openrag/tui`.
* **Google**: Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). For more information, see the [Google OAuth client documentation](https://developers.google.com/identity/protocols/oauth2).
* **Microsoft**: For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide [Azure application registration credentials for SharePoint and OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online). For more information, see the [Microsoft Graph OAuth client documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth).
* **Amazon**: Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on [Configuring access to AWS applications](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html).
You can [manage OAuth credentials](/ingestion#oauth-ingestion) later, but it is recommended to configure them during initial set up.
5. Register the redirect URIs shown in the TUI in your OAuth provider.
These are the URLs your OAuth provider will use to redirect users back to OpenRAG after they sign in.
6. Optional: Under **Others**, you can edit the following settings if needed:
* **Documents Paths**: Use the default path or provide one or more paths to directories are where OpenRAG looks for documents to ingest in to your [knowledge base](/knowledge).
* **OpenSearch Data Path**: Specify the path where you want OpenRAG to create your OpenSearch index.
* **Langflow Public URL (`LANGFLOW_PUBLIC_URL`)** : Sets the base address to access the Langflow web interface. This is where users interact with flows in a browser.
* **Webhook Base URL (`WEBHOOK_BASE_URL`)**: If applicable, set the base address for your OAuth connector endpoints. If set, the OAuth connector webhook URLs are constructed as `WEBHOOK_BASE_URL/connectors/${provider}/webhook`.
7. Click **Save Configuration**.
Your passwords, API key, and OAuth credentials, if provided, are stored in the [OpenRAG `.env` file](/reference/configuration) at `~/.openrag/tui`.
If you modified any credentials that were pulled from an existing `.env` file, those values are updated in the `.env` file.
8. Click **Start OpenRAG** to start the OpenRAG services.
This process can take some time while OpenRAG pulls and runs the container images.
If all services start successfully, the TUI prints a confirmation message:
```text
Services started successfully
Command completed successfully
```
9. Click **Close**, and then click **Launch OpenRAG** or navigate to `localhost:3000` in your browser.
10. If you enabled OAuth connectors, you must sign in to your OAuth provider before being redirected to your OpenRAG instance.
11. Continue with the [application onboarding process](#application-onboarding).
</TabItem>
</Tabs>

View file

@ -1,5 +0,0 @@
import Icon from "@site/src/components/icon/icon";
When using the OpenRAG **Chat**, click <Icon name="Plus" aria-hidden="true"/> **Add** in the chat input field to upload a file to the current chat session.
Files added this way are processed and made available to the agent for the current conversation only.
These files aren't stored in the knowledge base permanently.

View file

@ -1,91 +1,66 @@
---
title: Use Langflow in OpenRAG
title: Langflow in OpenRAG
slug: /agents
---
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialModifyFlows from '@site/docs/_partial-modify-flows.mdx';
OpenRAG includes a built-in [Langflow](https://docs.langflow.org/) instance for creating and managing functional application workflows called _flows_.
In a flow, the individual workflow steps are represented by [_components_](https://docs.langflow.org/concepts-components) that are connected together to form a complete process.
OpenRAG leverages Langflow's Agent component to power the OpenRAG OpenSearch Agent flow.
OpenRAG includes several built-in flows:
[Flows](https://docs.langflow.org/concepts-overview) in Langflow are functional representations of application workflows, with multiple [component](https://docs.langflow.org/concepts-components) nodes connected as single steps in a workflow.
* The [**OpenRAG OpenSearch Agent** flow](/chat#flow) powers the **Chat** feature in OpenRAG.
* The [**OpenSearch Ingestion** and **OpenSearch URL Ingestion** flows](/ingestion) process documents and web content for storage in your OpenSearch knowledge base.
* The [**OpenRAG OpenSearch Nudges** flow](/chat#nudges) provides optional contextual suggestions in the OpenRAG **Chat**.
In the OpenRAG OpenSearch Agent flow, components like the Langflow [**Agent** component](https://docs.langflow.org/agents) and [**OpenSearch** component](https://docs.langflow.org/bundles-elastic#opensearch) are connected to intelligently chat with your knowledge by embedding your query, comparing it the vector database embeddings, and generating a response with the LLM.
You can customize these flows and create your own flows using OpenRAG's embedded Langflow visual editor.
![OpenRAG Open Search Agent Flow](/img/opensearch-agent-flow.png)
## Inspect and modify flows {#inspect-and-modify-flows}
The Agent component shines here in its ability to make decisions on not only what query should be sent, but when a query is necessary to solve the problem at hand.
All OpenRAG flows are designed to be modular, performant, and provider-agnostic.
<details closed>
<summary>How do agents work?</summary>
To view and modify a flow in OpenRAG, click <Icon name="Settings2" aria-hidden="true"/> **Settings**.
From here, you can manage OAuth connectors, model providers, and common parameters for the **Agent** and **Knowledge Ingestion** flows.
Agents extend Large Language Models (LLMs) by integrating tools, which are functions that provide additional context and enable autonomous task execution. These integrations make agents more specialized and powerful than standalone LLMs.
To further explore and edit flows, click **Edit in Langflow** to launch the embedded [Langflow visual editor](https://docs.langflow.org/concepts-overview) where you can fully [customize the flow](https://docs.langflow.org/concepts-flows) to suit your use case.
Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action. For example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code.
:::tip
After you click **Edit in Langflow**, you can access and edit all of OpenRAG's built-in flows from the Langflow editor's [**Projects** page](https://docs.langflow.org/concepts-flows#projects).
Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response. The response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API.
If you edit any flows other than the **Agent** or **Knowledge Ingestion** flows, it is recommended that you [export the flows](https://docs.langflow.org/concepts-flows-import) before editing so you can revert them to their original state if needed.
:::
In an agentic context, tools are functions that the agent can run to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface that the agent understands. Agents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request.
For example, the following steps explain how to edit the built-in **Agent** flow, which is the **OpenRAG OpenSearch Agent** flow used for the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**:
</details>
1. In OpenRAG, click <Icon name="Settings2" aria-hidden="true"/> **Settings**, and then find the **Agent** section.
## Use the OpenRAG OpenSearch Agent flow {#flow}
2. If you only need to edit the language model or agent instructions, edit those fields directly on the **Settings** page.
Language model changes are saved automatically.
To apply new instructions, click **Save Agent Instructions**.
If you've chatted with your knowledge in OpenRAG, you've already experienced the OpenRAG OpenSearch Agent chat flow.
To switch OpenRAG over to the [Langflow visual editor](https://docs.langflow.org/concepts-overview) and view the OpenRAG OpenSearch Agentflow, click <Icon name="Settings2" aria-hidden="true"/> **Settings**, and then click **Edit in Langflow**.
This flow contains eight components connected together to chat with your data:
3. To edit all flow settings and components with full customization capabilities, click **Edit in Langflow** to launch the Langflow visual editor in a new browser tab.
* The [**Agent** component](https://docs.langflow.org/agents) orchestrates the entire flow by deciding when to search the knowledge base, how to formulate search queries, and how to combine retrieved information with the user's question to generate a comprehensive response.
The **Agent** behaves according to the prompt in the **Agent Instructions** field.
* The [**Chat Input** component](https://docs.langflow.org/components-io) is connected to the Agent component's Input port. This allows to flow to be triggered by an incoming prompt from a user or application.
* The [**OpenSearch** component](https://docs.langflow.org/bundles-elastic#opensearch) is connected to the Agent component's Tools port. The agent may not use this database for every request; the agent only uses this connection if it decides the knowledge can help respond to the prompt.
* The [**Language Model** component](https://docs.langflow.org/components-models) is connected to the Agent component's Language Model port. The agent uses the connected LLM to reason through the request sent through Chat Input.
* The [**Embedding Model** component](https://docs.langflow.org/components-embedding-models) is connected to the OpenSearch component's Embedding port. This component converts text queries into vector representations that are compared with document embeddings stored in OpenSearch for semantic similarity matching. This gives your Agent's queries context.
* The [**Text Input** component](https://docs.langflow.org/components-io) is populated with the global variable `OPENRAG-QUERY-FILTER`.
This filter is the [Knowledge filter](/knowledge#create-knowledge-filters), and filters which knowledge sources to search through.
* The **Agent** component's Output port is connected to the [**Chat Output** component](https://docs.langflow.org/components-io), which returns the final response to the user or application.
* An [**MCP Tools** component](https://docs.langflow.org/mcp-client) is connected to the Agent's **Tools** port. This component calls the [OpenSearch URL Ingestion flow](/ingestion#url-flow), which Langflow uses as an MCP server to fetch content from URLs and store in OpenSearch.
If prompted to acknowledge that you are entering Langflow, click **Proceed**.
<PartialModifyFlows />
If Langflow requests login information, enter the `LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD` from your [OpenRAG `.env` file](/reference/configuration).
For an example of changing out the agent's language model in OpenRAG, see the [Quickstart](/quickstart#change-components).
![OpenRAG OpenSearch Agent flow](/img/opensearch-agent-flow.png)
To restore the flow to its initial state, in OpenRAG, click <Icon name="Settings2" aria-hidden="true"/> **Settings**, and then click **Restore Flow**.
OpenRAG warns you that this discards all custom settings. Click **Restore** to restore the flow.
4. Modify the flow as desired, and then press <kbd>Command</kbd>+<kbd>S</kbd> (<kbd>Ctrl</kbd>+<kbd>S</kbd>) to save your changes.
## Additional Langflow functionality
You can close the Langflow browser tab, or leave it open if you want to continue experimenting with the flow editor.
Langflow includes features beyond Agents to help you integrate OpenRAG into your application, and all Langflow features are included in OpenRAG.
5. After you modify any **Agent** flow settings, go to the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, and then click <Icon name="Plus" aria-hidden="true"/> **Start new conversation** in the **Conversations** list.
This ensures that the chat doesn't persist any context from the previous conversation with the original flow settings.
* Langflow can serve your flows as an [MCP server](https://docs.langflow.org/mcp-server), or consume other MCP servers as an [MCP client](https://docs.langflow.org/mcp-client). Get started with the [MCP tutorial](https://docs.langflow.org/mcp-tutorial).
### Revert a built-in flow to its original configuration {#revert-a-built-in-flow-to-its-original-configuration}
* If you don't see the component you need, extend Langflow's functionality by creating [custom Python components](https://docs.langflow.org/components-custom-components).
After you edit the **Agent** or **Knowledge Ingestion** built-in flows, you can click **Restore flow** on the **Settings** page to revert either flow to its original state when you first installed OpenRAG.
This is a destructive action that discards all customizations to the flow.
This option isn't available for other built-in flows such as the **Nudges** flow.
To restore these flows to their original state, you must reimport the flow from a backup (if you exported one before editing), or [reset](/manage-services#reset-containers) or [reinstall](/reinstall) OpenRAG.
## Build custom flows and use other Langflow functionality
In addition to OpenRAG's built-in flows, all Langflow features are available through OpenRAG, including the ability to [create your own flows](https://docs.langflow.org/concepts-flows) and popular extensibility features such as the following:
* [Create custom components](https://docs.langflow.org/components-custom-components).
* Integrate with many third-party services through [bundles](https://docs.langflow.org/components-bundle-components).
* Use [MCP clients](https://docs.langflow.org/mcp-client) and [MCP servers](https://docs.langflow.org/mcp-server), and serve flows as MCP tools for your agentic flows.
Explore the [Langflow documentation](https://docs.langflow.org/) to learn more about the Langflow platform, features, and visual editor.
## Modify a flow at runtime {#modify-a-flow-at-runtime}
You can use _tweaks_ to modify flow settings at runtime without permanently changing the flow's configuration.
Tweaks are one-time parameter modifications that are passed to specific Langflow components during flow execution.
For more information on tweaks, see the Langflow documentation on [Input schema (tweaks)](https://docs.langflow.org/concepts-publish#input-schema).
## Set the Langflow version
By default, OpenRAG is pinned to the latest Langflow Docker image for stability.
If necessary, you can set a specific Langflow version with the `LANGFLOW_VERSION` [environment variable](/reference/configuration). However, there are risks to changing this setting:
* The [Langflow documentation](https://docs.langflow.org/) describes the functionality present in the latest release of the Langflow OSS Python package. If your `LANGFLOW_VERSION` is different, the Langflow documentation might not align with the features and default settings in your OpenRAG installation.
* Components might break, including components in OpenRAG's built-in flows.
* Default settings and behaviors might change causing unexpected results when OpenRAG expects a newer default.
* Langflow offers component [bundles](https://docs.langflow.org/components-bundle-components) to integrate with many popular vector stores, AI/ML providers, and search APIs.

View file

@ -1,116 +0,0 @@
---
title: Chat in OpenRAG
slug: /chat
---
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialIntegrateChat from '@site/docs/_partial-integrate-chat.mdx';
import PartialTempKnowledge from '@site/docs/_partial-temp-knowledge.mdx';
After you [upload documents to your knowledge base](/ingestion), you can use the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat** feature to interact with your knowledge through natural language queries.
The OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat** uses an LLM-powered agent to understand your queries, retrieve relevant information from your knowledge base, and generate context-aware responses.
The agent can also fetch information from URLs and new documents that you provide during the chat session.
To limit the knowledge available to the agent, use [filters](/knowledge-filters).
The agent can call specialized Model Context Protocol (MCP) tools to extend its capabilities.
To add or change the available tools, you must edit the [**OpenRAG OpenSearch Agent** flow](#flow).
:::tip
Try chatting, uploading documents, and modifying chat settings in the [quickstart](/quickstart).
:::
## OpenRAG OpenSearch Agent flow {#flow}
When you use the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, the **OpenRAG OpenSearch Agent** flow runs in the background to retrieve relevant information from your knowledge base and generate a response.
If you [inspect the flow in Langflow](/agents#inspect-and-modify-flows), you'll see that it is comprised of eight components that work together to ingest chat messages, retrieve relevant information from your knowledge base, and then generate responses.
When you inspect this flow, you can edit the components to customize the agent's behavior.
![OpenRAG Open Search Agent Flow](/img/opensearch-agent-flow.png)
* [**Chat Input** component](https://docs.langflow.org/chat-input-and-output#chat-input): This component starts the flow when it receives a chat message. It is connected to the **Agent** component's **Input** port.
When you use the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, your chat messages are passed to the **Chat Input** component, which then sends them to the **Agent** component for processing.
* [**Agent** component](https://docs.langflow.org/components-agents): This component orchestrates the entire flow by processing chat messages, searching the knowledge base, and organizing the retrieved information into a cohesive response.
The agent's general behavior is defined by the prompt in the **Agent Instructions** field and the model connected to the **Language Model** port.
One or more specialized tools can be attached to the **Tools** port to extend the agent's capabilities. In this case, there are two tools: **MCP Tools** and **OpenSearch**.
The **Agent** component is the star of this flow because it powers decision making, tool calling, and an LLM-driven conversational experience.
<details>
<summary>How do agents work?</summary>
Agents extend Large Language Models (LLMs) by integrating tools, which are functions that provide additional context and enable autonomous task execution. These integrations make agents more specialized and powerful than standalone LLMs.
Whereas an LLM might generate acceptable, inert responses to general queries and tasks, an agent can leverage the integrated context and tools to provide more relevant responses and even take action. For example, you might create an agent that can access your company's documentation, repositories, and other resources to help your team with tasks that require knowledge of your specific products, customers, and code.
Agents use LLMs as a reasoning engine to process input, determine which actions to take to address the query, and then generate a response. The response could be a typical text-based LLM response, or it could involve an action, like editing a file, running a script, or calling an external API.
In an agentic context, tools are functions that the agent can run to perform tasks or access external resources. A function is wrapped as a Tool object with a common interface that the agent understands. Agents become aware of tools through tool registration, which is when the agent is provided a list of available tools typically at agent initialization. The Tool object's description tells the agent what the tool can do so that it can decide whether the tool is appropriate for a given request.
</details>
* [**Language Model** component](https://docs.langflow.org/components-models): Connected to the **Agent** component's **Language Model** port, this component provides the base language model driver for the agent. The agent cannot function without a model because the model is used for general knowledge, reasoning, and generating responses.
Different models can change the style and content of the agent's responses, and some models might be better suited for certain tasks than others. If the agent doesn't seem to be handling requests well, try changing the model to see how the responses change. For example, fast models might be good for simple queries, but they might not have the depth of reasoning for complex, multi-faceted queries.
* [**MCP Tools** component](https://docs.langflow.org/mcp-client): Connected to the **Agent** component's **Tools** port, this component can be used to [access any MCP server](https://docs.langflow.org/mcp-server) and the MCP tools provided by that server. In this case, your OpenRAG Langflow instance's [**Starter Project**](https://docs.langflow.org/concepts-flows#projects) is the MCP server, and the [**OpenSearch URL Ingestion** flow](/ingestion#url-flow) is the MCP tool.
This flow fetches content from URLs, and then stores the content in your OpenRAG OpenSearch knowledge base. By serving this flow as an MCP tool, the agent can selectively call this tool if a URL is detected in the chat input.
* [**OpenSearch** component](https://docs.langflow.org/bundles-elastic#opensearch): Connected to the **Agent** component's **Tools** port, this component lets the agent search your [OpenRAG OpenSearch knowledge base](/knowledge). The agent might not use this database for every request; the agent uses this connection only if it decides that documents in your knowledge base are relevant to your query.
* [**Embedding Model** component](https://docs.langflow.org/components-embedding-models): Connected to the **OpenSearch** component's **Embedding** port, this component generates embeddings from chat input that are used in [similarity search](https://www.ibm.com/think/topics/vector-search) to find content in your knowledge base that is relevant to the chat input. The agent uses this information to generate context-aware responses that are specialized for your data.
It is critical that the embedding model used here matches the embedding model used when you [upload documents to your knowledge base](/ingestion). Mismatched models and dimensions can degrade the quality of similarity search results causing the agent to retrieve irrelevant documents from your knowledge base.
* [**Text Input** component](https://docs.langflow.org/text-input-and-output#text-input): Connected to the **OpenSearch** component's **Search Filters** port, this component is populated with a Langflow global variable named `OPENRAG-QUERY-FILTER`. If a global or chat-level [knowledge filter](/knowledge-filters) is set, then the variable contains the filter expression, which limits the documents that the agent can access in the knowledge base.
If no knowledge filter is set, then the `OPENRAG-QUERY-FILTER` variable is empty, and the agent can access all documents in the knowledge base.
* [**Chat Output** component](https://docs.langflow.org/chat-input-and-output#chat-output): Connected to the **Agent** component's **Output** port, this component returns the agent's generated response as a chat message.
## Nudges {#nudges}
When you use the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, the **OpenRAG OpenSearch Nudges** flow runs in the background to pull additional context from your knowledge base and chat history.
Nudges appear as prompts in the chat, and they are based on the contents of your OpenRAG OpenSearch knowledge base.
Click a nudge to accept it and start a chat based on the nudge.
Like OpenRAG's other built-in flows, you can [inspect the flow in Langflow](/agents#inspect-and-modify-flows), and you can customize it if you want to change the nudge behavior.
However, this flow is specifically designed to work with the OpenRAG chat and knowledge base.
Major changes to this flow might break the nudge functionality or produce irrelevant nudges.
The **Nudges** flow consists of **Embedding model**, **Language model**, **OpenSearch**, **Input/Output*, and other components that browse your knowledge base, identify key themes and possible insights, and then produce prompts based on the findings.
For example, if your knowledge base contains documents about cybersecurity, possible nudges might include `Explain zero trust architecture principles` or `How to identify a social engineering attack`.
## Upload documents to the chat
<PartialTempKnowledge />
## Inspect tool calls and knowledge
During the chat, you'll see information about the agent's process. For more detail, you can inspect individual tool calls. This is helpful for troubleshooting because it shows you how the agent used particular tools. For example, click <Icon name="Gear" aria-hidden="true"/> **Function Call: search_documents (tool_call)** to view the log of tool calls made by the agent to the **OpenSearch** component.
If documents in your knowledge base seem to be missing or interpreted incorrectly, see [Troubleshoot ingestion](/ingestion#troubleshoot-ingestion).
If tool calls and knowledge appear normal, but the agent's responses seem off-topic or incorrect, consider changing the agent's language model or prompt, as explained in [Inspect and modify flows](/agents#inspect-and-modify-flows).
## Integrate OpenRAG chat into an application
You can integrate OpenRAG flows into your applications using the [Langflow API](https://docs.langflow.org/api-reference-api-examples).
To simplify this integration, you can get pre-configured code snippets directly from the embedded Langflow visual editor.
The following example demonstrates how to generate and use code snippets for the **OpenRAG OpenSearch Agent** flow:
<PartialIntegrateChat />
## Troubleshoot chat {#troubleshoot-chat}
The following issues can occur when using the OpenRAG **Chat** feature:
* Documents seem to be missing or interpreted incorrectly: See [Troubleshoot ingestion](/ingestion#troubleshoot-ingestion).
* Service is suddenly unavailable when it was working previously: If there is no other obvious cause, such as the service or container VM being stopped or disconnected, there might be a problem with the flow configuration. Use the [**Restore flow** option](/agents#revert-a-built-in-flow-to-its-original-configuration) to revert the **OpenRAG OpenSearch Agent** flow to its original configuration.
If you made customizations to the flow, make sure to [export your flow](https://docs.langflow.org/concepts-flows-import) before restoring the flow.

View file

@ -1,292 +1,81 @@
---
title: Ingest knowledge
title: Docling in OpenRAG
slug: /ingestion
---
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialTempKnowledge from '@site/docs/_partial-temp-knowledge.mdx';
import PartialIngestionFlow from '@site/docs/_partial-ingestion-flow.mdx';
import PartialDockerComposeUp from '@site/docs/_partial-docker-compose-up.mdx';
import PartialDockerStopAll from '@site/docs/_partial-docker-stop-all.mdx';
import PartialModifyFlows from '@site/docs/_partial-modify-flows.mdx';
Upload documents to your [OpenRAG OpenSearch instance](/knowledge) to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.
Documents are processed through OpenRAG's knowledge ingestion flows with Docling.
OpenRAG uses [Docling](https://docling-project.github.io/docling/) for document ingestion.
More specifically, OpenRAG uses [Docling Serve](https://github.com/docling-project/docling-serve), which starts a `docling serve` process on your local machine and runs Docling ingestion through an API service.
OpenRAG can ingest knowledge from direct file uploads, URLs, and OAuth authenticated connectors.
Docling ingests documents from your local machine or OAuth connectors, splits them into chunks, and stores them as separate, structured documents in the OpenSearch `documents` index.
Knowledge ingestion is powered by OpenRAG's built-in knowledge ingestion flows that use Docling to process documents before storing the documents in your OpenSearch database.
During ingestion, documents are broken into smaller chunks of content that are then embedded using your selected [embedding model](/knowledge#set-the-embedding-model-and-dimensions).
Then, the chunks, embeddings, and associated metadata (which connects chunks of the same document) are stored in your OpenSearch database.
OpenRAG chose Docling for its support for a wide variety of file formats, high performance, and advanced understanding of tables and images.
To modify chunking behavior and other ingestion settings, see [Knowledge ingestion settings](/knowledge#knowledge-ingestion-settings) and [Inspect and modify flows](/agents#inspect-and-modify-flows).
To modify OpenRAG's ingestion settings, including the Docling settings and ingestion flows, click 2" aria-hidden="true"/> **Settings**.
## Ingest local files and folders
## Knowledge ingestion settings
You can upload files and folders from your local machine to your knowledge base:
These settings configure the Docling ingestion parameters.
1. Click <Icon name="Library" aria-hidden="true"/> **Knowledge** to view your OpenSearch knowledge base.
OpenRAG will warn you if `docling serve` is not running.
To start or stop `docling serve` or any other native services, in the TUI main menu, click **Start Native Services** or **Stop Native Services**.
2. Click **Add Knowledge** to add your own documents to your OpenRAG knowledge base.
**Embedding model** determines which AI model is used to create vector embeddings. The default is the OpenAI `text-embedding-3-small` model.
3. To upload one file, click <Icon name="File" aria-hidden="true"/> **File**. To upload all documents in a folder, click <Icon name="Folder" aria-hidden="true"/> **Folder**.
**Chunk size** determines how large each text chunk is in number of characters.
Larger chunks yield more context per chunk, but may include irrelevant information. Smaller chunks yield more precise semantic search, but may lack context.
The default value of `1000` characters provides a good starting point that balances these considerations.
The default path is `~/.openrag/documents`.
To change this path, see [Set the local documents path](/knowledge#set-the-local-documents-path).
**Chunk overlap** controls the number of characters that overlap over chunk boundaries.
Use larger overlap values for documents where context is most important, and use smaller overlap values for simpler documents, or when optimization is most important.
The default value of 200 characters of overlap with a chunk size of 1000 (20% overlap) is suitable for general use cases. Decrease the overlap to 10% for a more efficient pipeline, or increase to 40% for more complex documents.
The selected files are processed in the background through the **OpenSearch Ingestion** flow.
**Table Structure** enables Docling's [`DocumentConverter`](https://docling-project.github.io/docling/reference/document_converter/) tool for parsing tables. Instead of treating tables as plain text, tables are output as structured table data with preserved relationships and metadata. **Table Structure** is enabled by default.
<PartialIngestionFlow />
**OCR** enables or disabled OCR processing when extracting text from images and scanned documents.
OCR is disabled by default. This setting is best suited for processing text-based documents as quickly as possible with Docling's [`DocumentConverter`](https://docling-project.github.io/docling/reference/document_converter/). Images are ignored and not processed.
You can [monitor ingestion](#monitor-ingestion) to see the progress of the uploads and check for failed uploads.
Enable OCR when you are processing documents containing images with text that requires extraction, or for scanned documents. Enabling OCR can slow ingestion performance.
## Ingest local files temporarily
If OpenRAG detects that the local machine is running on macOS, OpenRAG uses the [ocrmac](https://www.piwheels.org/project/ocrmac/) OCR engine. Other platforms use [easyocr](https://www.jaided.ai/easyocr/).
<PartialTempKnowledge />
**Picture descriptions** adds image descriptions generated by the [SmolVLM-256M-Instruct](https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct) model to OCR processing. Enabling picture descriptions can slow ingestion performance.
## Ingest files with OAuth connectors {#oauth-ingestion}
## Knowledge ingestion flows
OpenRAG can use OAuth authenticated connectors to ingest documents from the following external services:
[Flows](https://docs.langflow.org/concepts-overview) in Langflow are functional representations of application workflows, with multiple [component](https://docs.langflow.org/concepts-components) nodes connected as single steps in a workflow.
* AWS S3
* Google Drive
* Microsoft OneDrive
* Microsoft Sharepoint
The **OpenSearch Ingestion** flow is the default knowledge ingestion flow in OpenRAG: when you **Add Knowledge** in OpenRAG, you run the OpenSearch Ingestion flow in the background. The flow ingests documents using **Docling Serve** to import and process documents.
These connectors enable seamless ingestion of files from cloud storage to your OpenRAG knowledge base.
This flow contains ten components connected together to process and store documents in your knowledge base.
Individual users can connect their personal cloud storage accounts to OpenRAG. Each user must separately authorize OpenRAG to access their own cloud storage. When a user connects a cloud storage service, they are redirected to authenticate with that service provider and grant OpenRAG permission to sync documents from their personal cloud storage.
* The [**Docling Serve** component](https://docs.langflow.org/bundles-docling) processes input documents by connecting to your instance of Docling Serve.
* The [**Export DoclingDocument** component](https://docs.langflow.org/components-docling) exports the processed DoclingDocument to markdown format with image export mode set to placeholder. This conversion makes the structured document data into a standardized format for further processing.
* Three [**DataFrame Operations** components](https://docs.langflow.org/components-processing#dataframe-operations) sequentially add metadata columns to the document data of `filename`, `file_size`, and `mimetype`.
* The [**Split Text** component](https://docs.langflow.org/components-processing#split-text) splits the processed text into chunks with a chunk size of 1000 characters and an overlap of 200 characters.
* Four **Secret Input** components provide secure access to configuration variables: `CONNECTOR_TYPE`, `OWNER`, `OWNER_EMAIL`, and `OWNER_NAME`. These are runtime variables populated from OAuth login.
* The **Create Data** component combines the secret inputs into a structured data object that will be associated with the document embeddings.
* The [**Embedding Model** component](https://docs.langflow.org/components-embedding-models) generates vector embeddings using OpenAI's `text-embedding-3-small` model. The embedding model is selected at [Application onboarding] and cannot be changed.
* The [**OpenSearch** component](https://docs.langflow.org/bundles-elastic#opensearch) stores the processed documents and their embeddings in the `documents` index at `https://opensearch:9200`. By default, the component is authenticated with a JWT token, but you can also select `basic` auth mode, and enter your OpenSearch admin username and password.
### Enable OAuth connectors
<PartialModifyFlows />
Before users can connect their own cloud storage accounts, you must configure the provider's OAuth credentials in OpenRAG. Typically, this requires that you register OpenRAG as an OAuth application in your cloud provider, and then obtain the app's OAuth credentials, such as a client ID and secret key.
To enable multiple connectors, you must register an app and generate credentials for each provider.
### OpenSearch URL Ingestion flow {#url-flow}
<Tabs>
<TabItem value="TUI" label="TUI-managed services" default>
An additional knowledge ingestion flow is included in OpenRAG, where it is used as an MCP tool by the [**Open Search Agent flow**](/agents#flow).
The agent calls this component to fetch web content, and the results are ingested into OpenSearch.
If you use the [Terminal User Interface (TUI)](/tui) to manage your OpenRAG services, enter OAuth credentials on the **Advanced Setup** page.
You can do this during [installation](/install#setup), or you can add the credentials afterwards:
For more on using MCP clients in Langflow, see [MCP clients](https://docs.langflow.org/mcp-client).\
To connect additional MCP servers to the MCP client, see [Connect to MCP servers from your application](https://docs.langflow.org/mcp-tutorial).
1. If OpenRAG is running, click **Stop All Services** in the TUI.
## Use OpenRAG default ingestion instead of Docling serve
2. Open the **Advanced Setup** page, and then add the OAuth credentials for the cloud storage providers that you want to use under **API Keys**:
If you want to use OpenRAG's built-in pipeline instead of Docling serve, set `DISABLE_INGEST_WITH_LANGFLOW=true` in [Environment variables](/reference/configuration#document-processing).
* **Google**: Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). For more information, see the [Google OAuth client documentation](https://developers.google.com/identity/protocols/oauth2).
* **Microsoft**: For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide [Azure application registration credentials for SharePoint and OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online). For more information, see the [Microsoft Graph OAuth client documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth).
* **Amazon**: Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on [Configuring access to AWS applications](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html).
The built-in pipeline still uses the Docling processor, but uses it directly without the Docling Serve API.
3. Register the redirect URIs shown in the TUI in your OAuth provider.
These are the URLs your OAuth provider will use to redirect users back to OpenRAG after they sign in.
4. Click **Save Configuration** to add the OAuth credentials to your [OpenRAG `.env` file](/reference/configuration).
5. Click **Start Services** to restart the OpenRAG containers with OAuth enabled.
6. Launch the OpenRAG app.
You should be prompted to sign in to your OAuth provider before being redirected to your OpenRAG instance.
</TabItem>
<TabItem value="env" label="Self-managed services">
If you [installed OpenRAG with self-managed services](/docker), set OAuth credentials in your [OpenRAG `.env` file](/reference/configuration).
You can do this during [initial set up](/docker#setup), or you can add the credentials afterwards:
1. Stop all OpenRAG containers:
<PartialDockerStopAll />
2. Edit your OpenRAG `.env` file to add the OAuth credentials for the cloud storage providers that you want to use:
* **Google**: Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). For more information, see the [Google OAuth client documentation](https://developers.google.com/identity/protocols/oauth2).
```env
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
```
* **Microsoft**: For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide [Azure application registration credentials for SharePoint and OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online). For more information, see the [Microsoft Graph OAuth client documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth).
```env
MICROSOFT_GRAPH_OAUTH_CLIENT_ID=
MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=
```
* **Amazon**: Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on [Configuring access to AWS applications](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html).
```env
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
```
3. Save the `.env` file.
4. Restart your OpenRAG containers:
<PartialDockerComposeUp />
5. Access the OpenRAG frontend at `http://localhost:3000`.
You should be prompted to sign in to your OAuth provider before being redirected to your OpenRAG instance.
</TabItem>
</Tabs>
### Authenticate and ingest files from cloud storage
After you start OpenRAG with OAuth connectors enabled, each user is prompted to authenticate with the OAuth provider upon accessing your OpenRAG instance.
Individual authentication is required to access a user's cloud storage from your OpenRAG instance.
For example, if a user navigates to the default OpenRAG URL at `http://localhost:3000`, they are redirected to the OAuth provider's sign-in page.
After authenticating and granting the required permissions for OpenRAG, the user is redirected back to OpenRAG.
To ingest knowledge with an OAuth connector, do the following:
1. Click <Icon name="Library" aria-hidden="true"/> **Knowledge** to view your OpenSearch knowledge base.
2. Click **Add Knowledge**, and then select a storage provider.
3. On the **Add Cloud Knowledge** page, click **Add Files**, and then select the files and folders to ingest from the connected storage.
4. Click **Ingest Files**.
The selected files are processed in the background through the **OpenSearch Ingestion** flow.
<PartialIngestionFlow />
You can [monitor ingestion](#monitor-ingestion) to see the progress of the uploads and check for failed uploads.
## Ingest knowledge from URLs {#url-flow}
When using the OpenRAG chat, you can enter URLs into the chat to be ingested in real-time during your conversation.
:::info
The chat cannot ingest URLs that end in static document file extensions like `.pdf`.
To upload these types of files, see [Ingest local files and folders](#ingest-local-files-and-folders) and [Ingest files with OAuth connectors](#oauth-ingestion).
:::
OpenRAG runs the **OpenSearch URL Ingestion** flow to ingest web content from URLs.
This flow isn't directly accessible from the OpenRAG user interface.
Instead, this flow is called by the [**OpenRAG OpenSearch Agent** flow](/chat#flow) as a Model Context Protocol (MCP) tool.
The agent can call this component to fetch web content from a given URL, and then ingest that content into your OpenSearch knowledge base.
Like all OpenRAG flows, you can [inspect the flow in Langflow](/agents#inspect-and-modify-flows), and you can customize it.
For more information about MCP in Langflow, see the Langflow documentation on [MCP clients](https://docs.langflow.org/mcp-client) and [MCP servers](https://docs.langflow.org/mcp-tutorial).
## Monitor ingestion {#monitor-ingestion}
Depending on the amount of data to ingest, document ingestion can take a few seconds, minutes, or longer.
For this reason, document ingestion tasks run in the background.
In the OpenRAG user interface, a badge is shown on <Icon name="Bell" aria-hidden="true"/> **Tasks** when OpenRAG tasks are active.
Click <Icon name="Bell" aria-hidden="true"/> **Tasks** to inspect and cancel tasks.
Tasks are separated into multiple sections:
* The **Active Tasks** section includes all tasks that are **Pending**, **Running**, or **Processing**:
* **Pending**: The task is queued and waiting to start.
* **Running**: The task is actively processing files.
* **Processing**: The task is performing ingestion operations.
To stop an active task, click <Icon name="X" aria-hidden="true"/> **Cancel**. Canceling a task stops processing immediately and marks the ingestion as failed.
* The **Recent Tasks** section lists recently finished tasks.
:::warning
**Completed** doesn't mean success.
A completed task can report successful ingestions, failed ingestions, or both, depending on the number of files processed.
:::
Check the **Success** and **Failed** counts for each completed task to determine the overall success rate.
**Failed** means something went wrong during ingestion, or the task was manually canceled.
For more information, see [Troubleshoot ingestion](#troubleshoot-ingestion).
For each task, depending on its state, you can find the task ID, start time, duration, number of files processed successfully, number of files that failed, and the number of files enqueued for processing.
### Ingestion performance expectations
The following performance test was conducted with Docling Serve.
On a local VM with 7 vCPUs and 8 GiB RAM, OpenRAG ingested approximately 5.03 GB across 1,083 files in about 42 minutes.
This equates to approximately 2.4 documents per second.
You can generally expect equal or better performance on developer laptops, and significantly faster performance on servers.
Throughput scales with CPU cores, memory, storage speed, and configuration choices, such as the embedding model, chunk size, overlap, and concurrency.
This test returned 12 error, approximately 1.1 percent of the total files ingested.
All errors were file-specific, and they didn't stop the pipeline.
<details>
<summary>Ingestion performance test details</summary>
* Ingestion dataset:
* Total files: 1,083 items mounted
* Total size on disk: 5,026,474,862 bytes (approximately 5.03 GB)
* Hardware specifications:
* Machine: Apple M4 Pro
* Podman VM:
* Name: podman-machine-default
* Type: applehv
* vCPUs: 7
* Memory: 8 GiB
* Disk size: 100 GiB
* Test results:
```text
2025-09-24T22:40:45.542190Z /app/src/main.py:231 Ingesting default documents when ready disable_langflow_ingest=False
2025-09-24T22:40:45.546385Z /app/src/main.py:270 Using Langflow ingestion pipeline for default documents file_count=1082
...
2025-09-24T23:19:44.866365Z /app/src/main.py:351 Langflow ingestion completed success_count=1070 error_count=12 total_files=1082
```
* Elapsed time: Approximately 42 minutes 15 seconds (2,535 seconds)
* Throughput: Approximately 2.4 documents per second
</details>
## Troubleshoot ingestion {#troubleshoot-ingestion}
The following issues can occur during document ingestion.
### Failed or slow ingestion
If an ingestion task fails, do the following:
* Make sure you uploaded only supported file types.
* Split very large files into smaller files.
* Remove unusual or complex embedded content, such as videos or animations. Although Docling can replace some non-text content with placeholders during ingestion, some embedded content might cause errors.
* Make sure your Podman/Docker VM has sufficient memory for the ingestion tasks.
The minimum recommendation is 8 GB of RAM.
If you regularly upload large files, more RAM is recommended.
For more information, see [Memory issue with Podman on macOS](/support/troubleshoot#memory-issue-with-podman-on-macos) and [Container out of memory errors](/support/troubleshoot#container-out-of-memory-errors).
* If OCR ingestion fails due to OCR missing, see [OCR ingestion fails (easyocr not installed)](/support/troubleshoot#ocr-ingestion-fails-easyocr-not-installed).
### Problems when referencing documents in chat
If the OpenRAG **Chat** doesn't seem to use your documents correctly, [browse your knowledge base](/knowledge#browse-knowledge) to confirm that the documents are uploaded in full, and the chunks are correct.
If the documents are present and well-formed, check your [knowledge filters](/knowledge-filters).
If you applied a filter to the chat, make sure the expected documents aren't excluded by the filter settings.
You can test this by applying the filter when you [browse the knowledge base](/knowledge#browse-knowledge).
If the filter excludes any documents, the agent cannot access those documents.
Be aware that some settings create dynamic filters that don't always produce the same results, such as a **Search query** combined with a low **Response limit**.
If the document chunks have missing, incorrect, or unexpected text, you must [delete the documents](/knowledge#delete-knowledge) from your knowledge base, modify the [ingestion parameters](/knowledge#knowledge-ingestion-settings) or the documents themselves, and then reingest the documents.
For example:
* Break combined documents into separate files for better metadata context.
* Make sure scanned documents are legible enough for extraction, and enable the **OCR** option. Poorly scanned documents might require additional preparation or rescanning before ingestion.
* Adjust the **Chunk size** and **Chunk overlap** settings to better suit your documents. Larger chunks provide more context but can include irrelevant information, while smaller chunks yield more precise semantic search but can lack context.
## See also
* [Configure knowledge](/knowledge)
* [Filter knowledge](/knowledge-filters)
* [Chat with knowledge](/chat)
* [Inspect and modify flows](/agents#inspect-and-modify-flows)
For more information, see [`processors.py` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/src/models/processors.py#L58).

View file

@ -1,87 +0,0 @@
---
title: Filter knowledge
slug: /knowledge-filters
---
import Icon from "@site/src/components/icon/icon";
import PartialAnonymousUserOwner from '@site/docs/_partial-anonymous-user-owner.mdx';
OpenRAG's knowledge filters help you organize and manage your [knowledge base](/knowledge) by creating pre-defined views of your documents.
Each knowledge filter captures a specific subset of documents based on given a search query and filters.
Knowledge filters can be used with different OpenRAG functionality.
For example, knowledge filters can help agents access large knowledge bases efficiently by narrowing the scope of documents that you want the agent to use.
## Built-in filters
When you install OpenRAG, it automatically creates an **OpenRAG docs** filter that includes OpenRAG's default documents.
These documents provide information about OpenRAG itself and help you learn how to use OpenRAG.
When you use the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, [apply the **OpenRAG docs** filter](#apply-a-filter) if you want to ask questions about OpenRAG's features and functionality.
This limits the agent's context to the default OpenRAG documentation rather than all documents in your knowledge base.
After uploading your own documents, it is recommended that you create your own filters to organize your documents effectively and separate them from the default OpenRAG documents.
## Create a filter
To create a knowledge filter, do the following:
1. Click <Icon name="Library" aria-hidden="true"/> **Knowledge**, and then click <Icon name="Plus" aria-hidden="true"/> **Knowledge Filters**.
2. Enter a **Name**.
3. Optional: Click the filter icon next to the filter name to select a different icon and color for the filter.
This is purely cosmetic, but it can help you visually distinguish different sets of filters, such as different projects or sources.
4. Optional: Enter a **Description**.
5. Customize the filter settings.
By default, filters match all documents in your knowledge base.
Use the filter settings to narrow the scope of documents that the filter captures:
* **Search Query**: Enter a natural language text string for semantic search.
When you apply a filter that has a **Search Query**, only documents matching the search query are included.
It is recommended that you also use the **Score Threshold** setting to avoid returning irrelevant documents.
* **Data Sources**: Select specific files and folders to include in the filter.
This is useful if you want to create a filter for a specific project or topic and you know the specific documents you want to include.
Similarly, if you upload a folder of documents or enable an OAuth connector, you might want to create a filter that only includes the documents from that source.
* **Document Types**: Filter by file type.
* **Owners**: Filter by the user that uploaded the documents.
<PartialAnonymousUserOwner />
* **Connectors**: Filter by [upload source](/ingestion), such as the local file system or an OAuth connector.
* **Response Limit**: Set the maximum number of results to return from the knowledge base. The default is `10`, which means the filter returns only the top 10 most relevant documents.
* **Score Threshold**: Set the minimum relevance score for similarity search. The default score is `0`. A threshold is recommended to avoid returned irrelevant documents.
6. Click **Create Filter**.
## Edit a filter
To modify a filter, click <Icon name="Library" aria-hidden="true"/> **Knowledge**, and then click the filter you want to edit in the **Knowledge Filters** list.
On the filter settings pane, edit the filter as desired, and then click **Update Filter**.
## Apply a filter {#apply-a-filter}
In the OpenRAG <Icon name="MessageSquare" aria-hidden="true"/> **Chat**, click <Icon name="Funnel" aria-hidden="true"/> **Filter**, and then select the filter to apply.
Chat filters apply to one chat session only.
You can also use filters when [browsing your knowledge base](/knowledge#browse-knowledge).
This is a helpful way to test filters and manage knowledge bases that have many documents.
## Delete a filter
1. Click <Icon name="Library" aria-hidden="true"/> **Knowledge**.
2. In the **Knowledge Filters** list, click the filter that you want to delete.
3. In the filter settings pane, click **Delete Filter**.

View file

@ -1,216 +1,158 @@
---
title: Configure knowledge
title: OpenSearch in OpenRAG
slug: /knowledge
---
import Icon from "@site/src/components/icon/icon";
import PartialOpenSearchAuthMode from '@site/docs/_partial-opensearch-auth-mode.mdx';
import PartialAnonymousUserOwner from '@site/docs/_partial-anonymous-user-owner.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialModifyFlows from '@site/docs/_partial-modify-flows.mdx';
OpenRAG includes a built-in [OpenSearch](https://docs.opensearch.org/latest/) instance that serves as the underlying datastore for your _knowledge_ (documents).
This specialized database is used to store and retrieve your documents and the associated vector data (embeddings).
OpenRAG uses [OpenSearch](https://docs.opensearch.org/latest/) for its vector-backed knowledge store.
This is a specialized database for storing and retrieving embeddings, which helps your Agent efficiently find relevant information.
OpenSearch provides powerful hybrid search capabilities with enterprise-grade security and multi-tenancy support.
The documents in your OpenSearch knowledge base provide specialized context in addition to the general knowledge available to the language model that you select when you [install OpenRAG](/install-options) or [edit a flow](/agents).
## Authentication and document access {#auth}
You can [upload documents](/ingestion) from a variety of sources to populate your knowledge base with unique content, such as your own company documents, research papers, or websites.
Documents are processed through OpenRAG's knowledge ingestion flows with Docling.
OpenRAG supports two authentication modes based on how you [install OpenRAG](/install), and which mode you choose affects document access.
Then, the [OpenRAG **Chat**](/chat) can run [similarity searches](https://www.ibm.com/think/topics/vector-search) against your OpenSearch database to retrieve relevant information and generate context-aware responses.
**No-auth mode (Basic Setup)**: This mode uses a single anonymous JWT token for OpenSearch authentication, so documents uploaded to the `documents` index by one user are visible to all other users on the OpenRAG server.
You can configure how documents are ingested and how the **Chat** interacts with your knowledge base.
**OAuth mode (Advanced Setup)**: Each OpenRAG user is granted a JWT token, and each document is tagged with user ownership. Documents are filtered by user ownership, ensuring users only see documents they uploaded or have access to.
## Browse knowledge {#browse-knowledge}
## Ingest knowledge
The **Knowledge** page lists the documents OpenRAG has ingested into your OpenSearch database, specifically in an [OpenSearch index](https://docs.opensearch.org/latest/getting-started/intro/#index) named `documents`.
OpenRAG supports knowledge ingestion through direct file uploads and OAuth connectors.
To configure the knowledge ingestion pipeline parameters, see [Docling Ingestion](/ingestion).
To explore the raw contents of your knowledge base, click <Icon name="Library" aria-hidden="true"/> **Knowledge** to get a list of all ingested documents.
### Direct file ingestion
### Inspect knowledge
The **Knowledge Ingest** flow uses Langflow's [**File** component](https://docs.langflow.org/components-data#file) to split and embed files loaded from your local machine into the OpenSearch database.
For each document, the **Knowledge** page provides the following information:
The default path to your local folder is mounted from the `./documents` folder in your OpenRAG project directory to the `/app/documents/` directory inside the Docker container. Files added to the host or the container will be visible in both locations. To configure this location, modify the **Documents Paths** variable in either the TUI's [Advanced Setup](/install#setup) menu or in the `.env` used by Docker Compose.
* **Source**: Name of the ingested content, such as the file name.
To load and process a single file from the mapped location, click **Add Knowledge**, and then click <Icon name="File" aria-hidden="true"/> **File**.
The file is loaded into your OpenSearch database, and appears in the Knowledge page.
* **Size**
To load and process a directory from the mapped location, click **Add Knowledge**, and then click <Icon name="Folder" aria-hidden="true"/> **Folder**.
The files are loaded into your OpenSearch database, and appear in the Knowledge page.
* **Type**
To add files directly to a chat session, click <Icon name="Plus" aria-hidden="true"/> in the chat input and select the files you want to include. Files added this way are processed and made available to the agent for the current conversation, and are not permanently added to the knowledge base.
* **Owner**: User that uploaded the document.
### Ingest files through OAuth connectors {#oauth-ingestion}
<PartialAnonymousUserOwner />
OpenRAG supports Google Drive, OneDrive, and Sharepoint as OAuth connectors for seamless document synchronization.
* **Chunks**: Number of chunks created by splitting the document during ingestion.
OAuth integration allows individual users to connect their personal cloud storage accounts to OpenRAG. Each user must separately authorize OpenRAG to access their own cloud storage files. When a user connects a cloud service, they are redirected to authenticate with that service provider and grant OpenRAG permission to sync documents from their personal cloud storage.
Click a document to view the individual chunks and technical details related to chunking.
If the chunks seem incorrect or incomplete, see [Troubleshoot ingestion](/ingestion#troubleshoot-ingestion).
Before users can connect their cloud storage accounts, you must configure OAuth credentials in OpenRAG. This requires registering OpenRAG as an OAuth application with a cloud provider and obtaining client ID and secret keys for each service you want to support.
* **Avg score**: Average similarity score across all chunks of the document.
To add an OAuth connector to OpenRAG, do the following.
This example uses Google OAuth.
If you wish to use another provider, add the secrets to another provider.
If you [search the knowledge base](#search-knowledge), the **Avg score** column shows the similarity score for your search query or filter.
<Tabs groupId="Installation type">
<TabItem value="TUI" label="TUI" default>
1. If OpenRAG is running, stop it with **Status** > **Stop Services**.
2. Click **Advanced Setup**.
3. Add the OAuth provider's client and secret key in the [Advanced Setup](/install#setup) menu.
4. Click **Save Configuration**.
The TUI generates a new `.env` file with your OAuth values.
5. Click **Start Container Services**.
</TabItem>
<TabItem value=".env" label=".env">
1. Stop the Docker deployment.
2. Add the OAuth provider's client and secret key in the `.env` file for Docker Compose.
```bash
GOOGLE_OAUTH_CLIENT_ID='YOUR_OAUTH_CLIENT_ID'
GOOGLE_OAUTH_CLIENT_SECRET='YOUR_OAUTH_CLIENT_SECRET'
```
3. Save your `.env` file.
4. Start the Docker deployment.
</TabItem>
</Tabs>
* **Embedding model** and **Dimensions**: The embedding model and dimensions used to embed the chunks.
The OpenRAG frontend at `http://localhost:3000` now redirects to an OAuth callback login page for your OAuth provider.
A successful authentication opens OpenRAG with the required scopes for your connected storage.
* **Status**: Status of document ingestion.
If ingestion is complete and successful, then the status is **Active**.
For more information, see [Monitor ingestion](/ingestion#monitor-ingestion).
To add knowledge from an OAuth-connected storage provider, do the following:
### Search knowledge {#search-knowledge}
1. Click **Add Knowledge**, and then select the storage provider, for example, **Google Drive**.
The **Add Cloud Knowledge** page opens.
2. To add files or folders from the connected storage, click **Add Files**.
Select the files or folders you want and click **Select**.
You can select multiple files.
3. When your files are selected, click **Ingest Files**.
The ingestion process may take some time, depending on the size of your documents.
4. When ingestion is complete, your documents are available in the Knowledge screen.
You can use the search field on the **Knowledge** page to find documents using semantic search and knowledge filters:
If ingestion fails, click **Status** to view the logged error.
To search all documents, enter a search string in the search field, and then press <kbd>Enter</kbd>.
## Monitor ingestion tasks
To apply a [knowledge filter](/knowledge-filters), select the filter from the **Knowledge Filters** list.
The filter settings pane opens, and the filter appears in the search field.
To remove the filter, close the filter settings pane or clear the filter from the search field.
When you upload files, process folders, or sync documents, OpenRAG processes them as background tasks.
A badge appears on the <Icon name="Bell" aria-hidden="true"/> **Tasks** icon when there are active tasks running.
To open the Tasks menu, click <Icon name="Bell" aria-hidden="true"/> **Tasks**.
You can use the filter alone or in combination with a search string.
If a knowledge filter has a **Search Query**, that query is applied in addition to any text string you enter in the search field.
**Active Tasks** shows tasks that are currently processing.
A **Pending** task is queued and waiting to start, a **Running** task is actively processing files, and a **Processing** task is performing ingestion operations. For each active task, you can find the task ID, start time, duration, the number of files processed so far, and the total files.
Only one filter can be applied at a time.
You can cancel active tasks by clicking <Icon name="X" aria-hidden="true"/> **Cancel**. Canceling a task stops processing immediately and marks the task as failed.
### Default documents {#default-documents}
## Explore knowledge
By default, OpenRAG includes some initial documents about OpenRAG.
These documents are ingested automatically during the [application onboarding process](/install#application-onboarding).
The **Knowledge** page lists the documents OpenRAG has ingested into the OpenSearch vector database's `documents` index.
You can use these documents to ask OpenRAG about itself, or to test the [**Chat**](/chat) feature before uploading your own documents.
To explore your current knowledge, click <Icon name="Library" aria-hidden="true"/> **Knowledge**.
Click on a document to display the chunks derived from splitting the default documents into the vector database.
If you [delete these documents](#delete-knowledge), then you won't be able to ask OpenRAG about itself and it's own functionality.
It is recommended that you keep these documents, and use [filters](/knowledge-filters) to separate them from your other knowledge.
An **OpenRAG Docs** filter is created automatically for these documents.
Documents are processed with the default **Knowledge Ingest** flow, so if you want to split your documents differently, edit the **Knowledge Ingest** flow.
## OpenSearch authentication and document access {#auth}
<PartialModifyFlows />
When you [install OpenRAG](/install-options), you provide the initial configuration values for your OpenRAG services, including authentication credentials for OpenSearch and OAuth connectors.
This configuration determines how OpenRAG authenticates with your deployment's OpenSearch instance, and it controls user access to documents in your knowledge base:
## Create knowledge filters
<PartialOpenSearchAuthMode />
OpenRAG includes a knowledge filter system for organizing and managing document collections.
Knowledge filters are saved search configurations that allow you to create custom views of your document collection. They store search queries, filter criteria, and display settings that can be reused across different parts of OpenRAG.
## OpenSearch indexes
Knowledge filters help agents work more efficiently with large document collections by focusing their context within relevant documents sets.
An [OpenSearch index](https://docs.opensearch.org/latest/getting-started/intro/#index) is a collection of documents in an OpenSearch database.
To create a knowledge filter, do the following:
By default, all documents you upload to your OpenRAG knowledge base are stored in an index named `documents`.
1. Click **Knowledge**, and then click <Icon name="Plus" aria-hidden="true"/> **Knowledge Filters**.
The **Knowledge Filter** pane appears.
2. Enter a **Name** and **Description**, and then click **Create Filter**.
A new filter is created with default settings that match all documents.
3. To modify the filter, click <Icon name="Library" aria-hidden="true"/> **Knowledge**, and then click your new filter to edit it in the **Knowledge Filter** pane.
It is possible to change the index name by [editing the ingestion flow](/agents#inspect-and-modify-flows).
However, this can impact dependent processes, such as the [filters](/knowledge-filters) and [**Chat**](/chat), that reference the `documents` index by default.
Make sure you edit other flows as needed to ensure all processes use the same index name.
The following filter options are configurable.
* **Search Query**: Enter text for semantic search, such as "financial reports from Q4".
* **Data Sources**: Select specific data sources or folders to include.
* **Document Types**: Filter by file type.
* **Owners**: Filter by who uploaded the documents.
* **Connectors**: Filter by connector types, such as local upload or Google Drive.
* **Response Limit**: Set maximum number of results. The default is `10`.
* **Score Threshold**: Set minimum relevance score. The default score is `0`.
If you encounter errors or unexpected behavior after changing the index name, you can [revert the flows to their original configuration](/agents#revert-a-built-in-flow-to-its-original-configuration), or [delete knowledge](/knowledge#delete-knowledge) to clear the existing documents from your knowledge base.
4. When you're done editing the filter, click **Update Filter**.
## Knowledge ingestion settings {#knowledge-ingestion-settings}
5. To apply the filter to OpenRAG globally, click <Icon name="Library" aria-hidden="true"/> **Knowledge**, and then select the filter to apply. One filter can be enabled at a time.
:::warning
Knowledge ingestion settings apply to documents you upload after making the changes.
Documents uploaded before changing these settings aren't reprocessed.
:::
To apply the filter to a single chat session, in the <Icon name="MessageSquare" aria-hidden="true"/> **Chat** window, click <Icon name="Funnel" aria-hidden="true"/>, and then select the filter to apply.
After changing knowledge ingestion settings, you must determine if you need to reupload any documents to be consistent with the new settings.
To delete the filter, in the **Knowledge Filter** pane, click **Delete Filter**.
It isn't always necessary to reupload documents after changing knowledge ingestion settings.
For example, it is typical to upload some documents with OCR enabled and others without OCR enabled.
## OpenRAG default configuration
If needed, you can use [filters](/knowledge-filters) to separate documents that you uploaded with different settings, such as different embedding models.
OpenRAG automatically detects and configures the correct vector dimensions for embedding models, ensuring optimal search performance and compatibility.
### Set the embedding model and dimensions {#set-the-embedding-model-and-dimensions}
The complete list of supported models is available at [`models_service.py` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/src/services/models_service.py).
When you [install OpenRAG](/install-options), you select at least one embedding model during the [application onboarding process](/install#application-onboarding).
OpenRAG automatically detects and configures the appropriate vector dimensions for your selected embedding model, ensuring optimal search performance and compatibility.
You can use custom embedding models by specifying them in your configuration.
In the OpenRAG repository, you can find the complete list of supported models in [`models_service.py`](https://github.com/langflow-ai/openrag/blob/main/src/services/models_service.py) and the corresponding vector dimensions in [`settings.py`](https://github.com/langflow-ai/openrag/blob/main/src/config/settings.py).
If you use an unknown embedding model, OpenRAG will automatically fall back to `1536` dimensions and log a warning. The system will continue to work, but search quality may be affected if the actual model dimensions differ from `1536`.
During the application onboarding process, you can select from the supported models.
The default embedding dimension is `1536`, and the default model is the OpenAI `text-embedding-3-small`.
The default embedding dimension is `1536` and the default model is `text-embedding-3-small`.
If you want to use an unsupported model, you must manually set the model in your [OpenRAG `.env` file](/reference/configuration).
If you use an unsupported embedding model that doesn't have defined dimensions in `settings.py`, then OpenRAG falls back to the default dimensions (1536) and logs a warning. OpenRAG's OpenSearch instance and flows continue to work, but [similarity search](https://www.ibm.com/think/topics/vector-search) quality can be affected if the actual model dimensions aren't 1536.
To change the embedding model after onboarding, modify the embedding model configuration on the OpenRAG **Settings** page or in your [OpenRAG `.env` file](/reference/configuration).
This ensures that all relevant [OpenRAG flows](/agents) are updated to use the new embedding model configuration.
If you edit these settings in the `.env` file, you must [stop and restart the OpenRAG containers](/manage-services#stop-and-start-containers) to apply the changes.
### Set Docling parameters
OpenRAG uses [Docling](https://docling-project.github.io/docling/) for document ingestion because it supports many file formats, processes tables and images well, and performs efficiently.
When you [upload documents](/ingestion), Docling processes the files, splits them into chunks, and stores them as separate, structured documents in your OpenSearch knowledge base.
#### Select a Docling implementation {#select-a-docling-implementation}
You can use either Docling Serve or OpenRAG's built-in Docling ingestion pipeline to process documents.
* **Docling Serve ingestion**: By default, OpenRAG uses [Docling Serve](https://github.com/docling-project/docling-serve).
It starts a local `docling serve` process, and then runs Docling ingestion through the Docling Serve API.
To use a remote `docling serve` instance or your own local instance, set `DOCLING_SERVE_URL=http://**HOST_IP**:5001` in your [OpenRAG `.env` file](/reference/configuration#document-processing-settings).
The service must run on port 5001.
* **Built-in Docling ingestion**: If you want to use OpenRAG's built-in Docling ingestion pipeline instead of the separate Docling Serve service, set `DISABLE_INGEST_WITH_LANGFLOW=true` in your [OpenRAG `.env` file](/reference/configuration#document-processing-settings).
The built-in pipeline uses the Docling processor directly instead of through the Docling Serve API.
For the underlying functionality, see [`processors.py`](https://github.com/langflow-ai/openrag/blob/main/src/models/processors.py#L58) in the OpenRAG repository.
#### Configure Docling ingestion settings
To modify the Docling document processing and embedding parameters, click <Icon name="Settings2" aria-hidden="true"/> **Settings** in OpenRAG, and then find the **Knowledge Ingest** section.
:::tip
The TUI warns you if `docling serve` isn't running.
For information about starting and stopping OpenRAG native services, like Docling, see [Manage OpenRAG services](/manage-services).
:::
You can edit the following parameters:
* **Embedding model**: Select the model to use to generate vector embeddings for your documents.
This is initially set during installation.
The recommended way to change this setting is in the OpenRAG <Icon name="Settings2" aria-hidden="true"/> **Settings** or your [OpenRAG `.env` file](/reference/configuration).
This ensures that all relevant [OpenRAG flows](/agents) are updated to use the new embedding model configuration.
If you uploaded documents prior to changing the embedding model, you can [create filters](/knowledge-filters) to separate documents embedded with different models, or you can reupload all documents to regenerate embeddings with the new model.
If you want to use multiple embeddings models, similarity search (in the **Chat**) can take longer as it searches each model's embeddings separately.
* **Chunk size**: Set the number of characters for each text chunk when breaking down a file.
Larger chunks yield more context per chunk, but can include irrelevant information. Smaller chunks yield more precise semantic search, but can lack context.
The default value is 1000 characters, which is usually a good balance between context and precision.
* **Chunk overlap**: Set the number of characters to overlap over chunk boundaries.
Use larger overlap values for documents where context is most important. Use smaller overlap values for simpler documents or when optimization is most important.
The default value is 200 characters, which represents an overlap of 20 percent if the **Chunk size** is 1000. This is suitable for general use. For faster processing, decrease the overlap to approximately 10 percent. For more complex documents where you need to preserve context across chunks, increase it to approximately 40 percent.
* **Table structure**: Enables Docling's [`DocumentConverter`](https://docling-project.github.io/docling/reference/document_converter/) tool for parsing tables. Instead of treating tables as plain text, tables are output as structured table data with preserved relationships and metadata. This option is enabled by default.
* **OCR**: Enables Optical Character Recognition (OCR) processing when extracting text from images and ingesting scanned documents. This setting is best suited for processing text-based documents faster with Docling's [`DocumentConverter`](https://docling-project.github.io/docling/reference/document_converter/). Images are ignored and not processed.
This option is disabled by default. Enabling OCR can slow ingestion performance.
If OpenRAG detects that the local machine is running on macOS, OpenRAG uses the [ocrmac](https://www.piwheels.org/project/ocrmac/) OCR engine. Other platforms use [easyocr](https://www.jaided.ai/easyocr/).
* **Picture descriptions**: Only applicable if **OCR** is enabled. Adds image descriptions generated by the [`SmolVLM-256M-Instruct`](https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct) model. Enabling picture descriptions can slow ingestion performance.
### Set the local documents path {#set-the-local-documents-path}
The default path for local uploads is `~/.openrag/documents`. This is mounted to the `/app/openrag-documents/` directory inside the OpenRAG container. Files added to the host or container directory are visible in both locations.
To change this location, modify the **Documents Paths** variable in either the [**Basic/Advanced Setup** menu](/install#setup) or in your [OpenRAG `.env` file](/reference/configuration).
## Delete knowledge {#delete-knowledge}
:::warning
This is a destructive operation that cannot be undone.
:::
To delete documents from your knowledge base, click <Icon name="Library" aria-hidden="true"/> **Knowledge**, use the checkboxes to select one or more documents, and then click **Delete**.
If you select the checkbox at the top of the list, all documents are selected and your entire knowledge base will be deleted.
To delete an individual document, you can also click <Icon name="Ellipsis" aria-hidden="true"/> **More** next to that document, and then select **Delete**.
To completely clear your entire knowledge base and OpenSearch index, [reset your OpenRAG containers](/manage-services#reset-containers) or [reinstall OpenRAG](/reinstall).
## See also
* [Ingest knowledge](/ingestion)
* [Filter knowledge](/knowledge-filters)
* [Chat with knowledge](/chat)
* [Inspect and modify flows](/agents#inspect-and-modify-flows)
For models with known vector dimensions, see [`settings.py` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/src/config/settings.py).

View file

@ -1,119 +1,93 @@
---
title: Deploy OpenRAG with self-managed services
title: Install OpenRAG containers
slug: /docker
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOnboarding from '@site/docs/_partial-onboarding.mdx';
import PartialPrereqCommon from '@site/docs/_partial-prereq-common.mdx';
import PartialPrereqNoScript from '@site/docs/_partial-prereq-no-script.mdx';
import PartialPrereqWindows from '@site/docs/_partial-prereq-windows.mdx';
import PartialPrereqPython from '@site/docs/_partial-prereq-python.mdx';
import PartialInstallNextSteps from '@site/docs/_partial-install-next-steps.mdx';
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
import PartialGpuModeTip from '@site/docs/_partial-gpu-mode-tip.mdx';
To manage your own OpenRAG services, deploy OpenRAG with Docker or Podman.
OpenRAG has two Docker Compose files. Both files deploy the same applications and containers locally, but they are for different environments.
Use this installation method if you don't want to [use the Terminal User Interface (TUI)](/tui), or you need to run OpenRAG in an environment where using the TUI is unfeasible.
- [`docker-compose.yml`](https://github.com/langflow-ai/openrag/blob/main/docker-compose.yml) is an OpenRAG deployment with GPU support for accelerated AI processing. This Docker Compose file requires an NVIDIA GPU with [CUDA](https://docs.nvidia.com/cuda/) support.
- [`docker-compose-cpu.yml`](https://github.com/langflow-ai/openrag/blob/main/docker-compose-cpu.yml) is a CPU-only version of OpenRAG for systems without NVIDIA GPU support. Use this Docker Compose file for environments where GPU drivers aren't available.
## Prerequisites
<PartialPrereqWindows />
- Install [Python Version 3.10 to 3.13](https://www.python.org/downloads/release/python-3100/)
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
- Install [Podman](https://podman.io/docs/installation) (recommended) or [Docker](https://docs.docker.com/get-docker/)
- Install [Docker Compose](https://docs.docker.com/compose/install/). If using Podman, use [podman-compose](https://docs.podman.io/en/latest/markdown/podman-compose.1.html) or alias Docker compose commands to Podman commands.
- Optional: Create an [OpenAI API key](https://platform.openai.com/api-keys). You can provide this key during [Application Onboarding](#application-onboarding) or choose a different model provider.
- Optional: Install GPU support with an NVIDIA GPU, [CUDA](https://docs.nvidia.com/cuda/) support, and compatible NVIDIA drivers on the OpenRAG host machine. If you don't have GPU capabilities, OpenRAG provides an alternate CPU-only deployment.
<PartialPrereqPython />
## Install OpenRAG with Docker Compose
<PartialPrereqNoScript />
<PartialPrereqCommon />
## Prepare your deployment {#setup}
1. Clone the OpenRAG repository:
To install OpenRAG with Docker Compose, do the following:
1. Clone the OpenRAG repository.
```bash
git clone https://github.com/langflow-ai/openrag.git
```
2. Change to the root of the cloned repository:
```bash
cd openrag
```
3. Install dependencies:
2. Install dependencies.
```bash
uv sync
```
4. Create a `.env` file at the root of the cloned repository.
You can create an empty file or copy the repository's [`.env.example`](https://github.com/langflow-ai/openrag/blob/main/.env.example) file.
The example file contains some of the [OpenRAG environment variables](/reference/configuration) to get you started with configuring your deployment.
3. Copy the example `.env` file included in the repository root.
The example file includes all environment variables with comments to guide you in finding and setting their values.
```bash
cp .env.example .env
```
5. Edit the `.env` file to configure your deployment using [OpenRAG environment variables](/reference/configuration).
The OpenRAG Docker Compose files pull values from your `.env` file to configure the OpenRAG containers.
The following variables are required or recommended:
Alternatively, create a new `.env` file in the repository root.
```
touch .env
```
* **`OPENSEARCH_PASSWORD` (Required)**: Sets the OpenSearch administrator password. It must adhere to the [OpenSearch password complexity requirements](https://docs.opensearch.org/latest/security/configuration/demo-configuration/#setting-up-a-custom-admin-password).
4. The Docker Compose files are populated with the values from your `.env` file.
The `OPENSEARCH_PASSWORD` value must be set.
`OPENSEARCH_PASSWORD` can be automatically generated when using the TUI, but for a Docker Compose installation, you can set it manually instead. To generate an OpenSearch admin password, see the [OpenSearch documentation](https://docs.opensearch.org/latest/security/configuration/demo-configuration/#setting-up-a-custom-admin-password).
* **`LANGFLOW_SUPERUSER`**: The username for the Langflow administrator user. If `LANGFLOW_SUPERUSER` isn't set, then the default value is `admin`.
The following values are optional:
* **`LANGFLOW_SUPERUSER_PASSWORD` (Strongly recommended)**: Sets the Langflow administrator password, and determines the Langflow server's default authentication mode. If `LANGFLOW_SUPERUSER_PASSWORD` isn't set, then the Langflow server starts without authentication enabled. For more information, see [Langflow settings](/reference/configuration#langflow-settings).
```bash
OPENAI_API_KEY=your_openai_api_key
LANGFLOW_SECRET_KEY=your_secret_key
```
* **`LANGFLOW_SECRET_KEY` (Strongly recommended)**: A secret encryption key for internal Langflow operations. It is recommended to [generate your own Langflow secret key](https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key). If `LANGFLOW_SECRET_KEY` isn't set, then Langflow generates a secret key automatically.
`OPENAI_API_KEY` is optional. You can provide it during [Application Onboarding](#application-onboarding) or choose a different model provider. If you want to set it in your `.env` file, you can find your OpenAI API key in your [OpenAI account](https://platform.openai.com/api-keys).
* **Model provider credentials**: Provide credentials for your preferred model providers. If none of these are set in the `.env` file, you must configure at least one provider during the [application onboarding process](#application-onboarding).
`LANGFLOW_SECRET_KEY` is optional. Langflow will auto-generate it if not set. For more information, see the [Langflow documentation](https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key).
* `OPENAI_API_KEY`
* `ANTHROPIC_API_KEY`
* `OLLAMA_ENDPOINT`
* `WATSONX_API_KEY`
* `WATSONX_ENDPOINT`
* `WATSONX_PROJECT_ID`
The following Langflow configuration values are optional but important to consider:
* **OAuth provider credentials**: To upload documents from external storage, such as Google Drive, set the required OAuth credentials for the connectors that you want to use. You can [manage OAuth credentials](/ingestion#oauth-ingestion) later, but it is recommended to configure them during initial set up so you don't have to rebuild the containers.
```bash
LANGFLOW_SUPERUSER=admin
LANGFLOW_SUPERUSER_PASSWORD=your_langflow_password
```
* **Google**: Provide your Google OAuth Client ID and Google OAuth Client Secret. You can generate these in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). For more information, see the [Google OAuth client documentation](https://developers.google.com/identity/protocols/oauth2).
* **Microsoft**: For the Microsoft OAuth Client ID and Microsoft OAuth Client Secret, provide [Azure application registration credentials for SharePoint and OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online). For more information, see the [Microsoft Graph OAuth client documentation](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth).
* **Amazon**: Provide your AWS Access Key ID and AWS Secret Access Key with access to your S3 instance. For more information, see the AWS documentation on [Configuring access to AWS applications](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html).
For more information and variables, see [OpenRAG environment variables](/reference/configuration).
## Start services
1. To use the default Docling Serve implementation, start `docling serve` on port 5001 on the host machine using the included script:
`LANGFLOW_SUPERUSER` defaults to `admin`. You can omit it or set it to a different username. `LANGFLOW_SUPERUSER_PASSWORD` is optional. If omitted, Langflow runs in [autologin mode](https://docs.langflow.org/api-keys-and-authentication#langflow-auto-login) with no password required. If set, Langflow requires password authentication.
For more information on configuring OpenRAG with environment variables, see [Environment variables](/reference/configuration).
5. Start `docling serve` on the host machine.
OpenRAG Docker installations require that `docling serve` is running on port 5001 on the host machine.
This enables [Mac MLX](https://opensource.apple.com/projects/mlx/) support for document processing.
```bash
uv run python scripts/docling_ctl.py start --port 5001
```
Docling cannot run inside a Docker container due to system-level dependencies, so you must manage it as a separate service on the host machine.
For more information, see [Stop, start, and inspect native services](/manage-services#start-native-services).
Port 5001 is required to deploy OpenRAG successfully; don't use a different port.
Additionally, this enables the [MLX framework](https://opensource.apple.com/projects/mlx/) for accelerated performance on Apple Silicon Mac machines.
:::tip
If you don't want to use the default Docling Serve implementation, see [Select a Docling implementation](/knowledge#select-a-docling-implementation).
:::
2. Confirm `docling serve` is running.
The following command checks the status of the default Docling Serve implementation:
```bash
6. Confirm `docling serve` is running.
```
uv run python scripts/docling_ctl.py status
```
If `docling serve` is running, the output includes the status, address, and process ID (PID):
Make sure the response shows that `docling serve` is running, for example:
```bash
Status: running
Endpoint: http://127.0.0.1:5001
@ -121,56 +95,84 @@ The following variables are required or recommended:
PID: 27746
```
3. Deploy the OpenRAG containers locally using the appropriate Docker Compose configuration for your environment:
7. Deploy OpenRAG locally with Docker Compose based on your deployment type.
* **CPU-only deployment** (default, recommended): If your host machine doesn't have NVIDIA GPU support, use the base `docker-compose.yml` file:
<Tabs groupId="Compose file">
<TabItem value="docker-compose.yml" label="docker-compose.yml" default>
```bash
docker compose build
docker compose up -d
```
</TabItem>
<TabItem value="docker-compose-cpu.yml" label="docker-compose-cpu.yml">
```bash
docker compose -f docker-compose-cpu.yml up -d
```
</TabItem>
</Tabs>
```bash title="Docker"
docker compose up -d
```
The OpenRAG Docker Compose file starts five containers:
| Container Name | Default Address | Purpose |
|---|---|---|
| OpenRAG Backend | http://localhost:8000 | FastAPI server and core functionality. |
| OpenRAG Frontend | http://localhost:3000 | React web interface for users. |
| Langflow | http://localhost:7860 | AI workflow engine and flow management. |
| OpenSearch | http://localhost:9200 | Vector database for document storage. |
| OpenSearch Dashboards | http://localhost:5601 | Database administration interface. |
```bash title="Podman"
podman compose up -d
```
8. Verify installation by confirming all services are running.
* **GPU-accelerated deployment**: If your host machine has an NVIDIA GPU with CUDA support and compatible NVIDIA drivers, use the base `docker-compose.yml` file with the `docker-compose.gpu.yml` override:
```bash title="Docker"
docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
```
```bash title="Podman"
podman compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
```
:::tip
<PartialGpuModeTip />
:::
4. Wait for the OpenRAG containers to start, and then confirm that all containers are running:
```bash title="Docker"
```bash
docker compose ps
```
```bash title="Podman"
podman compose ps
```
You can now access OpenRAG at the following endpoints:
The OpenRAG Docker Compose files deploy the following containers:
- **Frontend**: http://localhost:3000
- **Backend API**: http://localhost:8000
- **Langflow**: http://localhost:7860
| Container Name | Default address | Purpose |
|---|---|---|
| OpenRAG Backend | http://localhost:8000 | FastAPI server and core functionality. |
| OpenRAG Frontend | http://localhost:3000 | React web interface for user interaction. |
| Langflow | http://localhost:7860 | [AI workflow engine](/agents). |
| OpenSearch | http://localhost:9200 | Datastore for [knowledge](/knowledge). |
| OpenSearch Dashboards | http://localhost:5601 | OpenSearch database administration interface. |
9. Continue with [Application Onboarding](#application-onboarding).
When the containers are running, you can access your OpenRAG services at their addresses.
To stop `docling serve` when you're done with your OpenRAG deployment, run:
5. Access the OpenRAG frontend at `http://localhost:3000`, and then continue with the [application onboarding process](#application-onboarding).
```bash
uv run python scripts/docling_ctl.py stop
```
<PartialOnboarding />
<PartialInstallNextSteps />
## Container management commands
Manage your OpenRAG containers with the following commands.
These commands are also available in the TUI's [Status menu](/install#status).
### Upgrade containers
Upgrade your containers to the latest version while preserving your data.
```bash
docker compose pull
docker compose up -d --force-recreate
```
### Rebuild containers (destructive)
Reset state by rebuilding all of your containers.
Your OpenSearch and Langflow databases will be lost.
Documents stored in the `./documents` directory will persist, since the directory is mounted as a volume in the OpenRAG backend container.
```bash
docker compose up --build --force-recreate --remove-orphans
```
### Remove all containers and data (destructive)
Completely remove your OpenRAG installation and delete all data.
This deletes all of your data, including OpenSearch data, uploaded documents, and authentication.
```bash
docker compose down --volumes --remove-orphans --rmi local
docker system prune -f
```

View file

@ -1,34 +0,0 @@
---
title: Select an installation method
slug: /install-options
---
The [OpenRAG architecture](/#openrag-architecture) is lightweight and container-based with a central OpenRAG backend that orchestrates the various services and external connectors.
Depending on your use case, OpenRAG can assist with service management, or you can manage the services yourself.
Select the installation method that best fits your needs:
* **Use the [Terminal User Interface (TUI)](/tui) to manage services**: For guided configuration and simplified service management, install OpenRAG with TUI-managed services. Use one of the following options:
* [**Automatic installer script**](/install): Run one script to install the required dependencies and OpenRAG.
* [**`uv`**](/install-uv): Install OpenRAG as a dependency of a new or existing Python project.
* [**`uvx`**](/install-uvx): Install OpenRAG without creating a project or modifying your project's dependencies.
* [**Install OpenRAG on Microsoft Windows**](/install-windows): On Windows machines, you must install OpenRAG within the Windows Subsystem for Linux (WSL).
:::warning
OpenRAG doesn't support nested virtualization; don't run OpenRAG on a WSL distribution that is inside a Windows VM.
:::
* [**Manage your own services**](/docker): You can use Docker or Podman to deploy self-managed OpenRAG services.
The first time you start OpenRAG, you must complete the application onboarding process.
This is required for all installation methods because it prepares the minimum required configuration for OpenRAG to run.
For TUI-managed services, you must also complete initial setup before you start the OpenRAG services.
For more information, see the instructions for your preferred installation method.
Your OpenRAG configuration is stored in a `.env` file.
When using TUI-managed services, this file is created automatically at `~/.openrag/tui`, or you can provide a pre-populated `.env` file in this directory before starting the TUI.
The TUI prompts you for the required values during setup and onboarding, and any values detected in a preexisting `.env` file are populated automatically.
When using self-managed services, you must provide a pre-populated `.env` file, as you would for any Docker or Podman deployment.
For more information, see the instructions for your preferred installation method and the [OpenRAG environment variables reference](/reference/configuration).

View file

@ -1,124 +0,0 @@
---
title: Install OpenRAG in a Python project with uv
slug: /install-uv
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOnboarding from '@site/docs/_partial-onboarding.mdx';
import PartialSetup from '@site/docs/_partial-setup.mdx';
import PartialPrereqCommon from '@site/docs/_partial-prereq-common.mdx';
import PartialPrereqNoScript from '@site/docs/_partial-prereq-no-script.mdx';
import PartialPrereqWindows from '@site/docs/_partial-prereq-windows.mdx';
import PartialPrereqPython from '@site/docs/_partial-prereq-python.mdx';
import PartialInstallNextSteps from '@site/docs/_partial-install-next-steps.mdx';
import PartialOpenSearchAuthMode from '@site/docs/_partial-opensearch-auth-mode.mdx';
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
Use [`uv`](https://docs.astral.sh/uv/getting-started/installation/) to install OpenRAG as a managed or unmanaged dependency in a new or existing Python project.
When you install OpenRAG with `uv`, you will use the [Terminal User Interface (TUI)](/tui) to configure and manage your OpenRAG deployment.
For other installation methods, see [Select an installation method](/install-options).
## Prerequisites
<PartialPrereqWindows />
<PartialPrereqPython />
<PartialPrereqNoScript />
<PartialPrereqCommon />
## Install and start OpenRAG with uv
There are two ways to install OpenRAG with `uv`:
* [**`uv add`** (Recommended)](#uv-add): Install OpenRAG as a managed dependency in a new or existing `uv` Python project.
This is recommended because it adds OpenRAG to your `pyproject.toml` and lockfile for better management of dependencies and the virtual environment.
* [**`uv pip install`**](#uv-pip-install): Use the [`uv pip` interface](https://docs.astral.sh/uv/pip/) to install OpenRAG into an existing Python project that uses `pip`, `pip-tools`, and `virtualenv` commands.
If you encounter errors during installation, see [Troubleshoot OpenRAG](/support/troubleshoot).
### Use uv add {#uv-add}
1. Create a new `uv`-managed Python project:
```bash
uv init PROJECT_NAME
```
2. Change into your new project directory:
```bash
cd PROJECT_NAME
```
Because `uv` manages the virtual environment for you, you won't see a `(venv)` prompt.
`uv` commands automatically use the project's virtual environment.
3. Add OpenRAG to your project:
* Add the latest version:
```bash
uv add openrag
```
* Add a specific version:
```bash
uv add openrag==0.1.30
```
* Add a local wheel:
```bash
uv add path/to/openrag-VERSION-py3-none-any.whl
```
For more options, see [Managing dependencies with `uv`](https://docs.astral.sh/uv/concepts/projects/dependencies/).
4. Optional: If you want to use a pre-populated [OpenRAG `.env` file](/reference/configuration), create one at `~/.openrag/tui` before starting OpenRAG.
5. Start the OpenRAG TUI:
```bash
uv run openrag
```
### Use uv pip install {#uv-pip-install}
1. Activate your virtual environment.
2. Install the OpenRAG Python package:
```bash
uv pip install openrag
```
3. Optional: If you want to use a pre-populated [OpenRAG `.env` file](/reference/configuration), create one at `~/.openrag/tui` before starting OpenRAG.
4. Start the OpenRAG TUI:
```bash
uv run openrag
```
## Set up OpenRAG with the TUI {#setup}
When you install OpenRAG with `uv`, you manage the OpenRAG services with the TUI.
The TUI guides you through the initial configuration process before you start the OpenRAG services.
Your configuration values are stored in an [OpenRAG `.env` file](/reference/configuration) that is created automatically at `~/.openrag/tui`.
If OpenRAG detects an existing `.env` file in this directory, then the TUI can populate those values automatically during setup and onboarding.
Container definitions are stored in the `docker-compose` files in the same directory as the OpenRAG `.env` file.
<PartialSetup />
<PartialOnboarding />
<PartialInstallNextSteps />

View file

@ -1,83 +0,0 @@
---
title: Invoke OpenRAG with uvx
slug: /install-uvx
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOnboarding from '@site/docs/_partial-onboarding.mdx';
import PartialSetup from '@site/docs/_partial-setup.mdx';
import PartialPrereqCommon from '@site/docs/_partial-prereq-common.mdx';
import PartialPrereqNoScript from '@site/docs/_partial-prereq-no-script.mdx';
import PartialPrereqWindows from '@site/docs/_partial-prereq-windows.mdx';
import PartialPrereqPython from '@site/docs/_partial-prereq-python.mdx';
import PartialInstallNextSteps from '@site/docs/_partial-install-next-steps.mdx';
import PartialOpenSearchAuthMode from '@site/docs/_partial-opensearch-auth-mode.mdx';
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
Use [`uvx`](https://docs.astral.sh/uv/guides/tools/#running-tools) to invoke OpenRAG outside of a Python project or without modifying your project's dependencies.
:::tip
The [automatic installer script](/install) also uses `uvx` to install OpenRAG.
:::
When you install OpenRAG with `uvx`, you will use the [Terminal User Interface (TUI)](/tui) to configure and manage your OpenRAG deployment.
This installation method is best for testing OpenRAG by running it outside of a Python project.
For other installation methods, see [Select an installation method](/install-options).
## Prerequisites
<PartialPrereqWindows />
<PartialPrereqPython />
<PartialPrereqNoScript />
<PartialPrereqCommon />
## Install and run OpenRAG with uvx
1. Create a directory to store your OpenRAG configuration files and data, and then change to that directory:
```bash
mkdir openrag-workspace
cd openrag-workspace
```
2. Optional: If you want to use a pre-populated [OpenRAG `.env` file](/reference/configuration), create one at `~/.openrag/tui` before invoking OpenRAG.
3. Invoke OpenRAG:
```bash
uvx openrag
```
You can invoke a specific version using any of the [`uvx` version specifiers](https://docs.astral.sh/uv/guides/tools/#requesting-specific-versions), such as `--from`:
```bash
uvx --from openrag==0.1.30 openrag
```
Invoking OpenRAG with `uvx openrag` creates a cached, ephemeral environment for the TUI in your local `uv` cache.
By invoking OpenRAG in a specific directory, your OpenRAG configuration files and data are stored separately from the `uv` cache.
Clearing the `uv` cache doesn't remove your entire OpenRAG installation.
After clearing the cache, you can re-invoke OpenRAG (`uvx openrag`) to restart the TUI with your preserved configuration and data.
If you encounter errors during installation, see [Troubleshoot OpenRAG](/support/troubleshoot).
## Set up OpenRAG with the TUI {#setup}
When you install OpenRAG with `uvx`, you manage the OpenRAG services with the TUI.
The TUI guides you through the initial configuration process before you start the OpenRAG services.
Your configuration values are stored in an [OpenRAG `.env` file](/reference/configuration) that is created automatically at `~/.openrag/tui`.
If OpenRAG detects an existing `.env` file in this directory, then the TUI can populate those values automatically during setup and onboarding.
Container definitions are stored in the `docker-compose` files in the same directory as the OpenRAG `.env` file.
<PartialSetup />
<PartialOnboarding />
<PartialInstallNextSteps />

View file

@ -1,42 +0,0 @@
---
title: Install OpenRAG on Microsoft Windows
slug: /install-windows
---
If you're using Windows, you must install OpenRAG within the Windows Subsystem for Linux (WSL).
:::warning
Nested virtualization isn't supported.
OpenRAG isn't compatible with nested virtualization, which can cause networking issues.
Don't install OpenRAG on a WSL distribution that is installed inside a Windows VM.
Instead, install OpenRAG on your base OS or a non-nested Linux VM.
:::
## Install OpenRAG in the WSL
1. [Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install) with an Ubuntu distribution using WSL 2:
```powershell
wsl --install -d Ubuntu
```
For new installations, the `wsl --install` command uses WSL 2 and Ubuntu by default.
For existing WSL installations, you can [change the distribution](https://learn.microsoft.com/en-us/windows/wsl/install#change-the-default-linux-distribution-installed) and [check the WSL version](https://learn.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2).
2. [Start your WSL Ubuntu distribution](https://learn.microsoft.com/en-us/windows/wsl/install#ways-to-run-multiple-linux-distributions-with-wsl) if it doesn't start automatically.
3. [Set up a username and password for your WSL distribution](https://learn.microsoft.com/en-us/windows/wsl/setup/environment#set-up-your-linux-username-and-password).
4. [Install Docker Desktop for Windows with WSL 2](https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers). When you reach the Docker Desktop **WSL integration** settings, make sure your Ubuntu distribution is enabled, and then click **Apply & Restart** to enable Docker support in WSL.
The Docker Desktop WSL integration makes Docker available within your WSL distribution.
You don't need to install Docker or Podman separately in your WSL distribution before you install OpenRAG.
5. Install and run OpenRAG from within your WSL Ubuntu distribution.
You can install OpenRAG in your WSL distribution using any of the [OpenRAG installation methods](/install-options).
## Troubleshoot OpenRAG in WSL
If you encounter issues with port forwarding or the Windows Firewall, you might need to adjust the [Hyper-V firewall settings](https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/hyper-v-firewall) to allow communication between your WSL distribution and the Windows host. For more troubleshooting advice for networking issues, see [Troubleshooting WSL common issues](https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#common-issues).

View file

@ -1,82 +1,417 @@
---
title: Install OpenRAG with the automatic installer script
title: Install OpenRAG with TUI
slug: /install
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialOnboarding from '@site/docs/_partial-onboarding.mdx';
import PartialSetup from '@site/docs/_partial-setup.mdx';
import PartialPrereqCommon from '@site/docs/_partial-prereq-common.mdx';
import PartialPrereqWindows from '@site/docs/_partial-prereq-windows.mdx';
import PartialPrereqPython from '@site/docs/_partial-prereq-python.mdx';
import PartialInstallNextSteps from '@site/docs/_partial-install-next-steps.mdx';
import PartialOpenSearchAuthMode from '@site/docs/_partial-opensearch-auth-mode.mdx';
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
import PartialOnboarding from '@site/docs/_partial-onboarding.mdx';
:::tip
To quickly install and test OpenRAG's core features, try the [quickstart](/quickstart).
:::
[Install OpenRAG](#install) and then run the [OpenRAG Terminal User Interface(TUI)](#setup) to start your OpenRAG deployment with a guided setup process.
The installer script installs `uv`, Docker or Podman, Docker Compose, and OpenRAG.
Then, it installs and runs OpenRAG with `uvx`.
The OpenRAG Terminal User Interface (TUI) allows you to set up, configure, and monitor your OpenRAG deployment directly from the terminal.
When you install OpenRAG with the installer script, you will use the [Terminal User Interface (TUI)](/tui) to configure and manage your OpenRAG deployment.
![OpenRAG TUI Interface](@site/static/img/OpenRAG_TUI_2025-09-10T13_04_11_757637.svg)
This installation method is best for testing OpenRAG by running it outside of a Python project.
For other installation methods, see [Select an installation method](/install-options).
Instead of starting OpenRAG using Docker commands and manually editing values in the `.env` file, the TUI walks you through the setup. It prompts for variables where required, creates a `.env` file for you, and then starts OpenRAG.
Once OpenRAG is running, use the TUI to monitor your application, control your containers, and retrieve logs.
If you prefer running Podman or Docker containers and manually editing `.env` files, see [Install OpenRAG Containers](/docker).
## Prerequisites
<PartialPrereqWindows />
- Install [Python Version 3.10 to 3.13](https://www.python.org/downloads/release/python-3100/)
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
- Install [Podman](https://podman.io/docs/installation) (recommended) or [Docker](https://docs.docker.com/get-docker/)
- Install [Docker Compose](https://docs.docker.com/compose/install/). If using Podman, use [podman-compose](https://docs.podman.io/en/latest/markdown/podman-compose.1.html) or alias Docker compose commands to Podman commands.
- Optional: Create an [OpenAI API key](https://platform.openai.com/api-keys). During [Application Onboarding](#application-onboarding), you can provide this key or choose a different model provider.
- Optional: Install GPU support with an NVIDIA GPU, [CUDA](https://docs.nvidia.com/cuda/) support, and compatible NVIDIA drivers on the OpenRAG host machine. If you don't have GPU capabilities, OpenRAG provides an alternate CPU-only deployment.
<PartialPrereqPython />
## Install OpenRAG {#install}
<PartialPrereqCommon />
:::note Windows users
To use OpenRAG on Windows, use [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install).
:::
## Run the installer script {#install}
Choose an installation method based on your needs:
1. Create a directory to store your OpenRAG configuration files and data, and then change to that directory:
* For new users, the automatic installer script detects and installs prerequisites and then runs OpenRAG.
* For a quick test, use `uvx` to run OpenRAG without creating a project or modifying files.
* Use `uv add` to install OpenRAG as a managed dependency in a new or existing Python project.
* Use `uv pip install` to install OpenRAG into an existing virtual environment.
```bash
mkdir openrag-workspace
cd openrag-workspace
```
<Tabs groupId="Installation method">
<TabItem value="installer" label="Automatic installer" default>
2. Get and run the installer script:
The script detects and installs uv, Docker/Podman, and Docker Compose prerequisites, then runs OpenRAG with `uvx`.
```bash
curl -fsSL https://docs.openr.ag/files/run_openrag_with_prereqs.sh | bash
```
1. Create a directory to store the OpenRAG configuration files:
```bash
mkdir openrag-workspace
cd openrag-workspace
```
The installer script installs OpenRAG with [`uvx`](https://docs.astral.sh/uv/guides/tools/#running-tools) in the directory where you run the script.
2. Run the installer:
```bash
curl -fsSL https://docs.openr.ag/files/run_openrag_with_prereqs.sh | bash
```
3. Wait while the installer script prepares your environment and installs OpenRAG.
You might be prompted to install certain dependencies if they aren't already present in your environment.
The TUI creates a `.env` file and docker-compose files in the current working directory.
The entire process can take a few minutes.
Once the environment is ready, the OpenRAG TUI starts.
</TabItem>
<TabItem value="uvx" label="Quick test with uvx">
![OpenRAG TUI Interface](@site/static/img/openrag_tui_dec_2025.png)
Use `uvx` to quickly run OpenRAG without creating a project or modifying any files.
Because the installer script uses `uvx`, it creates a cached, ephemeral environment in your local `uv` cache, and your OpenRAG configuration files and data are stored separately from the `uv` cache.
Clearing the cache doesn't delete your entire OpenRAG installation, only the temporary TUI environment.
After clearing the cache, run `uvx openrag` to [access the TUI](/tui) and continue with your preserved configuration and data.
1. Create a directory to store the OpenRAG configuration files:
```bash
mkdir openrag-workspace
cd openrag-workspace
```
If you encounter errors during installation, see [Troubleshoot OpenRAG](/support/troubleshoot).
2. Run OpenRAG:
```bash
uvx openrag
```
To run a specific version:
```bash
uvx --from openrag==0.1.30 openrag
```
The TUI creates a `.env` file and docker-compose files in the current working directory.
</TabItem>
<TabItem value="uv-add" label="Python project with uv add">
Use `uv add` to install OpenRAG as a dependency in your Python project. This adds OpenRAG to your `pyproject.toml` and lockfile, making your installation reproducible and version-controlled.
1. Create a new project with a virtual environment:
```bash
uv init YOUR_PROJECT_NAME
cd YOUR_PROJECT_NAME
```
The `(venv)` prompt doesn't change, but `uv` commands will automatically use the project's virtual environment.
2. Add OpenRAG to your project:
```bash
uv add openrag
```
To add a specific version:
```bash
uv add openrag==0.1.30
```
3. Start the OpenRAG TUI:
```bash
uv run openrag
```
<details closed>
<summary>Install a local wheel</summary>
If you downloaded the OpenRAG wheel to your local machine, install it by specifying its path:
1. Add the wheel to your project:
```bash
uv add PATH/TO/openrag-VERSION-py3-none-any.whl
```
Replace `PATH/TO/` and `VERSION` with the path and version of your downloaded OpenRAG `.whl` file.
2. Run OpenRAG:
```bash
uv run openrag
```
</details>
</TabItem>
<TabItem value="uv-pip" label="Existing virtual environment with uv pip install">
Use `uv pip install` to install OpenRAG into an existing virtual environment that isn't managed by `uv`.
:::tip
For new projects, `uv add` is recommended as it manages dependencies in your project's lockfile.
:::
1. Activate your virtual environment.
2. Install OpenRAG:
```bash
uv pip install openrag
```
3. Run OpenRAG:
```bash
uv run openrag
```
</TabItem>
</Tabs>
Continue with [Set up OpenRAG with the TUI](#setup).
## Set up OpenRAG with the TUI {#setup}
When you install OpenRAG with the installer script, you manage the OpenRAG services with the TUI.
The TUI guides you through the initial configuration process before you start the OpenRAG services.
The TUI creates a `.env` file in your OpenRAG directory root and starts OpenRAG.
If the TUI detects a `.env` file in the OpenRAG root directory, it sources any variables from the `.env` file.
If the TUI detects OAuth credentials, it enforces the **Advanced Setup** path.
Your configuration values are stored in an [OpenRAG `.env` file](/reference/configuration) that is created automatically at `~/.openrag/tui`.
If OpenRAG detects an existing `.env` file in this directory, then the TUI can populate those values automatically during setup and onboarding.
<Tabs groupId="Setup method">
<TabItem value="Basic setup" label="Basic setup" default>
Container definitions are stored in the `docker-compose` files in the same directory as the OpenRAG `.env` file.
**Basic Setup** can generate all of the required values for OpenRAG. The OpenAI API key is optional and can be provided during onboarding.
**Basic Setup** does not set up OAuth connections for ingestion from cloud providers.
For OAuth setup, use **Advanced Setup**.
For information about the difference between basic (no auth) and OAuth in OpenRAG, see [Authentication and document access](/knowledge#auth).
<PartialSetup />
1. To install OpenRAG with **Basic Setup**, click **Basic Setup** or press <kbd>1</kbd>.
2. Click **Generate Passwords** to generate passwords for OpenSearch and Langflow.
The OpenSearch password is required. The Langflow admin password is optional.
If no Langflow admin password is generated, Langflow runs in [autologin mode](https://docs.langflow.org/api-keys-and-authentication#langflow-auto-login) with no password required.
3. Optional: Paste your OpenAI API key in the OpenAI API key field. You can also provide this during onboarding or choose a different model provider.
4. Click **Save Configuration**.
Your passwords are saved in the `.env` file used to start OpenRAG.
5. To start OpenRAG, click **Start All Services**.
Startup pulls container images and runs them, so it can take some time.
When startup is complete, the TUI displays the following:
```bash
Services started successfully
Command completed successfully
```
6. To start the Docling service, under **Native Services**, click **Start**.
7. To open the OpenRAG application, navigate to the TUI main menu, and then click **Open App**.
Alternatively, in your browser, navigate to `localhost:3000`.
8. Continue with [Application Onboarding](#application-onboarding).
</TabItem>
<TabItem value="Advanced setup" label="Advanced setup">
1. To install OpenRAG with **Advanced Setup**, click **Advanced Setup** or press <kbd>2</kbd>.
2. Click **Generate Passwords** to generate passwords for OpenSearch and Langflow.
The OpenSearch password is required. The Langflow admin password is optional.
If no Langflow admin password is generated, Langflow runs in [autologin mode](https://docs.langflow.org/api-keys-and-authentication#langflow-auto-login) with no password required.
3. Paste your OpenAI API key in the OpenAI API key field.
4. Add your client and secret values for Google or Microsoft OAuth.
These values can be found with your OAuth provider.
For more information, see the [Google OAuth client](https://developers.google.com/identity/protocols/oauth2) or [Microsoft Graph OAuth client](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth) documentation.
5. The OpenRAG TUI presents redirect URIs for your OAuth app.
These are the URLs your OAuth provider will redirect back to after user sign-in.
Register these redirect values with your OAuth provider as they are presented in the TUI.
6. Click **Save Configuration**.
7. To start OpenRAG, click **Start All Services**.
Startup pulls container images and runs them, so it can take some time.
When startup is complete, the TUI displays the following:
```bash
Services started successfully
Command completed successfully
```
8. To start the Docling service, under **Native Services**, click **Start**.
9. To open the OpenRAG application, navigate to the TUI main menu, and then click **Open App**.
Alternatively, in your browser, navigate to `localhost:3000`.
You are presented with your provider's OAuth sign-in screen.
After sign-in, you are redirected to the redirect URI.
Two additional variables are available for Advanced Setup:
The `LANGFLOW_PUBLIC_URL` controls where the Langflow web interface can be accessed. This is where users interact with their flows in a browser.
The `WEBHOOK_BASE_URL` controls where the endpoint for `/connectors/CONNECTOR_TYPE/webhook` will be available.
This connection enables real-time document synchronization with external services.
Supported webhook endpoints:
- Google Drive: `/connectors/google_drive/webhook`
- OneDrive: `/connectors/onedrive/webhook`
- SharePoint: `/connectors/sharepoint/webhook`
10. Continue with [Application Onboarding](#application-onboarding).
</TabItem>
</Tabs>
<PartialOnboarding />
<PartialInstallNextSteps />
## Close the OpenRAG TUI
To close the OpenRAG TUI, press <kbd>q</kbd>.
The OpenRAG containers will continue to be served until the containers are stopped.
For more information, see [Manage OpenRAG containers with the TUI ](#tui-container-management).
To start the TUI again, run `uv run openrag`.
## Manage OpenRAG containers with the TUI {#tui-container-management}
After installation, the TUI can deploy, manage, and upgrade your OpenRAG containers.
### Start all services
Click **Start All Services** to start the OpenRAG containers.
The TUI automatically detects your container runtime, and then checks if your machine has compatible GPU support by checking for `CUDA`, `NVIDIA_SMI`, and Docker/Podman runtime support. This check determines which Docker Compose file OpenRAG uses.
The TUI then pulls the images and deploys the containers with the following command.
```bash
docker compose up -d
```
If images are missing, the TUI runs `docker compose pull`, then runs `docker compose up -d`.
### Status
The **Status** menu displays information on your container deployment.
Here you can check container health, find your service ports, view logs, and upgrade your containers.
To view streaming logs, select the container you want to view, and press <kbd>l</kbd>.
To copy your logs, click **Copy to Clipboard**.
To **upgrade** your containers, click **Upgrade**.
**Upgrade** runs `docker compose pull` and then `docker compose up -d --force-recreate`.
For more information, see [Upgrade OpenRAG containers with the TUI](#upgrade-openrag-containers-with-the-tui).
To **reset** your containers, click **Reset**.
Reset gives you a completely fresh start.
Reset deletes all of your data, including OpenSearch data, uploaded documents, and authentication.
**Reset** runs two commands.
It first stops and removes all containers, volumes, and local images.
```
docker compose down --volumes --remove-orphans --rmi local
```
When the first command is complete, OpenRAG removes any additional Docker objects with `prune`.
```
docker system prune -f
```
### Native services status
A _native service_ in OpenRAG refers to a service run locally on your machine, and not within a container.
The `docling serve` process is a native service in OpenRAG, because it's a document processing service that is run on your local machine, and controlled separately from the containers.
To start or stop `docling serve` or any other native services, in the TUI Status menu, click **Stop** or **Restart**.
To view the status, port, or PID of a native service, in the TUI main menu, click [Status](#status).
## Upgrade OpenRAG {#upgrade}
To upgrade OpenRAG, upgrade the OpenRAG Python package, and then upgrade the OpenRAG containers using the OpenRAG TUI.
Upgrading the OpenRAG Python package updates the TUI and Python code, but container versions are controlled separately by environment variables in your `.env` file.
### Upgrade OpenRAG python package
Use the following steps to upgrade the OpenRAG Python package to the latest version from [PyPI](https://pypi.org/project/openrag/).
After upgrading the Python package, you should also [upgrade your OpenRAG containers](#upgrade-openrag-containers-with-the-tui).
<Tabs groupId="Installation method">
<TabItem value="installer" label="Automatic installer / uvx" default>
If you installed OpenRAG using the [automatic installer](#install) or [uvx](#install), follow these steps to upgrade:
1. Navigate to your OpenRAG workspace directory:
```bash
cd openrag-workspace
```
2. Upgrade the OpenRAG package:
```bash
uvx --from openrag openrag
```
To upgrade to a specific version:
```bash
uvx --from openrag==0.1.33 openrag
```
3. After upgrading the Python package, [upgrade your containers](#upgrade-openrag-containers-with-the-tui).
</TabItem>
<TabItem value="uv-add" label="Python project with uv add">
1. Navigate to your project directory:
```bash
cd YOUR_PROJECT_NAME
```
2. Update OpenRAG to the latest version:
```bash
uv add --upgrade openrag
```
To upgrade to a specific version:
```bash
uv add --upgrade openrag==0.1.33
```
3. Start the OpenRAG TUI:
```bash
uv run openrag
```
4. After upgrading the Python package, [upgrade your containers](#upgrade-openrag-containers-with-the-tui).
</TabItem>
<TabItem value="uv-pip" label="Existing virtual environment with uv pip install">
1. Activate your virtual environment.
2. Upgrade OpenRAG:
```bash
uv pip install --upgrade openrag
```
To upgrade to a specific version:
```bash
uv pip install --upgrade openrag==0.1.33
```
3. Start the OpenRAG TUI:
```bash
uv run openrag
```
4. After upgrading the Python package, [upgrade your containers](#upgrade-openrag-containers-with-the-tui).
</TabItem>
</Tabs>
### Upgrade OpenRAG containers with the TUI {#upgrade-openrag-containers-with-the-tui}
After upgrading the OpenRAG Python package, upgrade your containers to ensure they match the `latest` version.
**Upgrade** runs `docker compose pull`, which pulls container images based on versions specified in your `.env` file.
`OPENRAG_VERSION` is set to `latest` by default, so it pulls the `latest` available container images.
1. In the OpenRAG TUI, click **Status**, and then click **Upgrade**.
2. When the upgrade completes, close the **Status** window and continue using OpenRAG.
If you encounter a `langflow container already exists` error during upgrade, see [Langflow container already exists during upgrade](/support/troubleshoot#langflow-container-already-exists-during-upgrade) in the troubleshooting guide.
To pin container versions to a specific release other than `latest`, set the `OPENRAG_VERSION` in your `.env` file:
```bash
OPENRAG_VERSION=0.1.33
```
For more information, see [System settings environment variables](/reference/configuration#system-settings).
## Diagnostics
The **Diagnostics** menu provides health monitoring for your container runtimes and monitoring of your OpenSearch security.
## Reinstall OpenRAG {#reinstall}
To reinstall OpenRAG with a completely fresh setup:
1. Reset your containers using the **Reset** button in the [TUI status](#status) menu.
This removes all containers, volumes, and data.
2. Optional: Delete your project's `.env` file.
The Reset operation does not remove your project's `.env` file, so your passwords, API keys, and OAuth settings can be preserved.
If you delete the `.env` file, run the [Set up OpenRAG with the TUI](#setup) process again to create a new configuration.
3. In the TUI Setup menu, follow these steps from [Basic Setup](#setup):
1. Click **Start All Services** to pull container images and start them.
2. Under **Native Services**, click **Start** to start the Docling service.
3. Click **Open App** to open the OpenRAG application.
4. Continue with [Application Onboarding](#application-onboarding).

View file

@ -1,178 +0,0 @@
---
title: Manage OpenRAG containers and services
slug: /manage-services
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialDockerComposeUp from '@site/docs/_partial-docker-compose-up.mdx';
import PartialDockerComposeDownAndPrune from '@site/docs/_partial-docker-compose-down-and-prune.mdx';
import PartialFactorResetWarning from '@site/docs/_partial-factory-reset-warning.mdx';
import PartialExportFlows from '@site/docs/_partial-export-flows.mdx';
Service management is an essential part of maintaining your OpenRAG deployment.
Most OpenRAG services run in containers.
However, some services, like Docling, run directly on the local machine.
If you [installed OpenRAG](/install-options) with the automated installer script, `uv`, or `uvx`, you can use the [Terminal User Interface (TUI)](/tui) to manage your OpenRAG configuration and services.
For [self-managed deployments](/docker), run Docker or Podman commands to manage your OpenRAG services.
## Monitor services and view logs
<Tabs>
<TabItem value="TUI" label="TUI-managed services" default>
In the TUI, click **Status** to access diagnostics and controls for all OpenRAG services, including container health, ports, and image versions.
To view streaming logs, click the name of a service, and then press <kbd>l</kbd>.
For the Docling native service, see [Stop, start, and inspect native services](#start-native-services).
</TabItem>
<TabItem value="env" label="Self-managed services">
For self-managed container services, you can get container logs with [`docker compose logs`](https://docs.docker.com/reference/cli/docker/compose/logs/) or [`podman logs`](https://docs.podman.io/en/latest/markdown/podman-logs.1.html).
For the Docling native service, see [Stop, start, and inspect native services](#start-native-services).
</TabItem>
</Tabs>
## Stop and start containers
<Tabs>
<TabItem value="TUI" label="TUI-managed services" default>
On the TUI's **Status** page, you can stop, start, and restart OpenRAG's container-based services.
When you click **Restart** or **Start Services**, the following processes are triggered:
1. OpenRAG automatically detects your container runtime, and then checks if your machine has compatible GPU support by checking for `CUDA`, `NVIDIA_SMI`, and Docker/Podman runtime support. This check determines which Docker Compose file OpenRAG uses because there are separate Docker Compose files for GPU and CPU deployments.
2. OpenRAG pulls the OpenRAG container images with `docker compose pull` if any images are missing.
3. OpenRAG deploys the containers with `docker compose up -d`.
</TabItem>
<TabItem value="env" label="Self-managed services">
Use [`docker compose down`](https://docs.docker.com/reference/cli/docker/compose/down/) and [`docker compose up -d`](https://docs.docker.com/reference/cli/docker/compose/up/).
To stop or start individual containers, use targeted commands like `docker stop CONTAINER_ID` and `docker start CONTAINER_ID`.
</TabItem>
</Tabs>
## Stop, start, and inspect native services (Docling) {#start-native-services}
A _native service_ in OpenRAG is a service that runs locally on your machine, not within a container. For example, the `docling serve` process is an OpenRAG native service because this document processing service runs on your local machine, separate from the OpenRAG containers.
<Tabs>
<TabItem value="TUI" label="TUI-managed services" default>
On the TUI's **Status** page, you can stop, start, restart, and inspect OpenRAG's native services.
The **Native Services** section lists the status, port, and process ID (PID) for each native service.
To manage a native service, click the service's name, and then click **Stop**, **Start** or **Restart**.
To view the logs for a native service, click the service's name, and then press <kbd>l</kbd>.
</TabItem>
<TabItem value="env" label="Self-managed services">
Because the Docling service doesn't run in a container, you must start and stop it manually on the host machine:
* Stop `docling serve`:
```bash
uv run python scripts/docling_ctl.py stop
```
* Start `docling serve`:
```bash
uv run python scripts/docling_ctl.py start --port 5001
```
* Check that `docling serve` is running:
```bash
uv run python scripts/docling_ctl.py status
```
If `docling serve` is running, the output includes the status, address, and process ID (PID):
```text
Status: running
Endpoint: http://127.0.0.1:5001
Docs: http://127.0.0.1:5001/docs
PID: 27746
```
</TabItem>
</Tabs>
## Upgrade services
See [Upgrade OpenRAG](/upgrade).
## Reset containers (destructive) {#reset-containers}
<PartialFactorResetWarning />
Use these steps to reset your OpenRAG deployment by recreating the containers and deleting all data in the `~/.openrag` directory _except_ for the `.env` file and the `/documents` subdirectory.
This restores your OpenRAG deployment to a near-initial state while preserving your configuration (in `.env`) and uploaded documents (in `/documents`).
Your documents are reingested into a fresh OpenSearch index after the reset.
To reset your OpenRAG deployment _and_ delete all OpenRAG data, see [Reinstall OpenRAG](/reinstall).
<Tabs>
<TabItem value="TUI" label="TUI-managed services" default>
<PartialExportFlows />
2. To destroy and recreate your OpenRAG containers, click **Status** in the TUI, and then click **Factory Reset**.
3. Repeat the [setup process](/install#setup) to restart the services and launch the OpenRAG app. Your OpenRAG passwords, OAuth credentials (if previously set), and onboarding configuration are restored from the `.env` file.
4. If you exported customized flows, [import your flows](https://docs.langflow.org/concepts-flows-import) into Langflow after completing the onboarding process.
</TabItem>
<TabItem value="env" label="Self-managed services">
<PartialExportFlows />
2. Recreate the containers:
```bash title="Docker"
docker compose up --build --force-recreate --remove-orphans
```
```bash title="Podman"
podman compose up --build --force-recreate --remove-orphans
```
3. Launch the OpenRAG app, and then repeat the [application onboarding process](/docker#application-onboarding).
4. If you exported customized flows, [import your flows](https://docs.langflow.org/concepts-flows-import) into Langflow after completing the onboarding process.
</TabItem>
</Tabs>
## Prune images
Use image pruning to free up disk space by removing unused OpenRAG container images.
For TUI-managed services, use the TUI's **Prune Images** option to clean up your OpenRAG container images.
You can choose to prune unused images only or all images.
If you prune all images, the OpenRAG services are stopped, all images are pruned, and then the required images are pulled the next time you start the OpenRAG services.
For self-managed services, use [`docker image prune`](https://docs.docker.com/engine/reference/commandline/image_prune/) or [`podman image prune`](https://docs.podman.io/en/latest/markdown/podman-image-prune.1.html) to remove unused images.
## See also
* [Uninstall OpenRAG](/uninstall)

View file

@ -6,155 +6,210 @@ slug: /quickstart
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialIntegrateChat from '@site/docs/_partial-integrate-chat.mdx';
import PartialPrereqWindows from '@site/docs/_partial-prereq-windows.mdx';
import PartialPrereqPython from '@site/docs/_partial-prereq-python.mdx';
Use this quickstart to install OpenRAG, and then try some of OpenRAG's core features.
Get started with OpenRAG by loading your knowledge, swapping out your language model, and then chatting with the Langflow API.
## Prerequisites
<PartialPrereqPython />
:::tip
This quickstart uses a minimal setup to demonstrate OpenRAG's core functionality. After you complete the quickstart, it is recommended that you reinstall OpenRAG with your preferred configuration because some settings are immutable after initial setup. For all installation options, see [Install OpenRAG with TUI](/install) and [Install OpenRAG with containers](/docker).
:::
* Get an [OpenAI API key](https://platform.openai.com/api-keys).
This quickstart uses OpenAI for simplicity.
For other providers, see the other [installation methods](/install-options).
Install OpenRAG with the automatic installer.
The script detects and installs uv, Docker/Podman, and Docker Compose prerequisites, and then starts OpenRAG with `uvx`.
<PartialPrereqWindows />
1. Create a directory to store the OpenRAG configuration files:
```bash
mkdir openrag-workspace
cd openrag-workspace
```
## Install OpenRAG
2. Run the installer:
```bash
curl -fsSL https://docs.openr.ag/files/run_openrag_with_prereqs.sh | bash
```
For this quickstart, install OpenRAG with the automatic installer script and basic setup.
The script installs OpenRAG dependencies, including Docker or Podman, and then it installs and runs OpenRAG with [`uvx`](https://docs.astral.sh/uv/guides/tools/#running-tools).
The TUI creates a `.env` file and docker-compose files in the current working directory, and then starts OpenRAG.
1. Create a directory for your OpenRAG installation, and then change to that directory:
3. Select **Basic Setup**.
4. To generate a password for OpenSearch, click **Generate Passwords**.
The other fields aren't required.
5. To start OpenRAG, click **Start All Services**.
Startup pulls container images and runs them, so it can take some time.
When startup is complete, the TUI displays the following:
```bash
Services started successfully
Command completed successfully
```
6. To open the OpenRAG application, navigate to the TUI main menu, and then click **Open App**.
Alternatively, in your browser, navigate to `localhost:3000`.
7. For your model provider, select **OpenAI**.
8. In the **OpenAI API key** field, paste your OpenAI API key.
The default model settings are fine for the quickstart.
9. To confirm your provider settings, click **Complete**.
10. To complete onboarding, click **What is OpenRAG**, and then click **Add a document**.
Alternatively, click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
```bash
mkdir openrag-workspace
cd openrag-workspace
```
To quit OpenRAG, navigate to the TUI main menu and press <kbd>q</kbd>.
To start OpenRAG again, run `uvx openrag`.
2. [Download the OpenRAG install script](https://docs.openr.ag/files/run_openrag_with_prereqs.sh), move it to your OpenRAG directory, and then run it:
```bash
bash run_openrag_with_prereqs.sh
```
Wait while the installer script prepares your environment and installs OpenRAG.
You might be prompted to install certain dependencies if they aren't already present in your environment.
The entire process can take a few minutes.
Once the environment is ready, the OpenRAG [Terminal User Interface (TUI)](/tui) starts.
![OpenRAG TUI Interface](@site/static/img/openrag_tui_dec_2025.png)
3. In the TUI, click **Basic Setup**.
4. For **Langflow Admin Password**, click **Generate Password** to create a Langflow administrator password and username.
5. Use the default values for all other fields.
6. Click **Save Configuration**.
Your OpenRAG configuration and passwords are stored in an [OpenRAG `.env` file](/reference/configuration) file that is created automatically at `~/.openrag/tui`.
OpenRAG container definitions are stored in the `docker-compose` files in the same directory.
7. Click **Start OpenRAG** to start the OpenRAG services.
This process can take some time while OpenRAG pulls and runs the container images.
If all services start successfully, the TUI prints a confirmation message:
```text
Services started successfully
Command completed successfully
```
8. Click **Close**, and then click **Launch OpenRAG** to access the OpenRAG application and start the application onboarding process.
9. For this quickstart, select the **OpenAI** model provider, enter your OpenAI API key, and then click **Complete**. Use the default settings for all other model options.
10. Click through the overview slides for a brief introduction to OpenRAG, or click <Icon name="ArrowRight" aria-hidden="true"/> **Skip overview**.
You can complete this quickstart without going through the overview.
The overview demonstrates some basic functionality that is covered in the next section and in other parts of the OpenRAG documentation.
## Load and chat with documents {#chat-with-documents}
Use the [OpenRAG **Chat**](/chat) to explore the documents in your OpenRAG database using natural language queries.
Some documents are included by default to get you started, and you can load your own documents.
## Load and chat with your own documents
1. In OpenRAG, click <Icon name="MessageSquare" aria-hidden="true"/> **Chat**.
The chat is powered by the OpenRAG OpenSearch Agent.
For more information, see [Langflow in OpenRAG](/agents).
2. Ask `What documents are available to you?`
The agent responds with a message summarizing the documents that OpenRAG loads by default.
Knowledge is stored in OpenSearch.
For more information, see [OpenSearch in OpenRAG](/knowledge).
3. To confirm the agent is correct about the default knowledge, click <Icon name="Library" aria-hidden="true"/> **Knowledge**.
The **Knowledge** page lists the documents OpenRAG has ingested into the OpenSearch vector database.
Click on a document to display the chunks derived from splitting the default documents into the OpenSearch vector database.
4. To add documents to your knowledge base, click **Add Knowledge**.
* Select <Icon name="File" aria-hidden="true"/> **File** to add a single file from your local machine.
* Select <Icon name="Folder" aria-hidden="true"/> **Folder** to process an entire folder of documents from your local machine. The default directory is `/documents` in your OpenRAG directory.
* Select your cloud storage provider to add knowledge from an OAuth-connected storage provider. For more information, see [OAuth ingestion](/knowledge#oauth-ingestion).
5. Return to the Chat window and ask a question about your loaded data.
For example, with a manual about a PC tablet loaded, ask `How do I connect this device to WiFi?`
The agent responds with a message indicating it now has your knowledge as context for answering questions.
6. Click <Icon name="Gear" aria-hidden="true"/> **Function Call: search_documents (tool_call)**.
This log describes how the agent uses tools.
This is helpful for troubleshooting when the agent isn't responding as expected.
2. For this quickstart, ask the agent what documents are available.
For example: `What documents are available to you?`
## Swap out the language model to modify agent behavior {#change-components}
The agent responds with a summary of OpenRAG's default documents.
To modify the knowledge ingestion or Agent behavior, click <Icon name="Settings2" aria-hidden="true"/> **Settings**.
3. To verify the agent's response, click <Icon name="Library" aria-hidden="true"/> **Knowledge** to view the documents stored in the OpenRAG OpenSearch database.
You can click a document to view the chunks of the document as they are stored in the database.
In this example, you'll try a different LLM to demonstrate how the Agent's response changes.
4. Click **Add Knowledge** to add your own documents to your OpenRAG knowledge base.
1. To edit the Agent's behavior, click **Edit in Langflow**.
You can more quickly access these parameters in the **Language model** and **Agent Instructions** fields in this page, but for illustration purposes, navigate to the Langflow visual builder.
To revert the flow to its initial state, click **Restore flow**.
2. OpenRAG warns you that you're entering Langflow. Click **Proceed**.
For this quickstart, use either the <Icon name="File" aria-hidden="true"/> **File** or <Icon name="Folder" aria-hidden="true"/> **Folder** upload options to load documents from your local machine.
**Folder** uploads an entire directory.
The default directory is `~/.openrag/documents`.
If Langflow requests login information, enter the `LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD` from the `.env` file in your OpenRAG directory.
For information about the cloud storage provider options, see [Ingest files with OAuth connectors](/ingestion#oauth-ingestion).
The OpenRAG OpenSearch Agent flow appears in a new browser window.
![OpenRAG Open Search Agent Flow](/img/opensearch-agent-flow.png)
5. Return to the **Chat** window, and then ask a question related to the documents that you just uploaded.
3. Find the **Language Model** component, and then change the **Model Name** field to a different OpenAI model.
4. Save your flow with <kbd>Command+S</kbd> (Mac) or <kbd>Ctrl+S</kbd> (Windows).
5. Return to the OpenRAG browser window, and start a new conversation by clicking <Icon name="Plus" aria-hidden="true"/> in the **Conversations** tab.
6. Ask the same question you asked before to see how the response differs between models.
If the agent's response doesn't seem to reference your documents correctly, try the following:
## Integrate OpenRAG into your application
* Click <Icon name="Gear" aria-hidden="true"/> **Function Call: search_documents (tool_call)** to view the log of tool calls made by the agent. This is helpful for troubleshooting because it shows you how the agent used particular tools.
Langflow in OpenRAG includes pre-built flows that you can integrate into your applications using the [Langflow API](https://docs.langflow.org/api-reference-api-examples).
* Click <Icon name="Library" aria-hidden="true"/> **Knowledge** to confirm that the documents are present in the OpenRAG OpenSearch database, and then click each document to see how the document was chunked.
If a document was chunked improperly, you might need to tweak the ingestion or modify and reupload the document.
The Langflow API accepts Python, TypeScript, or curl requests to run flows and get responses. You can use these flows as-is or modify them to better suit your needs.
* Click <Icon name="Settings2" aria-hidden="true"/> **Settings** to modify the knowledge ingestion settings.
In this section, you'll run the OpenRAG OpenSearch Agent flow and get a response using the API.
For more information, see [Configure knowledge](/knowledge) and [Ingest knowledge](/ingestion).
1. To navigate to the OpenRAG OpenSearch Agent flow in Langflow, click <Icon name="Settings2" aria-hidden="true"/> **Settings**, and then click **Edit in Langflow** in the OpenRAG OpenSearch Agent flow.
2. Create a [Langflow API key](https://docs.langflow.org/api-keys-and-authentication).
## Change the language model and chat settings {#change-components}
A Langflow API key is a user-specific token you can use with Langflow.
It is **only** used for sending requests to the Langflow server.
It does **not** access OpenRAG.
1. To change the knowledge ingestion settings, agent behavior, or language model, click <Icon name="Settings2" aria-hidden="true"/> **Settings**.
To create a Langflow API key, do the following:
The **Settings** page provides quick access to commonly used parameters like the **Language model** and **Agent Instructions**.
1. Open Langflow, click your user icon, and then select **Settings**.
2. Click **Langflow API Keys**, and then click <Icon name="Plus" aria-hidden="true"/> **Add New**.
3. Name your key, and then click **Create API Key**.
4. Copy the API key and store it securely.
2. For greater insight into the underlying [Langflow flow](/agents) that drives the OpenRAG chat, click **Edit in Langflow** and then click **Proceed** to launch the Langflow visual editor in a new browser window.
3. Langflow includes code snippets for the request to the Langflow API.
To retrieve the code snippet, click **Share**, and then click **API access**.
If Langflow requests login information, enter the `LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD` from the `.env` file at `~/.openrag/tui`.
The default code in the API access pane constructs a request with the Langflow server `url`, `headers`, and a `payload` of request data. The code snippets automatically include the `LANGFLOW_SERVER_ADDRESS` and `FLOW_ID` values for the flow.
The **OpenRAG OpenSearch Agent** flow opens in a new browser window.
<Tabs>
<TabItem value="python" label="Python">
```python
import requests
import os
import uuid
api_key = 'LANGFLOW_API_KEY'
url = "http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID" # The complete API endpoint URL for this flow
# Request payload configuration
payload = {
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
}
payload["session_id"] = str(uuid.uuid4())
headers = {"x-api-key": api_key}
try:
# Send API request
response = requests.request("POST", url, json=payload, headers=headers)
response.raise_for_status() # Raise exception for bad status codes
# Print response
print(response.text)
except requests.exceptions.RequestException as e:
print(f"Error making API request: {e}")
except ValueError as e:
print(f"Error parsing response: {e}")
```
</TabItem>
<TabItem value="typescript" label="TypeScript">
```typescript
const crypto = require('crypto');
const apiKey = 'LANGFLOW_API_KEY';
const payload = {
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
};
payload.session_id = crypto.randomUUID();
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
"x-api-key": apiKey
},
body: JSON.stringify(payload)
};
fetch('http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID', options)
.then(response => response.json())
.then(response => console.warn(response))
.catch(err => console.error(err));
```
</TabItem>
<TabItem value="curl" label="curl">
```bash
curl --request POST \
--url 'http://LANGFLOW_SERVER_ADDRESS/api/v1/run/FLOW_ID?stream=false' \
--header 'Content-Type: application/json' \
--header "x-api-key: LANGFLOW_API_KEY" \
--data '{
"output_type": "chat",
"input_type": "chat",
"input_value": "hello world!"
}'
```
</TabItem>
</Tabs>
![OpenRAG OpenSearch Agent flow](/img/opensearch-agent-flow.png)
4. Copy the snippet, paste it in a script file, and then run the script to send the request. If you are using the curl snippet, you can run the command directly in your terminal.
3. For this quickstart, try changing the model.
Click the **Language Model** component, and then change the **Model Name** to a different OpenAI model.
If the request is successful, the response includes many details about the flow run, including the session ID, inputs, outputs, components, durations, and more.
After you edit a built-in flow, you can click **Restore flow** on the **Settings** page to revert the flow to its original state when you first installed OpenRAG.
To further explore the API, see:
4. Press <kbd>Command</kbd>+<kbd>S</kbd> (<kbd>Ctrl</kbd>+<kbd>S</kbd>) to save your changes.
You can close the Langflow browser window, or leave it open if you want to continue experimenting with the flow editor.
5. Switch to your OpenRAG browser window, and then click <Icon name="Plus" aria-hidden="true"/> in the **Conversations** tab to start a new conversation.
This ensures that the chat doesn't persist any context from the previous conversation with the original model.
6. Ask the same question you asked in [Load and chat with documents](#chat-with-documents) to see how the response differs from the original model.
## Integrate OpenRAG into an application
Langflow in OpenRAG includes pre-built flows that you can integrate into your applications using the [Langflow API](https://docs.langflow.org/api-reference-api-examples).
You can use these flows as-is or modify them to better suit your needs, as demonstrated in [Change the language model and chat settings](#change-components).
You can send and receive requests with the Langflow API using Python, TypeScript, or curl.
<PartialIntegrateChat />
## Next steps
* **Reinstall OpenRAG with your preferred settings**: This quickstart used `uvx` and a minimal setup to demonstrate OpenRAG's core functionality.
It is recommended that you [reinstall OpenRAG](/reinstall) with your preferred configuration and [installation method](/install-options).
* **Learn more about OpenRAG**: Explore OpenRAG and the OpenRAG documentation to learn more about its features and functionality.
* **Learn more about Langflow**: For a deep dive on the Langflow API and visual editor, see the [Langflow documentation](https://docs.langflow.org/).
* The Langflow [Quickstart](https://docs.langflow.org/quickstart#extract-data-from-the-response) extends this example with extracting fields from the response.
* [Get started with the Langflow API](https://docs.langflow.org/api-reference-api-examples)

View file

@ -1,87 +0,0 @@
---
title: Reinstall OpenRAG
slug: /reinstall
---
import PartialDockerComposeUp from '@site/docs/_partial-docker-compose-up.mdx';
import PartialDockerComposeDownAndPrune from '@site/docs/_partial-docker-compose-down-and-prune.mdx';
import PartialDockerStopAll from '@site/docs/_partial-docker-stop-all.mdx';
import PartialDockerRemoveAndCleanupSteps from '@site/docs/_partial-docker-remove-and-cleanup-steps.mdx';
import PartialFactorResetWarning from '@site/docs/_partial-factory-reset-warning.mdx';
import PartialExportFlows from '@site/docs/_partial-export-flows.mdx';
You can reset your OpenRAG deployment to its initial state by recreating the containers and deleting accessory data, such as the `.env` file and ingested documents.
:::warning
These are destructive operations that reset your OpenRAG deployment to an initial state.
Destroyed containers and deleted data are lost and cannot be recovered after running these operations.
:::
## Reinstall TUI-managed containers
<PartialExportFlows />
2. In the TUI, click **Status**, and then click **Factory Reset** to [reset your OpenRAG containers](/manage-services#reset-containers).
<PartialFactorResetWarning />
3. Press <kbd>Esc</kbd> to close the **Status** page, and then press <kbd>q</kbd> to exit the TUI.
4. Optional: Delete or edit [OpenRAG's `.env` file](/reference/configuration), which is stored at `~/.openrag/tui`.
This file contains your OpenRAG configuration, including OpenRAG passwords, API keys, OAuth settings, and other environment variables. If you delete this file, the TUI automatically generates a new one after you repeat the setup and onboarding process. If you preserve this file, the TUI can read values from the existing `.env` file during setup and onboarding.
5. Optional: Remove any files from the `~/.openrag/documents` subdirectory that you don't want to reingest after redeploying the containers.
It is recommended that you preserve OpenRAG's [default documents](https://github.com/langflow-ai/openrag/tree/main/openrag-documents).
6. Restart the TUI with `uv run openrag` or `uvx openrag`.
7. Repeat the [setup process](/install#setup) to configure OpenRAG and restart all services.
Then, launch the OpenRAG app and repeat the [application onboarding process](/install#application-onboarding).
## Reinstall self-managed containers with `docker compose` or `podman compose`
Use these steps to reinstall OpenRAG containers with streamlined `docker compose` or `podman compose` commands:
<PartialExportFlows />
2. Destroy the containers, volumes, and local images, and then remove (prune) any additional container objects.
<PartialFactorResetWarning />
<PartialDockerComposeDownAndPrune />
3. Optional: Edit OpenRAG's `.env` file if needed.
4. Optional: Remove any files from the `~/.openrag/documents` subdirectory that you don't want to reingest after redeploying the containers.
It is recommended that you preserve OpenRAG's [default documents](https://github.com/langflow-ai/openrag/tree/main/openrag-documents).
5. Redeploy OpenRAG:
<PartialDockerComposeUp />
6. Launch the OpenRAG app, and then repeat the [application onboarding process](/docker#application-onboarding).
## Reinstall self-managed containers with discrete `docker` or `podman` commands
Use these commands to remove and clean up OpenRAG containers with discrete `docker` or `podman` commands.
If you want to reinstall one container, specify the container name in the commands instead of running the commands on all containers.
<PartialExportFlows />
2. Stop all running containers:
<PartialDockerStopAll />
3. Remove and clean up containers:
<PartialDockerRemoveAndCleanupSteps />
4. Optional: Edit OpenRAG's `.env` file if needed.
5. Optional: If you removed all containers or specifically the OpenSearch container, then you can remove any files from the `~/.openrag/documents` subdirectory that you don't want to reingest after redeploying the containers.
It is recommended that you preserve OpenRAG's [default documents](https://github.com/langflow-ai/openrag/tree/main/openrag-documents).
6. If you removed all OpenRAG containers, [redeploy OpenRAG](/docker).
If you removed only one container, redeploy that container with the appropriate `docker run` or `podman run` command.

View file

@ -1,52 +0,0 @@
---
title: Use the TUI
slug: /tui
---
import PartialGpuModeTip from '@site/docs/_partial-gpu-mode-tip.mdx';
The OpenRAG Terminal User Interface (TUI) provides a simplified and guided experience for configuring, managing, and monitoring your OpenRAG deployment directly from the terminal.
![OpenRAG TUI Interface](@site/static/img/openrag_tui_dec_2025.png)
If you install OpenRAG with the [automatic installer script](/install), [`uv`](/install-uv), or [`uvx`](/install-uvx), you use the TUI to manage your OpenRAG deployment.
The TUI guides you through the initial setup, automatically manages your OpenRAG `.env` and `docker-compose` files, and provides convenient access to [service management](/manage-services) controls.
In contrast, when you [deploy OpenRAG with self-managed services](/docker), you must manually configure OpenRAG by preparing a `.env` file, and then use Docker or Podman commands to deploy and manage your OpenRAG services.
## Access the TUI {#access-the-tui}
If you installed OpenRAG with `uv`, access the TUI with `uv run openrag`.
If you installed OpenRAG with the automatic installer script or `uvx`, access the TUI with `uvx openrag`.
## Navigate the TUI
You can navigate the TUI with your mouse or keyboard.
Keyboard shortcuts for additional menus are printed at the bottom of the TUI screen.
## Manage services with the TUI
Use the TUI's **Status** page to access controls and information for your OpenRAG services.
For more information, see [Manage OpenRAG services](/manage-services).
## Toggle GPU/CPU mode
You can toggle between GPU and CPU mode from within the TUI if your system has compatible GPU hardware and drivers installed.
In the TUI, click **Status**, and then click **Switch to GPU Mode** or **Switch to CPU Mode**.
This change requires restarting all OpenRAG services because each mode has its own `docker-compose` file.
:::tip
<PartialGpuModeTip />
:::
## Exit the OpenRAG TUI
To exit the OpenRAG TUI, press <kbd>q</kbd> on the TUI main page.
Exiting the TUI doesn't stop your OpenRAG services.
Your OpenRAG services continue to run until they are stopped from within the TUI or by another process that inadvertently stops them.
To restart the TUI, see [Access the TUI](#access-the-tui).

View file

@ -1,58 +0,0 @@
---
title: Remove OpenRAG
slug: /uninstall
---
import PartialDockerComposeDownAndPrune from '@site/docs/_partial-docker-compose-down-and-prune.mdx';
import PartialDockerStopAll from '@site/docs/_partial-docker-stop-all.mdx';
import PartialDockerRemoveAndCleanupSteps from '@site/docs/_partial-docker-remove-and-cleanup-steps.mdx';
:::tip
If you want to reset your OpenRAG containers without removing OpenRAG entirely, see [Reset OpenRAG containers](/manage-services) and [Reinstall OpenRAG](/reinstall).
:::
## Uninstall TUI-managed deployments
If you used the [automated installer script](/install) or [`uvx`](/install-uvx) to install OpenRAG, clear your `uv` cache (`uv cache clean`) to remove the TUI environment, and then delete the `~/.openrag` directory.
If you used [`uv`](/install-uv) to install OpenRAG, run `uv remove openrag` in your Python project, and then delete the `~/.openrag` directory.
## Uninstall self-managed deployments
For self-managed services, destroy the containers, prune any additional container objects, delete any remaining OpenRAG files, and then shut down the Docling service.
### Uninstall with `docker compose` or `podman compose`
Use these steps to uninstall a self-managed OpenRAG deployment with streamlined `docker compose` or `podman compose` commands:
1. Destroy the containers, volumes, and local images, and then remove (prune) any additional container objects:
<PartialDockerComposeDownAndPrune />
2. Remove OpenRAG's `.env` file and the `~/.openrag/documents` directory, which aren't deleted by the previous commands.
3. Stop `docling-serve`:
```bash
uv run python scripts/docling_ctl.py stop
```
### Uninstall with discrete `docker` or `podman` commands
Use these commands to uninstall a self-managed OpenRAG deployment with discrete `docker` or `podman` commands:
1. Stop all running containers:
<PartialDockerStopAll />
2. Remove and clean up containers:
<PartialDockerRemoveAndCleanupSteps />
3. Remove OpenRAG's `.env` file and the `~/.openrag/documents` directory, which aren't deleted by the previous commands.
4. Stop `docling-serve`:
```bash
uv run python scripts/docling_ctl.py stop
```

View file

@ -1,156 +0,0 @@
---
title: Upgrade OpenRAG
slug: /upgrade
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import PartialExportFlows from '@site/docs/_partial-export-flows.mdx';
Use these steps to upgrade your OpenRAG deployment to the latest version or a specific version.
## Export customized flows before upgrading
If you modified the built-in flows or created custom flows in your OpenRAG Langflow instance, [export your flows](https://docs.langflow.org/concepts-flows-import) before upgrading.
This ensure that you won't lose your flows after upgrading, and you can reference the exported flows if there are any breaking changes in the new version.
## Upgrade TUI-managed deployments
To upgrade OpenRAG, you need to upgrade the OpenRAG Python package, and then upgrade the OpenRAG containers.
Upgrading the Python package also upgrades Docling by bumping the dependency in `pyproject.toml`.
This is a two-part process because upgrading the OpenRAG Python package updates the Terminal User Interface (TUI) and Python code, but the container versions are controlled by environment variables in your [OpenRAG `.env` file](/reference/configuration).
<PartialExportFlows />
2. To check for updates, click **Status** in the TUI, and then click **Upgrade**.
3. If there is an update available, press <kbd>Esc</kbd> to close the **Status** page, then then click **Stop All Services**.
4. Press <kbd>q</kbd> to exit the TUI.
5. Upgrade the OpenRAG Python package to the latest version from [PyPI](https://pypi.org/project/openrag/).
The commands to upgrade the package depend on how you installed OpenRAG.
<Tabs>
<TabItem value="installer" label="Script or uvx" default>
Use these steps to upgrade the Python package if you installed OpenRAG using the [installer script](/install) or [`uvx`](/install-uvx):
1. Navigate to your OpenRAG workspace directory:
```bash
cd openrag-workspace
```
2. Upgrade the OpenRAG package:
```bash
uvx --from openrag openrag
```
You can invoke a specific version using any of the [`uvx` version specifiers](https://docs.astral.sh/uv/guides/tools/#requesting-specific-versions), such as `--from`:
```bash
uvx --from openrag==0.1.30 openrag
```
</TabItem>
<TabItem value="uv-add" label="uv add">
Use these steps to upgrade the Python package if you installed OpenRAG with [`uv add`](/install-uv):
1. Navigate to your project directory:
```bash
cd YOUR_PROJECT_NAME
```
2. Update OpenRAG to the latest version:
```bash
uv add --upgrade openrag
```
To upgrade to a specific version:
```bash
uv add --upgrade openrag==0.1.33
```
3. Start the OpenRAG TUI:
```bash
uv run openrag
```
</TabItem>
<TabItem value="uv-pip" label="uv pip install">
Use these steps to upgrade the Python package if you installed OpenRAG with [`uv pip install`](/install-uv):
1. Activate your virtual environment.
2. Upgrade OpenRAG:
```bash
uv pip install --upgrade openrag
```
To upgrade to a specific version:
```bash
uv pip install --upgrade openrag==0.1.33
```
3. Start the OpenRAG TUI:
```bash
uv run openrag
```
</TabItem>
</Tabs>
6. In the OpenRAG TUI, click **Start Services**, and then wait while the services start.
When you start services after upgrading the Python package, OpenRAG runs `docker compose pull` to get the appropriate container images matching the version specified in your OpenRAG `.env` file. Then, it recreates the containers with the new images using `docker compose up -d --force-recreate`.
:::tip Pin container versions
In the OpenRAG `.env` file, the `OPENRAG_VERSION` [environment variable](/reference/configuration#system-settings) is set to `latest` by default, which pulls the `latest` available container images.
To pin a specific container image version, you can set `OPENRAG_VERSION` to the desired container image version, such as `OPENRAG_VERSION=0.1.33`.
However, when you upgrade the Python package, OpenRAG automatically attempts to keep the `OPENRAG_VERSION` synchronized with the Python package version.
You might need to edit the `.env` file after upgrading the Python package to enforce a different container version.
The TUI warns you if it detects a version mismatch.
:::
If you get an error that `langflow container already exists` error during upgrade, see [Langflow container already exists during upgrade](/support/troubleshoot#langflow-container-already-exists-during-upgrade).
7. After the containers start, click **Close**, and then click **Launch OpenRAG**.
## Upgrade self-managed deployments
<PartialExportFlows />
2. Fetch and apply the latest container images while preserving your OpenRAG data:
```bash title="Docker"
docker compose pull
docker compose up -d --force-recreate
```
```bash title="Podman"
podman compose pull
podman compose up -d --force-recreate
```
By default, OpenRAG's `docker-compose` files pull the latest container images.
3. After the containers start, access the OpenRAG application at `http://localhost:3000`.
## See also
* [Manage OpenRAG services](/manage-services)
* [Troubleshoot OpenRAG](/support/troubleshoot)

View file

@ -1,68 +1,125 @@
---
title: What is OpenRAG?
slug: /
hide_table_of_contents: true
---
OpenRAG is an open-source package for building agentic RAG systems that integrates with a wide range of orchestration tools, databases, and LLM providers.
OpenRAG is an open-source package for building agentic RAG systems that integrates with a wide range of orchestration tools, vector databases, and LLM providers.
OpenRAG connects and amplifies three popular, proven open-source projects into one powerful platform:
* [Langflow](https://docs.langflow.org): Langflow is a versatile tool for building and deploying AI agents and MCP servers. It supports all major LLMs, popular vector databases, and a growing library of AI tools.
OpenRAG uses several built-in flows, and it provides full access to all Langflow features through the embedded Langflow visual editor.
By customizing the built-in flows or creating your own flows, every part of the OpenRAG stack interchangeable. You can modify any aspect of the flows from basic settings, like changing the language model, to replacing entire components. You can also write your own custom Langflow components, integrate MCP servers, call APIs, and leverage any other functionality provided by Langflow.
* [Langflow](https://docs.langflow.org): Langflow is a versatile tool for building and deploying AI agents and MCP servers. It supports all major LLMs, vector databases, and a growing library of AI tools.
* [OpenSearch](https://docs.opensearch.org/latest/): OpenSearch is a community-driven, Apache 2.0-licensed open source search and analytics suite that makes it easy to ingest, search, visualize, and analyze data.
It provides powerful hybrid search capabilities with enterprise-grade security and multi-tenancy support.
OpenRAG uses OpenSearch as the underlying database for storing and retrieving your documents and associated vector data (embeddings). You can ingest documents from a variety of sources, including your local filesystem and OAuth authenticated connectors to popular cloud storage services.
* [Docling](https://docling-project.github.io/docling/): Docling simplifies document processing, parsing diverse formats — including advanced PDF understanding — and providing seamless integrations with the gen AI ecosystem.
* [Docling](https://docling-project.github.io/docling/): Docling simplifies document processing, supports many file formats and advanced PDF parsing, and provides seamless integrations with the generative AI ecosystem.
OpenRAG builds on Langflow's familiar interface while adding OpenSearch for vector storage and Docling for simplified document parsing, with opinionated flows that serve as ready-to-use recipes for ingestion, retrieval, and generation from popular sources like Google Drive, OneDrive, and Sharepoint.
OpenRAG uses Docling to parse and chunk documents that are stored in your OpenSearch knowledge base.
What's more, every part of the stack is swappable. Write your own custom components in Python, try different language models, and customize your flows to build an agentic RAG system.
:::tip
Ready to get started? Try the [quickstart](/quickstart) to install OpenRAG and start exploring in minutes.
:::
Ready to get started? [Install OpenRAG](/install) and then run the [Quickstart](/quickstart) to create a powerful RAG pipeline.
## OpenRAG architecture
OpenRAG deploys and orchestrates a lightweight, container-based architecture that combines **Langflow**, **OpenSearch**, and **Docling** into a cohesive RAG platform.
```mermaid
---
config:
theme: 'base'
themeVariables:
lineColor: '#2e8555'
---
flowchart TD
subgraph Containers
backend[OpenRAG backend] --> langflow[Langflow]
langflow <--> opensearch[OpenSearch]
backend <--> frontend[OpenRAG frontend]
%%{init: {'theme': 'dark', 'flowchart': {'useMaxWidth': false, 'width': '100%'}}}%%
flowchart LR
%% Encapsulate the entire diagram in a rectangle with black background
subgraph DiagramContainer["OpenRAG Architecture"]
style DiagramContainer fill:#000000,stroke:#ffffff,color:white,stroke-width:2px
%% Define subgraphs for the different sections
subgraph LocalService["Local Service"]
DoclingSrv[Docling Serve]
style DoclingSrv fill:#a8d1ff,stroke:#0066cc,color:black,stroke-width:2px
end
subgraph Containers
Backend["OpenRAG Backend"]
style Backend fill:#e6ffe6,stroke:#006600,color:black,stroke-width:2px
Langflow
style Langflow fill:#e6ffe6,stroke:#006600,color:black,stroke-width:2px
OpenSearch
style OpenSearch fill:#e6ffe6,stroke:#006600,color:black,stroke-width:2px
Frontend["OpenRAG Frontend"]
style Frontend fill:#ffcc99,stroke:#ff6600,color:black,stroke-width:2px
end
subgraph ThirdParty["Third Party Services"]
GoogleDrive["Google Drive"]
style GoogleDrive fill:#f2e6ff,stroke:#6600cc,color:black,stroke-width:2px
OneDrive
style OneDrive fill:#f2e6ff,stroke:#6600cc,color:black,stroke-width:2px
SharePoint["SharePoint"]
style SharePoint fill:#f2e6ff,stroke:#6600cc,color:black,stroke-width:2px
More[...]
style More fill:#f2e6ff,stroke:#6600cc,color:black,stroke-width:2px
end
%% Define connections
DoclingSrv --> Backend
GoogleDrive --> Backend
OneDrive --> Backend
SharePoint --> Backend
More --> Backend
Backend --> Langflow
Langflow <--> OpenSearch
Backend <--> Frontend
%% Style subgraphs
style LocalService fill:#333333,stroke:#666666,color:white,stroke-width:2px
style Containers fill:#444444,stroke:#666666,color:white,stroke-width:2px
style ThirdParty fill:#333333,stroke:#666666,color:white,stroke-width:2px
end
subgraph local [Local services]
docling[Docling Serve]
end
subgraph ext [External connectors]
drive1[Google Drive]
drive2[OneDrive]
drive3[SharePoint]
drive4[Others]
end
local --> backend
ext --> backend
```
* **OpenRAG backend**: The central orchestration service that coordinates all other components.
The **OpenRAG Backend** is the central orchestration service that coordinates all other components.
* **Langflow**: This container runs a Langflow instance. It provides the embedded Langflow visual editor for editing and creating flow, and it connects to the **OpenSearch** container for document storage and retrieval.
**Langflow** provides a visual workflow engine for building AI agents, and connects to **OpenSearch** for vector storage and retrieval.
* **Docling Serve**: This is a local document processing service managed by the **OpenRAG backend**.
**Docling Serve** is a local document processing service managed by the **OpenRAG Backend**.
* **External connectors**: Integrate third-party cloud storage services with OAuth authenticated connectors to the **OpenRAG backend**, allowing you to load documents from external storage to your OpenSearch knowledge base.
**Third Party Services** like **Google Drive** connect to the **OpenRAG Backend** through OAuth authentication, allowing synchronication of cloud storage with the OpenSearch knowledge base.
* **OpenRAG frontend**: Provides the user interface for interacting with the OpenRAG platform.
The **OpenRAG Frontend** provides the user interface for interacting with the system.
## Performance expectations
On a local VM with 7 vCPUs and 8GiB RAM, OpenRAG ingested approximately 5.03 GB across 1,083 files in about 42 minutes.
This equates to approximately 2.4 documents per second.
You can generally expect equal or better performance on developer laptops and significantly faster on servers.
Throughput scales with CPU cores, memory, storage speed, and configuration choices such as embedding model, chunk size and overlap, and concurrency.
This test returned 12 errors (approximately 1.1%).
All errors were filespecific, and they didn't stop the pipeline.
Ingestion dataset:
* Total files: 1,083 items mounted
* Total size on disk: 5,026,474,862 bytes (approximately 5.03 GB)
Hardware specifications:
* Machine: Apple M4 Pro
* Podman VM:
* Name: `podman-machine-default`
* Type: `applehv`
* vCPUs: 7
* Memory: 8 GiB
* Disk size: 100 GiB
Test results:
```text
2025-09-24T22:40:45.542190Z /app/src/main.py:231 Ingesting default documents when ready disable_langflow_ingest=False
2025-09-24T22:40:45.546385Z /app/src/main.py:270 Using Langflow ingestion pipeline for default documents file_count=1082
...
2025-09-24T23:19:44.866365Z /app/src/main.py:351 Langflow ingestion completed success_count=1070 error_count=12 total_files=1082
```
Elapsed time: ~42 minutes 15 seconds (2,535 seconds)
Throughput: ~2.4 documents/second

View file

@ -1,12 +0,0 @@
---
title: OpenRAG APIs and SDKs
slug: /reference/api-sdk-overview
---
You can use OpenRAG's APIs and SDKs to integrate and extend OpenRAG's capabilities:
* [Python SDK](https://github.com/langflow-ai/openrag/tree/main/sdks/python)
* [TypeScript/JavaScript SDK](https://github.com/langflow-ai/openrag/tree/main/sdks/typescript)
<!-- TBD: MCP: See https://github.com/langflow-ai/openrag/pull/729 -->
<!-- TBD: API Reference: See https://github.com/langflow-ai/openrag/issues/734 -->

View file

@ -3,127 +3,130 @@ title: Environment variables
slug: /reference/configuration
---
import PartialDockerComposeUp from '@site/docs/_partial-docker-compose-up.mdx';
import Icon from "@site/src/components/icon/icon";
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
OpenRAG's `.env` file is the primary configuration file for OpenRAG.
Environment variables in `.env` always take precedence over other sources.
OpenRAG recognizes environment variables from the following sources:
For deployments managed with the Terminal User Interface (TUI), this file is located at `~/.openrag/tui`, and it can be created automatically during [installation](/install-options).
* [Environment variables](#configure-environment-variables) - Values set in the `.env` file.
* [Langflow runtime overrides](#langflow-runtime-overrides) - Langflow components may tweak environment variables at runtime.
* [Default or fallback values](#default-values-and-fallbacks) - These values are default or fallback values if OpenRAG doesn't find a value.
For [self-managed deployments](/docker), this file can be located at the root of your OpenRAG project directory or referenced from another location.
## Configure environment variables
For an example, see [`.env.example` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/.env.example).
Environment variables are set in a `.env` file in the root of your OpenRAG project directory.
:::tip
OpenRAG's Docker Compose files are populated automatically using values from the `.env` file, so you don't need to edit the Docker Compose files manually.
:::
For an example `.env` file, see [`.env.example` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/.env.example).
If a variable isn't set, OpenRAG uses default or fallback values where available.
Not all variables have default values, and errors can occur if required variables aren't set.
Default values can be found in the reference tables on this page and in [`config_manager.py`](https://github.com/langflow-ai/openrag/blob/main/src/config/config_manager.py), [`settings.py`](https://github.com/langflow-ai/openrag/blob/main/src/config/settings.py), and [`logging_config.py`](https://github.com/langflow-ai/openrag/blob/main/src/utils/logging_config.py).
The Docker Compose files are populated with values from your `.env`, so you don't need to edit the Docker Compose files manually.
You can [temporarily set Langflow variables at runtime](/agents#modify-a-flow-at-runtime).
However, these temporary overrides don't overlap with most OpenRAG environment variables.
The only exceptions are flow-level Langflow settings, such as the language model used in a flow.
Environment variables always take precedence over other variables.
## Edit the `.env` file {#set-environment-variables}
### Set environment variables
During [installation](/install-options), an initial `.env` file is created automatically or manually.
You can edit this file to change OpenRAG configuration settings after installation.
To set environment variables, do the following.
Each OpenRAG environment variable is either mutable or immutable.
This determines the actions you must take to apply changes after editing the `.env` file:
1. Stop OpenRAG.
2. Set the values in the `.env` file:
```bash
LOG_LEVEL=DEBUG
LOG_FORMAT=json
SERVICE_NAME=openrag-dev
```
3. Start OpenRAG.
* **Mutable environment variables**: You can apply changes to mutable environment variables by [stopping and restarting the OpenRAG services](/manage-services) after editing the `.env` file.
Updating provider API keys or provider endpoints in the `.env` file will not take effect after [Application onboarding](/install#application-onboarding). To change these values, you must:
* **Immutable environment variables**: You must [redeploy OpenRAG](/reinstall) with your modified `.env` file if you change immutable environment variables.
1. Stop OpenRAG.
2. Remove the containers:
```
docker-compose down
```
3. Update the values in your `.env` file.
4. Start OpenRAG containers.
```
docker-compose up -d
```
5. Complete [Application onboarding](/install#application-onboarding) again.
## Model provider settings {#model-provider-settings}
## Supported environment variables
Configure which models and providers OpenRAG uses to generate text and embeddings.
You only need to provide credentials for the providers you are using in OpenRAG.
All OpenRAG configuration can be controlled through environment variables.
These variables are initially set during the [application onboarding process](/install#application-onboarding).
Some of these variables are immutable and can only be changed by redeploying OpenRAG, as explained in [Set environment variables](#set-environment-variables).
### AI provider settings
Configure which AI models and providers OpenRAG uses for language processing and embeddings.
For more information, see [Application onboarding](/install#application-onboarding).
| Variable | Default | Description |
|----------|---------|-------------|
| `EMBEDDING_MODEL` | `text-embedding-3-small` | Embedding model for generating vector embeddings for documents in the knowledge base and similarity search queries. Can be changed after the application onboarding process. Accepts one or more models. |
| `LLM_MODEL` | `gpt-4o-mini` | Language model for language processing and text generation in the **Chat** feature. |
| `MODEL_PROVIDER` | `openai` | Model provider, as one of `openai`, `watsonx`, `ollama`, or `anthropic`. |
| `ANTHROPIC_API_KEY` | Not set | API key for the Anthropic language model provider. |
| `OPENAI_API_KEY` | Not set | API key for the OpenAI model provider, which is also the default model provider. |
| `OLLAMA_ENDPOINT` | Not set | Custom provider endpoint for the Ollama model provider. |
| `WATSONX_API_KEY` | Not set | API key for the IBM watsonx.ai model provider. |
| `WATSONX_ENDPOINT` | Not set | Custom provider endpoint for the IBM watsonx.ai model provider. |
| `WATSONX_PROJECT_ID` | Not set | Project ID for the IBM watsonx.ai model provider. |
| `EMBEDDING_MODEL` | `text-embedding-3-small` | Embedding model for vector search. |
| `LLM_MODEL` | `gpt-4o-mini` | Language model for the chat agent. |
| `MODEL_PROVIDER` | `openai` | Model provider, such as OpenAI or IBM watsonx.ai. |
| `OPENAI_API_KEY` | - | Your OpenAI API key. Optional. Can be provided during application onboarding when installing OpenRAG. |
| `PROVIDER_API_KEY` | - | API key for the model provider. |
| `PROVIDER_ENDPOINT` | - | Custom provider endpoint. Only used for IBM or Ollama providers. |
| `PROVIDER_PROJECT_ID` | - | Project ID for providers. Only required for the IBM watsonx.ai provider. |
## Document processing settings {#document-processing-settings}
### Document processing
Control how OpenRAG [processes and ingests documents](/ingestion) into your knowledge base.
Most of these settings can be configured on the OpenRAG **Settings** page or in the `.env` file.
Control how OpenRAG processes and ingests documents into your knowledge base.
For more information, see [Ingestion](/ingestion).
| Variable | Default | Description |
|----------|---------|-------------|
| `CHUNK_OVERLAP` | `200` | Overlap between chunks. |
| `CHUNK_SIZE` | `1000` | Text chunk size for document processing. |
| `DISABLE_INGEST_WITH_LANGFLOW` | `false` | Disable Langflow ingestion pipeline. |
| `DOCLING_OCR_ENGINE` | Set by OS | OCR engine for document processing. For macOS, `ocrmac`. For any other OS, `easyocr`. |
| `DOCLING_SERVE_URL` | `http://**HOST_IP**:5001` | URL for the [Docling Serve instance](/knowledge#select-a-docling-implementation). By default, OpenRAG starts a local `docling serve` process and auto-detects the host. To use your own local or remote Docling Serve instance, set this variable to the full path to the target instance. The service must run on port 5001. |
| `DOCLING_OCR_ENGINE` | - | OCR engine for document processing. |
| `OCR_ENABLED` | `false` | Enable OCR for image processing. |
| `OPENRAG_DOCUMENTS_PATH` | `~/.openrag/documents` | The [local documents path](/knowledge#set-the-local-documents-path) for ingestion. |
| `OPENRAG_DOCUMENTS_PATHS` | `./documents` | Document paths for ingestion. |
| `PICTURE_DESCRIPTIONS_ENABLED` | `false` | Enable picture descriptions. |
## Langflow settings {#langflow-settings}
### Langflow settings
Configure the OpenRAG Langflow server's authentication, contact point, and built-in flow definitions.
:::info
The `LANGFLOW_SUPERUSER_PASSWORD` is set in your `.env` file, and this value determines the default values for several other Langflow authentication variables.
If the `LANGFLOW_SUPERUSER_PASSWORD` variable isn't set, then the Langflow server starts _without_ authentication enabled.
For better security, it is recommended to set `LANGFLOW_SUPERUSER_PASSWORD` so the [Langflow server starts with authentication enabled](https://docs.langflow.org/api-keys-and-authentication#start-a-langflow-server-with-authentication-enabled).
:::
Configure Langflow authentication.
| Variable | Default | Description |
|----------|---------|-------------|
| `LANGFLOW_AUTO_LOGIN` | Determined by `LANGFLOW_SUPERUSER_PASSWORD` | Whether to enable [auto-login mode](https://docs.langflow.org/api-keys-and-authentication#langflow-auto-login) for the Langflow visual editor and CLI. If `LANGFLOW_SUPERUSER_PASSWORD` isn't set, then `LANGFLOW_AUTO_LOGIN` is `True` and auto-login mode is enabled. If `LANGFLOW_SUPERUSER_PASSWORD` is set, then `LANGFLOW_AUTO_LOGIN` is `False` and auto-login mode is disabled. Langflow API calls always require authentication with a Langflow API key regardless of the auto-login setting. |
| `LANGFLOW_ENABLE_SUPERUSER_CLI` | Determined by `LANGFLOW_SUPERUSER_PASSWORD` | Whether to enable the [Langflow CLI `langflow superuser` command](https://docs.langflow.org/api-keys-and-authentication#langflow-enable-superuser-cli). If `LANGFLOW_SUPERUSER_PASSWORD` isn't set, then `LANGFLOW_ENABLE_SUPERUSER_CLI` is `True` and superuser accounts can be created with the Langflow CLI. If `LANGFLOW_SUPERUSER_PASSWORD` is set, then `LANGFLOW_ENABLE_SUPERUSER_CLI` is `False` and the `langflow superuser` command is disabled. |
| `LANGFLOW_NEW_USER_IS_ACTIVE` | Determined by `LANGFLOW_SUPERUSER_PASSWORD` | Whether new [Langflow user accounts are active by default](https://docs.langflow.org/api-keys-and-authentication#langflow-new-user-is-active). If `LANGFLOW_SUPERUSER_PASSWORD` isn't set, then `LANGFLOW_NEW_USER_IS_ACTIVE` is `True` and new user accounts are active by default. If `LANGFLOW_SUPERUSER_PASSWORD` is set, then `LANGFLOW_NEW_USER_IS_ACTIVE` is `False` and new user accounts are inactive by default. |
| `LANGFLOW_PUBLIC_URL` | `http://localhost:7860` | Public URL for the Langflow instance. Forms the base URL for Langflow API calls and other interfaces with your OpenRAG Langflow instance. |
| `LANGFLOW_KEY` | Automatically generated | A Langflow API key to run flows with Langflow API calls. Because Langflow API keys are server-specific, allow OpenRAG to generate this key initially. You can create additional Langflow API keys after deploying OpenRAG. |
| `LANGFLOW_SECRET_KEY` | Automatically generated | Secret encryption key for Langflow internal operations. It is recommended to [generate your own Langflow secret key](https://docs.langflow.org/api-keys-and-authentication#langflow-secret-key) for this variable. If this variable isn't set, then Langflow generates a secret key automatically. |
| `LANGFLOW_SUPERUSER` | `admin` | Username for the Langflow administrator user. |
| `LANGFLOW_SUPERUSER_PASSWORD` | Not set | Langflow administrator password. If this variable isn't set, then the Langflow server starts _without_ authentication enabled. It is recommended to set `LANGFLOW_SUPERUSER_PASSWORD` so the [Langflow server starts with authentication enabled](https://docs.langflow.org/api-keys-and-authentication#start-a-langflow-server-with-authentication-enabled). |
| `LANGFLOW_URL` | `http://localhost:7860` | URL for the Langflow instance. |
| `LANGFLOW_CHAT_FLOW_ID`, `LANGFLOW_INGEST_FLOW_ID`, `NUDGES_FLOW_ID` | Built-in flow IDs | These variables are set automatically to the IDs of the chat, ingestion, and nudges [flows](/agents). The default values are found in [`.env.example`](https://github.com/langflow-ai/openrag/blob/main/.env.example). Only change these values if you want to replace a built-in flow with your own custom flow. The flow JSON must be present in your version of the OpenRAG codebase. For example, if you [deploy self-managed services](/docker), you can add the flow JSON to your local clone of the OpenRAG repository before deploying OpenRAG. |
| `SYSTEM_PROMPT` | `You are a helpful AI assistant with access to a knowledge base. Answer questions based on the provided context.` | System prompt instructions for the agent driving the **Agent** flow (OpenRAG **Chat**). |
| `LANGFLOW_AUTO_LOGIN` | `False` | Enable auto-login for Langflow. |
| `LANGFLOW_CHAT_FLOW_ID` | pre-filled | This value is pre-filled. The default value is found in [.env.example](https://github.com/langflow-ai/openrag/blob/main/.env.example). |
| `LANGFLOW_ENABLE_SUPERUSER_CLI` | `False` | Enable superuser CLI. |
| `LANGFLOW_INGEST_FLOW_ID` | pre-filled | This value is pre-filled. The default value is found in [.env.example](https://github.com/langflow-ai/openrag/blob/main/.env.example). |
| `LANGFLOW_KEY` | auto-generated | Explicit Langflow API key. |
| `LANGFLOW_NEW_USER_IS_ACTIVE` | `False` | New users are active by default. |
| `LANGFLOW_PUBLIC_URL` | `http://localhost:7860` | Public URL for Langflow. |
| `LANGFLOW_SECRET_KEY` | - | Secret key for Langflow internal operations. |
| `LANGFLOW_SUPERUSER` | - | Langflow admin username. Required. |
| `LANGFLOW_SUPERUSER_PASSWORD` | - | Langflow admin password. Required. |
| `LANGFLOW_URL` | `http://localhost:7860` | Langflow URL. |
| `NUDGES_FLOW_ID` | pre-filled | This value is pre-filled. The default value is found in [.env.example](https://github.com/langflow-ai/openrag/blob/main/.env.example). |
| `SYSTEM_PROMPT` | "You are a helpful AI assistant with access to a knowledge base. Answer questions based on the provided context." | System prompt for the Langflow agent. |
## OAuth provider settings
### OAuth provider settings
Configure [OAuth providers](/ingestion#oauth-ingestion) and external service integrations.
Configure OAuth providers and external service integrations.
| Variable | Default | Description |
|----------|---------|-------------|
| `AWS_ACCESS_KEY_ID`<br/>`AWS_SECRET_ACCESS_KEY` | Not set | Enable access to AWS S3 with an [AWS OAuth app](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-applications.html) integration. |
| `GOOGLE_OAUTH_CLIENT_ID`<br/>`GOOGLE_OAUTH_CLIENT_SECRET` | Not set | Enable the [Google OAuth client](https://developers.google.com/identity/protocols/oauth2) integration. You can generate these values in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). |
| `MICROSOFT_GRAPH_OAUTH_CLIENT_ID`<br/>`MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET` | Not set | Enable the [Microsoft Graph OAuth client](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/graph-oauth) integration by providing [Azure application registration credentials for SharePoint and OneDrive](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online). |
| `WEBHOOK_BASE_URL` | Not set | Base URL for OAuth connector webhook endpoints. If this variable isn't set, a default base URL is used. |
| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | - | AWS integrations. |
| `GOOGLE_OAUTH_CLIENT_ID` / `GOOGLE_OAUTH_CLIENT_SECRET` | - | Google OAuth authentication. |
| `MICROSOFT_GRAPH_OAUTH_CLIENT_ID` / `MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET` | - | Microsoft OAuth. |
| `WEBHOOK_BASE_URL` | - | Base URL for webhook endpoints. |
## OpenSearch settings
### OpenSearch settings
Configure OpenSearch database authentication.
| Variable | Default | Description |
|----------|---------|-------------|
| `OPENSEARCH_HOST` | `localhost` | OpenSearch instance host. |
| `OPENSEARCH_PORT` | `9200` | OpenSearch instance port. |
| `OPENSEARCH_USERNAME` | `admin` | OpenSearch administrator username. |
| `OPENSEARCH_PASSWORD` | Must be set at start up | Required. OpenSearch administrator password. Must adhere to the [OpenSearch password complexity requirements](https://docs.opensearch.org/latest/security/configuration/demo-configuration/#setting-up-a-custom-admin-password). You must set this directly in the `.env` or in the TUI's [**Basic/Advanced Setup**](/install#setup). |
| `OPENSEARCH_HOST` | `localhost` | OpenSearch host. |
| `OPENSEARCH_PASSWORD` | - | Password for OpenSearch admin user. Required. |
| `OPENSEARCH_PORT` | `9200` | OpenSearch port. |
| `OPENSEARCH_USERNAME` | `admin` | OpenSearch username. |
## System settings
### System settings
Configure general system components, session management, and logging.
@ -131,10 +134,31 @@ Configure general system components, session management, and logging.
|----------|---------|-------------|
| `LANGFLOW_KEY_RETRIES` | `15` | Number of retries for Langflow key generation. |
| `LANGFLOW_KEY_RETRY_DELAY` | `2.0` | Delay between retries in seconds. |
| `LANGFLOW_VERSION` | `OPENRAG_VERSION` | Langflow Docker image version. By default, OpenRAG uses the `OPENRAG_VERSION` for the Langflow Docker image version. |
| `LOG_FORMAT` | Not set | Set to `json` to enabled JSON-formatted log output. If this variable isn't set, then the default logging format is used. |
| `LOG_LEVEL` | `INFO` | Logging level. Can be one of `DEBUG`, `INFO`, `WARNING`, or `ERROR`. `DEBUG` provides the most detailed logs but can impact performance. |
| `MAX_WORKERS` | `1` | Maximum number of workers for document processing. |
| `OPENRAG_VERSION` | `latest` | The version of the OpenRAG Docker images to run. For more information, see [Upgrade OpenRAG](/upgrade) |
| `LANGFLOW_VERSION` | `latest` | Langflow Docker image version. |
| `LOG_FORMAT` | - | Log format (set to "json" for JSON output). |
| `LOG_LEVEL` | `INFO` | Logging level (DEBUG, INFO, WARNING, ERROR). |
| `MAX_WORKERS` | - | Maximum number of workers for document processing. |
| `OPENRAG_VERSION` | `latest` | OpenRAG Docker image version. |
| `SERVICE_NAME` | `openrag` | Service name for logging. |
| `SESSION_SECRET` | Automatically generated | Session management. |
| `SESSION_SECRET` | auto-generated | Session management. |
## Langflow runtime overrides
Langflow runtime overrides allow you to modify component settings at runtime without changing the base configuration.
Runtime overrides are implemented through **tweaks** - parameter modifications that are passed to specific Langflow components during flow execution.
For more information on tweaks, see [Input schema (tweaks)](https://docs.langflow.org/concepts-publish#input-schema).
## Default values and fallbacks
When no environment variables or configuration file values are provided, OpenRAG uses default values.
These values can be found in the code base at the following locations.
### OpenRAG configuration defaults
These values are defined in [`config_manager.py` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/src/config/config_manager.py).
### System configuration defaults
These fallback values are defined in [`settings.py` in the OpenRAG repository](https://github.com/langflow-ai/openrag/blob/main/src/config/settings.py).

View file

@ -1,155 +0,0 @@
---
title: Contribute to OpenRAG
slug: /support/contribute
---
There are several ways you can interact with the OpenRAG community and contribute to the OpenRAG codebase.
## Star OpenRAG on GitHub
If you like OpenRAG, you can star the [OpenRAG GitHub repository](https://github.com/langflow-ai/openrag).
Stars help other users find OpenRAG more easily, and quickly understand that other users have found it useful.
Because OpenRAG is open-source, the more visible the repository is, the more likely the codebase is to attract contributors.
## Watch the GitHub repository
You can watch the [OpenRAG GitHub repository](https://github.com/langflow-ai/openrag) to get notified about new releases and other repository activity.
To get release notifications only, select **Releases only**.
If you select **Watching**, you will receive notifications about new releases as well as issues, discussions, and pull requests. For information about customizing repository notifications, see the [GitHub documentation on repository subscriptions](https://docs.github.com/en/subscriptions-and-notifications/how-tos/managing-subscriptions-for-activity-on-github/viewing-your-subscriptions).
## Request enhancements and get help through GitHub
You can report bugs, submit feature requests, and get help with OpenRAG through the GitHub repository.
The repository is the best place to report bugs and request enhancements to ensure that they are tracked by OpenRAG maintainers.
### GitHub issues
The [Issues page in the OpenRAG repository](https://github.com/langflow-ai/openrag/issues) is actively updated with bugs and feature requests.
:::tip
The best way to promote a request or bug is to comment on an existing issue that matches your request.
Before you report a bug or submit a feature request, search for existing similar issues.
If you find one, add a comment with any relevant details instead of opening a new issue.
Highly active issues are more likely to receive attention from contributors.
:::
Feature planning for OpenRAG is tracked through the [Projects page in the OpenRAG repository](https://github.com/langflow-ai/openrag/projects).
### GitHub discussions
If you need help with your code or OpenRAG in general, you can visit the [OpenRAG GitHub Discussions page](https://github.com/langflow-ai/openrag/discussions).
The OpenRAG team doesn't provide individual support over email, and the team believes that public discussions help more users by virtue of their discoverability.
## Community guidelines and tips
Because the OpenRAG repository is public, the OpenRAG team asks that you follow these guidelines when submitting questions and issues:
* **Provide as many details as possible**: Simply stating that a feature doesn't work isn't helpful. The OpenRAG team needs details in order to recreate and find the issue.
* **Explain what exactly went wrong**: Include error messages and descriptions of _how_ your code failed, not just the fact that it failed.
* **Retrace your steps**: Explain what happened before the error, what you expected to happen instead of the error, and any recent changes you made, such as upgrading OpenRAG or a dependency.
* **Describe your environment**: Include your operating system, OpenRAG version, Python version, and any other environment-related details that could have contributed to the issue.
* **Include snippets of the code that failed**: Be sure to omit any sensitive values, and only provide parts that are relevant to the failure rather than the entire script. Providing code snippets makes it much easier to reproduce errors, troubleshoot, and provide specific advice.
* If your submission includes long sections of code, logs, or tracebacks, wrap them in [details tags](https://developer.mozilla.org/en/docs/Web/HTML/Element/details) (`<details> PASTE CODE HERE </details>`) to collapse the content and make it easier to read your submission.
* **Omit sensitive information**: Other than the information available on your public GitHub profile, don't include sensitive or personally identifying data, such as security keys, full names, personal identification numbers, addresses, and phone numbers.
* **Be kind**: Although bugs can be frustrating with any software, remember that your messages are read by real people who want to help. While you don't have to be saccharine, there's no need to be rude to get support.
* Your issues and discussions are attached to your GitHub account, and they can be read by anyone on the internet, including current and potential employers and colleagues.
* The OpenRAG repository is a public GitHub repository and, therefore, subject to the [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-community-code-of-conduct).
## Contribute to the codebase
If you want to contribute code to OpenRAG, you can do so by submitting a pull request (PR) to the OpenRAG GitHub repository.
See [CONTRIBUTING.md](https://github.com/langflow-ai/openrag/blob/main/CONTRIBUTING.md) to set up your development environment and learn about the contribution process.
### Tips for successful submissions
* Explain the motivation for your submission in the PR description.
Clarify how the change benefits the OpenRAG codebase and its users.
* Keep PRs small and focused on a single change or set of related changes.
* If applicable, include tests that verify your changes.
* Add documentation for new features, or edit existing documentation (if needed) when modifying existing code.
For more information, see [Contribute documentation](#contribute-documentation).
### Use of AI tools in contributions
If you use AI tools to generate significant portions of the code in your PR, the OpenRAG team asks that you do the following:
* Consider disclosing significant use of AI tools in your pull request description, particularly if you are unable to expertly review your own code contributions. For example: `I used an AI tool to generate the code for <function>, but I am not an expert in <language>. There might be some inefficiencies or antipatterns present.`
* Avoid using AI tools to generate large volumes of code if you don't have personal knowledge of that language and the functionality being implemented. Instead, consider submitting a feature request to the [Issues page in the OpenRAG repository](https://github.com/langflow-ai/openrag/issues).
* Be critical when reviewing code or documentation generated by AI tools to ensure it is accurate, efficient, and avoids antipatterns and vulnerabilities.
* Don't flood the repository with AI-generated pull requests.
Low quality and spam contributions can be closed without review at the discretion of the maintainers.
Repeated low-quality contributions can lead to a ban on contributions.
## Contribute documentation {#contribute-documentation}
The OpenRAG documentation is built using [Docusaurus](https://docusaurus.io/) and written in [Markdown](https://docusaurus.io/docs/markdown-features).
For style guidance, see the [Google Developer Documentation Style Guide](https://developers.google.com/style).
1. Install [Node.js](https://nodejs.org/en/download/package-manager).
2. Fork the [OpenRAG GitHub repository](https://github.com/langflow-ai/openrag).
3. Add the new remote to your local repository on your local machine:
```bash
git remote add FORK_NAME https://github.com/GIT_USERNAME/openrag.git
```
Replace the following:
* `FORK_NAME`: A name for your fork of the repository
* `GIT_USERNAME`: Your Git username
4. Change to the `/docs` directory in your local repository:
```bash
cd openrag/docs
```
If you're running a development container for code contributions, run the documentation build from outside the container on your host terminal.
The documentation build might not work properly when run from inside the development container workspace.
5. Install dependencies and start a local Docusaurus static site with hot reload:
```bash
npm install
npm start
```
The documentation is served at `http://localhost:3000`.
6. To edit and create content, work with the `.mdx` files in the `openrag/docs/docs` directory.
Create new files in `.mdx` format.
Navigation is defined in `openrag/docs/sidebars.js`.
Most pages use a `slug` for shorthand cross-referencing, rather than supplying the full or relative directory path.
For example, if a page has a `slug` of `/cool-page`, you can link to it with `[Cool page](/cool-page)` from any other `/docs` page.
7. Recommended: After making some changes, run `npm run build` to build the site locally with more robust logging.
This can help you find broken links before creating a PR.
8. Create a pull request against the `main` branch of the OpenRAG repository with a clear title and description of your changes:
* Provide a clear title in the format of `Docs: <summary of change>`. For example, `Docs: fix broken link on contributing page`. Pull request titles appear in OpenRAG's release notes, so they should explain what the PR does as explicitly as possible.
* Explain why and how you made the changes in the pull request description.
* If the pull request closes an issue, include `Closes #NUMBER` in the description, such as `Closes #1234`.
* If you used AI tools to write significant portions of the documentation, consider disclosing this in the PR description.
9. Add the `documentation` label to your pull request.
10. Keep an eye on your pull request in case an OpenRAG maintainer requests changes or asks questions.
OpenRAG technical writers can directly edit documentation PRs to enforce style guidelines and fix errors.

View file

@ -1,23 +1,19 @@
---
title: Troubleshoot OpenRAG
title: Troubleshooting
slug: /support/troubleshoot
---
import PartialOllamaModels from '@site/docs/_partial-ollama-models.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
This page provides troubleshooting advice for issues you might encounter when using OpenRAG or contributing to OpenRAG.
## Installation and start up issues
## OpenSearch fails to start
The following issues relate to OpenRAG installation and start up.
Check that `OPENSEARCH_PASSWORD` set in [Environment variables](/reference/configuration) meets requirements.
The password must contain at least 8 characters, and must contain at least one uppercase letter, one lowercase letter, one digit, and one special character that is strong.
### OpenSearch fails to start
Check that the value of the `OPENSEARCH_PASSWORD` [environment variable](/reference/configuration) meets the [OpenSearch password complexity requirements](https://docs.opensearch.org/latest/security/configuration/demo-configuration/#setting-up-a-custom-admin-password).
If you need to change the password, you must [reset the OpenRAG services](/manage-services).
### OpenRAG fails to start from the TUI with operation not supported
## OpenRAG fails to start from the TUI with "Operation not supported" error
This error occurs when starting OpenRAG with the TUI in [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install).
@ -25,138 +21,132 @@ The error occurs because OpenRAG is running within a WSL environment, so `webbro
To access the OpenRAG application, open a web browser and enter `http://localhost:3000` in the address bar.
### OpenRAG installation fails with unable to get local issuer certificate
If you are installing OpenRAG on macOS, and the installation fails with `unable to get local issuer certificate`, run the following command, and then retry the installation:
```bash
open "/Applications/Python VERSION/Install Certificates.command"
```
Replace `VERSION` with your installed Python version, such as `3.13`.
### Application onboarding gets stuck on Google Chrome
If the OpenRAG onboarding process gets stuck when using Google Chrome, try clearing your browser's cache.
## Langflow connection issues
Verify that the value of the `LANGFLOW_SUPERUSER` environment variable is correct.
For more information about this variable and how this variable controls Langflow access, see [Langflow settings](/reference/configuration#langflow-settings).
Verify the `LANGFLOW_SUPERUSER` credentials set in [Environment variables](/reference/configuration) are correct.
## Container out of memory errors {#container-out-of-memory-errors}
## Memory errors
Increase your container VM's allocated memory, or use a CPU-only deployment to reduce memory usage.
### Container out of memory errors
For TUI-managed deployments, you can enable **CPU mode** on the TUI's **Status** page.
Increase Docker memory allocation or use [docker-compose-cpu.yml](https://github.com/langflow-ai/openrag/blob/main/docker-compose-cpu.yml) to deploy OpenRAG.
For self-managed deployments, CPU-only deployments use the `docker-compose.yml` file that doesn't have GPU overrides.
## Memory issue with Podman on macOS {#memory-issue-with-podman-on-macos}
If you're using Podman on macOS, you might need to increase VM memory on your Podman machine.
This example increases the machine size to 8 GB of RAM, which is the minimum recommended RAM for OpenRAG:
```bash
podman machine stop
podman machine rm
podman machine init --memory 8192 # 8 GB example
podman machine start
```
### Podman on macOS memory issues
If you're using Podman on macOS, you may need to increase VM memory on your Podman machine.
This example increases the machine size to 8 GB of RAM, which should be sufficient to run OpenRAG.
```bash
podman machine stop
podman machine rm
podman machine init --memory 8192 # 8 GB example
podman machine start
```
## Port conflicts
With the default [environment variable](/reference/configuration) values, OpenRAG requires the following ports to be available on the host machine:
Ensure ports 3000, 7860, 8000, 9200, 5601 are available.
* 3000: Langflow application
* 5001: Docling local ingestion service
* 5601: OpenSearch Dashboards
* 7860: Docling UI
* 8000: Docling API
* 9200: OpenSearch service
## OCR ingestion fails (easyocr not installed)
## OCR ingestion fails (easyocr not installed) {#ocr-ingestion-fails-easyocr-not-installed}
If Docling ingestion fails with an OCR-related error and mentions `easyocr` is missing, this is likely due to a stale `uv` cache.
Docling ingestion can fail with an OCR-related error that mentions `easyocr` is missing.
This is likely due to a stale `uv` cache when you [install OpenRAG with `uvx`](/install-uvx).
`easyocr` is already included as a dependency in OpenRAG's `pyproject.toml`. Project-managed installations using `uv sync` and `uv run` always sync dependencies directly from your `pyproject.toml`, so they should have `easyocr` installed.
When you invoke OpenRAG with `uvx openrag`, `uvx` creates a cached, ephemeral environment that doesn't modify your project.
The location and path of this cache depends on your operating system.
For example, on macOS, this is typically a user cache directory, such as `~/.cache/uv`.
If you're running OpenRAG with `uvx openrag`, `uvx` creates a cached, ephemeral environment that doesn't modify your project. This cache may become stale.
This cache can become stale, producing errors like missing dependencies.
On macOS, this cache directory is typically a user cache directory such as `/Users/USER_NAME/.cache/uv`.
1. To clear the uv cache, run:
```bash
uv cache clean
```
2. Start OpenRAG:
```bash
uvx openrag
```
1. If the TUI is open, press <kbd>q</kbd> to exit the TUI.
If you do not need OCR, you can disable OCR-based processing in your ingestion settings to avoid requiring `easyocr`.
2. Clear the `uv` cache:
## Langflow container already exists {#langflow-container-already-exists-during-upgrade}
```bash
uv cache clean
```
If you encounter a `langflow container already exists` error when upgrading OpenRAG, this typically means you upgraded OpenRAG with `uv`, but didn't remove or upgrade containers from a previous installation.
To clear the OpenRAG cache only, run:
1. Remove only the problematic Langflow container:
```bash
uv cache clean openrag
```
<Tabs groupId="Container software">
<TabItem value="Podman" label="Podman">
```bash
# Stop the langflow container
podman stop langflow
# Remove the langflow container
podman rm langflow --force
```
</TabItem>
<TabItem value="Docker" label="Docker" default>
```bash
# Stop the langflow container
docker stop langflow
# Remove the langflow container
docker rm langflow --force
```
</TabItem>
</Tabs>
3. Invoke OpenRAG to restart the TUI:
2. After removing the container, retry the upgrade in the OpenRAG TUI by clicking **Status** > **Upgrade**.
```bash
uvx openrag
```
### Reinstall all containers
4. Click **Launch OpenRAG**, and then retry document ingestion.
If reinstalling the Langflow container doesn't resolve the issue, or if you want a completely fresh installation, remove all OpenRAG containers and data, and then retry the upgrade.
:::warning Data loss
The complete reset removes all your data, including OpenSearch data, uploaded documents, and authentication. Your `.env` file is preserved, so your configuration settings remain intact.
:::
If you install OpenRAG with `uv`, dependencies are synced directly from your `pyproject.toml` file.
This should automatically install `easyocr` because `easyocr` is included as a dependency in OpenRAG's `pyproject.toml`.
1. Stop your containers and completely remove them.
If you don't need OCR, you can disable OCR-based processing in your [ingestion settings](/knowledge#knowledge-ingestion-settings) to avoid requiring `easyocr`.
<Tabs groupId="Container software">
<TabItem value="Podman" label="Podman">
```bash
# Stop all running containers
podman stop --all
# Remove all containers (including stopped ones)
podman rm --all --force
# Remove all images
podman rmi --all --force
# Remove all volumes
podman volume prune --force
# Remove all networks (except default)
podman network prune --force
# Clean up any leftover data
podman system prune --all --force --volumes
```
</TabItem>
<TabItem value="Docker" label="Docker" default>
```bash
# Stop all running containers
docker stop $(docker ps -q)
# Remove all containers (including stopped ones)
docker rm --force $(docker ps -aq)
# Remove all images
docker rmi --force $(docker images -q)
# Remove all volumes
docker volume prune --force
# Remove all networks (except default)
docker network prune --force
# Clean up any leftover data
docker system prune --all --force --volumes
```
</TabItem>
</Tabs>
## Upgrade fails due to Langflow container already exists {#langflow-container-already-exists-during-upgrade}
If you encounter a `langflow container already exists` error when upgrading OpenRAG, this typically means you upgraded OpenRAG with `uv`, but you didn't remove or upgrade containers from a previous installation.
To resolve this issue, do the following:
1. Remove only the Langflow container:
1. Stop the Langflow container:
```bash title="Docker"
docker stop langflow
```
```bash title="Podman"
podman stop langflow
```
2. Remove the Langflow container:
```bash title="Docker"
docker rm langflow --force
```
```bash title="Podman"
podman rm langflow --force
```
2. Retry the [upgrade](/upgrade).
3. If reinstalling the Langflow container doesn't resolve the issue, then you must [reset all containers](/manage-services) or [reinstall OpenRAG](/reinstall).
4. Retry the [upgrade](/upgrade).
If no updates are available after reinstalling OpenRAG, then you reinstalled at the latest version, and your deployment is up to date.
## Document ingestion or similarity search issues
See [Troubleshoot ingestion](/ingestion#troubleshoot-ingestion).
## Ollama model issues
<PartialOllamaModels />
## Chat issues
See [Troubleshoot chat](/chat#troubleshoot-chat).
2. After removing the containers, retry the upgrade in the OpenRAG TUI by clicking **Status** > **Upgrade**.

View file

@ -8,113 +8,12 @@ import {themes as prismThemes} from 'prism-react-renderer';
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
const isProduction = process.env.NODE_ENV === 'production';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'OpenRAG',
tagline: 'Open Source RAG Platform',
favicon: 'img/favicon.ico',
headTags: [
...(isProduction
? [
// Google Consent Mode - Set defaults before Google tags load
{
tagName: "script",
attributes: {},
innerHTML: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent to denied
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
`,
},
// TrustArc Consent Update Listener
{
tagName: "script",
attributes: {},
innerHTML: `
(function() {
function updateGoogleConsent() {
if (typeof window.truste !== 'undefined' && window.truste.cma) {
var consent = window.truste.cma.callApi('getConsent', window.location.href) || {};
// Map TrustArc categories to Google consent types
// Category 0 = Required, 1 = Functional, 2 = Advertising, 3 = Analytics
var hasAdvertising = consent[2] === 1;
var hasAnalytics = consent[3] === 1;
gtag('consent', 'update', {
'ad_storage': hasAdvertising ? 'granted' : 'denied',
'ad_user_data': hasAdvertising ? 'granted' : 'denied',
'ad_personalization': hasAdvertising ? 'granted' : 'denied',
'analytics_storage': hasAnalytics ? 'granted' : 'denied'
});
}
}
// Listen for consent changes
if (window.addEventListener) {
window.addEventListener('cm_data_subject_consent_changed', updateGoogleConsent);
window.addEventListener('cm_consent_preferences_set', updateGoogleConsent);
}
// Initial check after TrustArc loads
if (document.readyState === 'complete') {
updateGoogleConsent();
} else {
window.addEventListener('load', updateGoogleConsent);
}
})();
`,
},
// IBM Analytics Configuration (required for TrustArc)
{
tagName: "script",
attributes: {},
innerHTML: `
window._ibmAnalytics = {
"settings": {
"name": "DataStax",
"tealiumProfileName": "ibm-subsidiary",
},
"trustarc": {
"privacyPolicyLink": "https://ibm.com/privacy"
}
};
window.digitalData = {
"page": {
"pageInfo": {
"ibm": {
"siteId": "IBM_DataStax",
}
},
"category": {
"primaryCategory": "PC230"
}
}
};
`,
},
// IBM Common Stats Script - loads TrustArc
{
tagName: "script",
attributes: {
src: "//1.www.s81c.com/common/stats/ibm-common.js",
async: "true",
},
},
]
: []),
],
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
future: {
v4: true, // Improve compatibility with the upcoming Docusaurus v4
@ -127,7 +26,7 @@ const config = {
baseUrl: process.env.BASE_URL ? process.env.BASE_URL : '/',
// Control search engine indexing - set to true to prevent indexing
noIndex: false,
noIndex: true,
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
@ -176,19 +75,6 @@ const config = {
theme: {
customCss: './src/css/custom.css',
},
// Use preset-classic sitemap https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-sitemap
sitemap: {
lastmod: 'date',
changefreq: 'weekly',
priority: 0.5,
ignorePatterns: ['/tags/**'],
filename: 'sitemap.xml',
createSitemapItems: async (params) => {
const {defaultCreateSitemapItems, ...rest} = params;
const items = await defaultCreateSitemapItems(rest);
return items.filter((item) => !item.url.includes('/page/'));
},
},
}),
],
],
@ -229,26 +115,15 @@ const config = {
{
html: `<div class="footer-links">
<span>© ${new Date().getFullYear()} OpenRAG</span>
<span id="preferenceCenterContainer"> ·&nbsp; <a href="#" onclick="if(typeof window !== 'undefined' && window.truste && window.truste.eu && window.truste.eu.clickListener) { window.truste.eu.clickListener(); } return false;" style="cursor: pointer;">Manage Privacy Choices</a></span>
</div>`,
},
],
},
],
},
algolia: {
appId: "SMEA51Q5OL",
// public key, safe to commit
apiKey: "b2ec302e9880e8979ad6a68f0c36271e",
indexName: "openrag-algolia",
contextualSearch: true,
searchParameters: {},
searchPagePath: "search",
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['bash', 'docker', 'yaml'],
},
mermaid: {
theme: {light: 'neutral', dark: 'forest'},

1620
docs/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"build:pdf": "rm -f ../openrag-documents/openrag-documentation.pdf && npm run build && npm run serve & sleep 10 && npx docusaurus-to-pdf && pkill -f 'docusaurus serve'",
"build:pdf": "rm -f ../documents/openrag-documentation.pdf && npm run build && npm run serve & sleep 10 && npx docusaurus-to-pdf && pkill -f 'docusaurus serve'",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
@ -22,7 +22,7 @@
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"docusaurus-plugin-image-zoom": "^3.0.1",
"lucide-react": "^0.555.0",
"lucide-react": "^0.544.0",
"prism-react-renderer": "^2.3.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
@ -31,7 +31,7 @@
"@docusaurus/module-type-aliases": "3.9.2",
"@docusaurus/tsconfig": "3.9.2",
"@docusaurus/types": "3.9.2",
"typescript": "~5.9.3"
"typescript": "~5.6.2"
},
"browserslist": {
"production": [
@ -46,6 +46,6 @@
]
},
"engines": {
"node": ">=20.20.0"
"node": ">=18.0"
}
}

View file

@ -1,7 +1,7 @@
{
"baseUrl": "http://localhost:3000",
"entryPoint": "http://localhost:3000",
"outputDir": "../openrag-documents/openrag-documentation.pdf",
"outputDir": "../documents/openrag-documentation.pdf",
"customStyles": "table { max-width: 3500px !important; } .navbar, .footer, .breadcrumbs { display: none !important; }",
"forceImages": true
}

View file

@ -22,71 +22,13 @@ const sidebars = {
label: "About OpenRAG"
},
"get-started/quickstart",
{
type: "category",
label: "Installation",
items: [
"get-started/install-options",
{ type: "doc",
id: "get-started/install",
label: "Run the installer script",
},
{ type: "doc",
id: "get-started/install-uv",
label: "Install OpenRAG with uv",
},
"get-started/install-uvx",
{ type: "doc",
id: "get-started/install-windows",
label: "Install OpenRAG on Windows",
},
{ type: "doc",
id: "get-started/docker",
label: "Deploy self-managed services",
},
"get-started/upgrade",
"get-started/reinstall",
"get-started/uninstall",
],
},
"get-started/tui",
{
type: "doc",
id: "get-started/manage-services",
label: "Manage services",
},
{
type: "doc",
id: "core-components/agents",
label: "Flows",
},
{
type: "category",
label: "Knowledge",
items: [
"core-components/knowledge",
"core-components/ingestion",
"core-components/knowledge-filters",
],
},
{
type: "doc",
id: "core-components/chat",
label: "Chat",
},
"get-started/install",
"get-started/docker",
"core-components/agents",
"core-components/knowledge",
"core-components/ingestion",
"reference/configuration",
{
type: "doc",
id: "reference/api-sdk-overview",
label: "APIs and SDKs",
},
"support/contribute",
"support/troubleshoot",
{
type: "link",
label: "Changelog",
href: "https://github.com/langflow-ai/openrag/releases",
},
],
};

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View file

@ -1,8 +1,12 @@
# Robots.txt for OpenRAG Documentation
# Allow all crawlers
# Block all crawlers by default
User-agent: *
Allow: /
Disallow: /
# Sitemap location
Sitemap: https://docs.openr.ag/sitemap.xml
# Allow specific crawlers if needed (uncomment when ready for launch)
# User-agent: Googlebot
# Allow: /
# Sitemap location (uncomment when ready for launch)
# Sitemap: https://docs.openr.ag/sitemap.xml

9950
docs/yarn.lock Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,364 +1,364 @@
"use client";
import { Cloud, FolderOpen, Loader2, Upload } from "lucide-react";
import { useEffect, useState } from "react";
import { ProtectedRoute } from "@/components/protected-route";
import { useState, useEffect } from "react";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Upload, FolderOpen, Loader2, Cloud } from "lucide-react";
import { ProtectedRoute } from "@/components/protected-route";
import { useTask } from "@/contexts/task-context";
function AdminPage() {
console.log("AdminPage component rendered!");
const [fileUploadLoading, setFileUploadLoading] = useState(false);
const [pathUploadLoading, setPathUploadLoading] = useState(false);
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [folderPath, setFolderPath] = useState("/app/openrag-documents/");
const [bucketUploadLoading, setBucketUploadLoading] = useState(false);
const [bucketUrl, setBucketUrl] = useState("s3://");
const [uploadStatus, setUploadStatus] = useState<string>("");
const [awsEnabled, setAwsEnabled] = useState(false);
const { addTask } = useTask();
console.log("AdminPage component rendered!");
const [fileUploadLoading, setFileUploadLoading] = useState(false);
const [pathUploadLoading, setPathUploadLoading] = useState(false);
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [folderPath, setFolderPath] = useState("/app/documents/");
const [bucketUploadLoading, setBucketUploadLoading] = useState(false);
const [bucketUrl, setBucketUrl] = useState("s3://");
const [uploadStatus, setUploadStatus] = useState<string>("");
const [awsEnabled, setAwsEnabled] = useState(false);
const { addTask } = useTask();
useEffect(() => {
console.log("AdminPage useEffect running - checking AWS availability");
const checkAws = async () => {
try {
console.log("Making request to /api/upload_options");
const res = await fetch("/api/upload_options");
console.log("Response status:", res.status, "OK:", res.ok);
if (res.ok) {
const data = await res.json();
console.log("Response data:", data);
setAwsEnabled(Boolean(data.aws));
}
} catch (err) {
console.error("Failed to check AWS availability", err);
}
};
checkAws();
}, []);
useEffect(() => {
console.log("AdminPage useEffect running - checking AWS availability");
const checkAws = async () => {
try {
console.log("Making request to /api/upload_options");
const res = await fetch("/api/upload_options");
console.log("Response status:", res.status, "OK:", res.ok);
if (res.ok) {
const data = await res.json();
console.log("Response data:", data);
setAwsEnabled(Boolean(data.aws));
}
} catch (err) {
console.error("Failed to check AWS availability", err);
}
};
checkAws();
}, []);
const handleFileUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!selectedFile) return;
const handleFileUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!selectedFile) return;
setFileUploadLoading(true);
setUploadStatus("");
setFileUploadLoading(true);
setUploadStatus("");
try {
const formData = new FormData();
formData.append("file", selectedFile);
try {
const formData = new FormData();
formData.append("file", selectedFile);
const response = await fetch("/api/router/upload_ingest", {
method: "POST",
body: formData,
});
const response = await fetch("/api/router/upload_ingest", {
method: "POST",
body: formData,
});
const result = await response.json();
const result = await response.json();
if (response.ok) {
setUploadStatus(`File uploaded successfully! ID: ${result.id}`);
setSelectedFile(null);
// Reset the file input
const fileInput = document.getElementById(
"file-input",
) as HTMLInputElement;
if (fileInput) fileInput.value = "";
} else {
setUploadStatus(`Error: ${result.error || "Upload failed"}`);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Upload failed"}`,
);
} finally {
setFileUploadLoading(false);
}
};
if (response.ok) {
setUploadStatus(`File uploaded successfully! ID: ${result.id}`);
setSelectedFile(null);
// Reset the file input
const fileInput = document.getElementById(
"file-input",
) as HTMLInputElement;
if (fileInput) fileInput.value = "";
} else {
setUploadStatus(`Error: ${result.error || "Upload failed"}`);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Upload failed"}`,
);
} finally {
setFileUploadLoading(false);
}
};
const handleBucketUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!bucketUrl.trim()) return;
const handleBucketUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!bucketUrl.trim()) return;
setBucketUploadLoading(true);
setUploadStatus("");
setBucketUploadLoading(true);
setUploadStatus("");
try {
const response = await fetch("/api/upload_bucket", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ s3_url: bucketUrl }),
});
try {
const response = await fetch("/api/upload_bucket", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ s3_url: bucketUrl }),
});
const result = await response.json();
const result = await response.json();
if (response.status === 201) {
const taskId = result.task_id || result.id;
const totalFiles = result.total_files || 0;
if (response.status === 201) {
const taskId = result.task_id || result.id;
const totalFiles = result.total_files || 0;
if (!taskId) {
throw new Error("No task ID received from server");
}
if (!taskId) {
throw new Error("No task ID received from server");
}
addTask(taskId);
setUploadStatus(
`🔄 Processing started for ${totalFiles} files. Check the task notification panel for real-time progress. (Task ID: ${taskId})`,
);
setBucketUrl("");
} else {
setUploadStatus(`Error: ${result.error || "Bucket processing failed"}`);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Bucket processing failed"}`,
);
} finally {
setBucketUploadLoading(false);
}
};
addTask(taskId);
setUploadStatus(
`🔄 Processing started for ${totalFiles} files. Check the task notification panel for real-time progress. (Task ID: ${taskId})`,
);
setBucketUrl("");
} else {
setUploadStatus(`Error: ${result.error || "Bucket processing failed"}`);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Bucket processing failed"}`,
);
} finally {
setBucketUploadLoading(false);
}
};
const handlePathUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!folderPath.trim()) return;
const handlePathUpload = async (e: React.FormEvent) => {
e.preventDefault();
if (!folderPath.trim()) return;
setPathUploadLoading(true);
setUploadStatus("");
setPathUploadLoading(true);
setUploadStatus("");
try {
const response = await fetch("/api/upload_path", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ path: folderPath }),
});
try {
const response = await fetch("/api/upload_path", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ path: folderPath }),
});
const result = await response.json();
const result = await response.json();
if (response.status === 201) {
// New flow: Got task ID, use centralized tracking
const taskId = result.task_id || result.id;
const totalFiles = result.total_files || 0;
if (response.status === 201) {
// New flow: Got task ID, use centralized tracking
const taskId = result.task_id || result.id;
const totalFiles = result.total_files || 0;
if (!taskId) {
throw new Error("No task ID received from server");
}
if (!taskId) {
throw new Error("No task ID received from server");
}
// Add task to centralized tracking
addTask(taskId);
// Add task to centralized tracking
addTask(taskId);
setUploadStatus(
`🔄 Processing started for ${totalFiles} files. Check the task notification panel for real-time progress. (Task ID: ${taskId})`,
);
setFolderPath("");
setPathUploadLoading(false);
} else if (response.ok) {
// Original flow: Direct response with results
const successful =
result.results?.filter(
(r: { status: string }) => r.status === "indexed",
).length || 0;
const total = result.results?.length || 0;
setUploadStatus(
`Path processed successfully! ${successful}/${total} files indexed.`,
);
setFolderPath("");
setPathUploadLoading(false);
} else {
setUploadStatus(`Error: ${result.error || "Path upload failed"}`);
setPathUploadLoading(false);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Path upload failed"}`,
);
setPathUploadLoading(false);
}
};
setUploadStatus(
`🔄 Processing started for ${totalFiles} files. Check the task notification panel for real-time progress. (Task ID: ${taskId})`,
);
setFolderPath("");
setPathUploadLoading(false);
} else if (response.ok) {
// Original flow: Direct response with results
const successful =
result.results?.filter(
(r: { status: string }) => r.status === "indexed",
).length || 0;
const total = result.results?.length || 0;
setUploadStatus(
`Path processed successfully! ${successful}/${total} files indexed.`,
);
setFolderPath("");
setPathUploadLoading(false);
} else {
setUploadStatus(`Error: ${result.error || "Path upload failed"}`);
setPathUploadLoading(false);
}
} catch (error) {
setUploadStatus(
`Error: ${error instanceof Error ? error.message : "Path upload failed"}`,
);
setPathUploadLoading(false);
}
};
// Remove the old pollPathTaskStatus function since we're using centralized system
// Remove the old pollPathTaskStatus function since we're using centralized system
return (
<div className="space-y-8">
<div>
<h1 className="text-3xl font-bold">Ingest</h1>
<p className="text-muted-foreground">
Upload and manage documents in your database
</p>
</div>
return (
<div className="space-y-8">
<div>
<h1 className="text-3xl font-bold">Ingest</h1>
<p className="text-muted-foreground">
Upload and manage documents in your database
</p>
</div>
{uploadStatus && (
<Card
className={
uploadStatus.includes("Error")
? "border-destructive"
: "border-green-500"
}
>
<CardContent className="pt-6">
<p
className={
uploadStatus.includes("Error")
? "text-destructive"
: "text-green-600"
}
>
{uploadStatus}
</p>
</CardContent>
</Card>
)}
{uploadStatus && (
<Card
className={
uploadStatus.includes("Error")
? "border-destructive"
: "border-green-500"
}
>
<CardContent className="pt-6">
<p
className={
uploadStatus.includes("Error")
? "text-destructive"
: "text-green-600"
}
>
{uploadStatus}
</p>
</CardContent>
</Card>
)}
<div className="grid gap-6 md:grid-cols-3">
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Upload className="h-5 w-5" />
Upload File
</CardTitle>
<CardDescription>
Upload a single document to be indexed and searchable
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleFileUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="file-input">Select File</Label>
<Input
id="file-input"
type="file"
onChange={(e) => setSelectedFile(e.target.files?.[0] || null)}
accept=".pdf,.doc,.docx,.txt,.md"
className="cursor-pointer"
/>
</div>
<Button
type="submit"
disabled={!selectedFile || fileUploadLoading}
className="w-full"
>
{fileUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Uploading...
</>
) : (
<>
<Upload className="mr-2 h-4 w-4" />
Upload File
</>
)}
</Button>
</form>
</CardContent>
</Card>
<div className="grid gap-6 md:grid-cols-3">
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Upload className="h-5 w-5" />
Upload File
</CardTitle>
<CardDescription>
Upload a single document to be indexed and searchable
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleFileUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="file-input">Select File</Label>
<Input
id="file-input"
type="file"
onChange={(e) => setSelectedFile(e.target.files?.[0] || null)}
accept=".pdf,.doc,.docx,.txt,.md"
className="cursor-pointer"
/>
</div>
<Button
type="submit"
disabled={!selectedFile || fileUploadLoading}
className="w-full"
>
{fileUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Uploading...
</>
) : (
<>
<Upload className="mr-2 h-4 w-4" />
Upload File
</>
)}
</Button>
</form>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<FolderOpen className="h-5 w-5" />
Upload Folder
</CardTitle>
<CardDescription>
Process all documents in a folder path on the server
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handlePathUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="folder-path">Folder Path</Label>
<Input
id="folder-path"
type="text"
placeholder="/path/to/documents"
value={folderPath}
onChange={(e) => setFolderPath(e.target.value)}
/>
</div>
<Button
type="submit"
disabled={!folderPath.trim() || pathUploadLoading}
className="w-full"
>
{pathUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Processing...
</>
) : (
<>
<FolderOpen className="mr-2 h-4 w-4" />
Process Folder
</>
)}
</Button>
</form>
</CardContent>
</Card>
{awsEnabled && (
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Cloud className="h-5 w-5" />
Process Bucket
</CardTitle>
<CardDescription>
Process all documents from an S3 bucket. AWS credentials must be
set as environment variables.
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleBucketUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="bucket-url">S3 URL</Label>
<Input
id="bucket-url"
type="text"
placeholder="s3://bucket/path"
value={bucketUrl}
onChange={(e) => setBucketUrl(e.target.value)}
/>
</div>
<Button
type="submit"
disabled={!bucketUrl.trim() || bucketUploadLoading}
className="w-full"
>
{bucketUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Processing...
</>
) : (
<>
<Cloud className="mr-2 h-4 w-4" />
Process Bucket
</>
)}
</Button>
</form>
</CardContent>
</Card>
)}
</div>
</div>
);
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<FolderOpen className="h-5 w-5" />
Upload Folder
</CardTitle>
<CardDescription>
Process all documents in a folder path on the server
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handlePathUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="folder-path">Folder Path</Label>
<Input
id="folder-path"
type="text"
placeholder="/path/to/documents"
value={folderPath}
onChange={(e) => setFolderPath(e.target.value)}
/>
</div>
<Button
type="submit"
disabled={!folderPath.trim() || pathUploadLoading}
className="w-full"
>
{pathUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Processing...
</>
) : (
<>
<FolderOpen className="mr-2 h-4 w-4" />
Process Folder
</>
)}
</Button>
</form>
</CardContent>
</Card>
{awsEnabled && (
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Cloud className="h-5 w-5" />
Process Bucket
</CardTitle>
<CardDescription>
Process all documents from an S3 bucket. AWS credentials must be
set as environment variables.
</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleBucketUpload} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="bucket-url">S3 URL</Label>
<Input
id="bucket-url"
type="text"
placeholder="s3://bucket/path"
value={bucketUrl}
onChange={(e) => setBucketUrl(e.target.value)}
/>
</div>
<Button
type="submit"
disabled={!bucketUrl.trim() || bucketUploadLoading}
className="w-full"
>
{bucketUploadLoading ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Processing...
</>
) : (
<>
<Cloud className="mr-2 h-4 w-4" />
Process Bucket
</>
)}
</Button>
</form>
</CardContent>
</Card>
)}
</div>
</div>
);
}
export default function ProtectedAdminPage() {
return (
<ProtectedRoute>
<AdminPage />
</ProtectedRoute>
);
return (
<ProtectedRoute>
<AdminPage />
</ProtectedRoute>
);
}

View file

@ -1,57 +0,0 @@
import {
type UseMutationOptions,
useMutation,
useQueryClient,
} from "@tanstack/react-query";
export interface CreateApiKeyRequest {
name: string;
}
export interface CreateApiKeyResponse {
key_id: string;
api_key: string;
name: string;
key_prefix: string;
created_at: string;
}
export const useCreateApiKeyMutation = (
options?: Omit<
UseMutationOptions<CreateApiKeyResponse, Error, CreateApiKeyRequest>,
"mutationFn"
>,
) => {
const queryClient = useQueryClient();
async function createApiKey(
variables: CreateApiKeyRequest,
): Promise<CreateApiKeyResponse> {
const response = await fetch("/api/keys", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(variables),
});
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
throw new Error(errorData.error || "Failed to create API key");
}
return response.json();
}
return useMutation({
mutationFn: createApiKey,
onSuccess: (...args) => {
queryClient.invalidateQueries({
queryKey: ["api-keys"],
});
options?.onSuccess?.(...args);
},
onError: options?.onError,
onSettled: options?.onSettled,
});
};

View file

@ -3,7 +3,6 @@ import {
useMutation,
useQueryClient,
} from "@tanstack/react-query";
import { ONBOARDING_OPENRAG_DOCS_FILTER_ID_KEY } from "@/lib/constants";
export interface OnboardingVariables {
// Provider selection
@ -29,7 +28,6 @@ export interface OnboardingVariables {
interface OnboardingResponse {
message: string;
edited: boolean;
openrag_docs_filter_id?: string;
}
export const useOnboardingMutation = (
@ -61,15 +59,6 @@ export const useOnboardingMutation = (
return useMutation({
mutationFn: submitOnboarding,
onSuccess: (data) => {
// Store OpenRAG Docs filter ID if returned
if (data.openrag_docs_filter_id && typeof window !== "undefined") {
localStorage.setItem(
ONBOARDING_OPENRAG_DOCS_FILTER_ID_KEY,
data.openrag_docs_filter_id
);
}
},
onSettled: () => {
// Invalidate settings query to refetch updated data
queryClient.invalidateQueries({ queryKey: ["settings"] });

View file

@ -1,44 +0,0 @@
import {
type UseMutationOptions,
useMutation,
useQueryClient,
} from "@tanstack/react-query";
interface OnboardingRollbackResponse {
message: string;
}
export const useOnboardingRollbackMutation = (
options?: Omit<
UseMutationOptions<OnboardingRollbackResponse, Error, void>,
"mutationFn"
>,
) => {
const queryClient = useQueryClient();
async function rollbackOnboarding(): Promise<OnboardingRollbackResponse> {
const response = await fetch("/api/onboarding/rollback", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || "Failed to rollback onboarding");
}
return response.json();
}
return useMutation({
mutationFn: rollbackOnboarding,
onSettled: () => {
// Invalidate settings query to refetch updated data
queryClient.invalidateQueries({ queryKey: ["settings"] });
},
...options,
});
};

View file

@ -1,49 +0,0 @@
import {
type UseMutationOptions,
useMutation,
useQueryClient,
} from "@tanstack/react-query";
export interface RevokeApiKeyRequest {
key_id: string;
}
export interface RevokeApiKeyResponse {
success: boolean;
}
export const useRevokeApiKeyMutation = (
options?: Omit<
UseMutationOptions<RevokeApiKeyResponse, Error, RevokeApiKeyRequest>,
"mutationFn"
>,
) => {
const queryClient = useQueryClient();
async function revokeApiKey(
variables: RevokeApiKeyRequest,
): Promise<RevokeApiKeyResponse> {
const response = await fetch(`/api/keys/${variables.key_id}`, {
method: "DELETE",
});
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
throw new Error(errorData.error || "Failed to revoke API key");
}
return response.json();
}
return useMutation({
mutationFn: revokeApiKey,
onSuccess: (...args) => {
queryClient.invalidateQueries({
queryKey: ["api-keys"],
});
options?.onSuccess?.(...args);
},
onError: options?.onError,
onSettled: options?.onSettled,
});
};

View file

@ -60,9 +60,9 @@ export const useDoclingHealthQuery = (
// If healthy, check every 30 seconds; otherwise check every 3 seconds
return query.state.data?.status === "healthy" ? 30000 : 3000;
},
refetchOnWindowFocus: false, // Disabled to reduce unnecessary calls on tab switches
refetchOnWindowFocus: true,
refetchOnMount: true,
staleTime: 30000, // Consider data fresh for 30 seconds
staleTime: 30000, // Consider data stale after 25 seconds
...options,
},
queryClient,

View file

@ -1,36 +0,0 @@
import {
type UseQueryOptions,
useQuery,
useQueryClient,
} from "@tanstack/react-query";
import type { KnowledgeFilter } from "./useGetFiltersSearchQuery";
export const useGetAllFiltersQuery = (
options?: Omit<UseQueryOptions<KnowledgeFilter[]>, "queryKey" | "queryFn">,
) => {
const queryClient = useQueryClient();
async function getAllFilters(): Promise<KnowledgeFilter[]> {
const response = await fetch("/api/knowledge-filter/search", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "", limit: 1000 }), // Fetch all filters
});
const json = await response.json();
if (!response.ok || !json.success) {
// ensure we always return a KnowledgeFilter[] to satisfy the return type
return [];
}
return (json.filters || []) as KnowledgeFilter[];
}
return useQuery<KnowledgeFilter[]>(
{
queryKey: ["knowledge-filters", "all"],
queryFn: getAllFilters,
...options,
},
queryClient,
);
};

Some files were not shown because too many files have changed in this diff Show more