Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python
6.4 KB
Raw Blame
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "openrag"
version = "0.8.1"
description = "OpenRAG is a comprehensive Retrieval-Augmented Generation platform that enables intelligent document search and AI-powered conversations."
readme = "README.md"
requires-python = ">=3.13"
classifiers = [
    "Development Status :: 4 - Beta",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: Apache Software License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Artificial Intelligence",
    "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
    "agentd>=0.13.0",
    "aiofiles>=24.1.0",
    "authlib>=1.8.0,<2.0.0",
    "aiohttp>=3.14.4",
    "cryptography>=48.0.1",
    "click>=8.3.3",
    "google-api-python-client>=2.143.0",
    "google-auth-httplib2>=0.2.0",
    "httplib2>=0.32.0",
    "google-auth-oauthlib>=1.2.0",
    # AgentD 0.13 imports griffe at runtime but does not declare it.
    "griffe>=1.15.0,<2.0.0",
    "msal>=1.29.0",
    "httpx>=0.27.0",
    "idna>=3.18",
    "opensearch-py[async]>=3.0.0",
    "pyjwt>=2.15.1",
    "python-multipart>=0.0.31",
    "fastapi>=0.115.0",
    "starlette>=1.6.0",
    "uvicorn>=0.35.0",
    "boto3>=1.35.0",
    "ibm-cos-sdk>=2.13.0",
    "azure-storage-blob>=12.20.0",
    "psutil>=7.0.0",
    "rich>=13.0.0",
    "textual>=0.45.0",
    "python-dotenv>=1.0.0",
    "textual-fspicker>=0.6.0",
    "structlog>=25.4.0",
    "zxcvbn>=4.5.0",
    "prometheus-fastapi-instrumentator>=8.0.0",
    "litellm>=1.105.0,<2.0.0",
    "joserfc>=1.7.3,<2.0.0",
    "pyyaml>=6.0",
    "tiktoken>=0.7.0",
    "fastmcp>=4.1.6",
    "mcp>=2.2.0,<3.0.0",
    "openai>=2.24.0,<3",
    "tenacity>=9.1.4",
    "pygments>=2.20.0",
    "pyasn1>=0.6.4",
    "protobuf>=7.35.0,<8",
    "requests>=2.33.0",
    "urllib3>=2.8.0",
    "fsspec>=2026.6.0",
    "sqlmodel>=0.0.22",
    "sqlalchemy[asyncio]>=2.0.36",
    "scrapy>=2.13.0",
    "aiosqlite>=0.20.0",
    "alembic>=1.13.0",
    "asyncpg>=0.30.0",
    "cachetools>=5.5.0",
    "filelock>=4.2.1",
    "mako>=1.4.2",
    "multidict>=6.9.1",
    "oauthlib>=4.0.0",
    "opentelemetry-api>=1.45.1",
]

# Optional extras. Install with `uv sync --extra <name>`.
[project.optional-dependencies]
# IBM Instana APM tracer. Optional because the feature is opt-in at runtime
# (INSTANA_ENABLED, default false) and the tracer monkey-patches httpx,
# opensearch-py, sqlalchemy, starlette, fastapi, and logging at import time —
# not something to install on every OSS deployment that will never enable it.
# The upper bound is deliberate for the same reason: a major release of a
# library that rewrites the runtime behaviour of the whole HTTP/DB stack should
# be adopted explicitly, not resolved into an install.
# src/main.py imports it defensively, so its absence downgrades to a warning.
apm = ["instana>=3.17.0,<4"]
tracing = [
    "langfuse>=4.16,<5",
]

[dependency-groups]
dev = [
    "pytest>=9.0.3",
    "pytest-asyncio>=0.21.0",
    "pytest-mock>=3.12.0",
    "pytest-cov>=4.0.0",
    "ruff>=0.15.12",
    "mypy>=2.0.0",
    # The tracing extra, so its unit tests (tests/unit/observability) run.
    "langfuse>=4.16,<5",
    # Used by the Langflow Split Text component, so its unit tests run the real splitter.
    "langchain-text-splitters>=1.1.2,<2",
]

[project.scripts]
openrag = "tui.main:run_tui"

[tool.pytest.ini_options]
filterwarnings = [
    "error::RuntimeWarning",
]
markers = [
    "openrag_skip_app_onboard: selected tests manage their own infrastructure clients and do not need the session app onboarding fixture",
]

[tool.uv]
package = true
# LiteLLM's current stable releases retain a stale ``filelock<4`` upper bound.
# Override it until LiteLLM publishes a compatible bound; 4.2.1 is required by
# the container CVE remediation baseline.
override-dependencies = ["python-dotenv>=1.1.0", "filelock>=4.2.1"]

# Ruff and mypy run only against files changed in a PR (see
# .github/workflows/lint-backend.yml). The configs below stay
# intentionally minimal — broad enforcement is out of scope for the
# refactor that introduced them.
[tool.ruff]
line-length = 100
target-version = "py312"
exclude = ["flows/components"]

[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
ignore = ["E501"]  # line-length handled by formatter

# FastAPI's idiomatic dependency-injection pattern uses `Depends(...)` and
# our `require_permission(...)` as call expressions in default-argument
# position. B008 flags these as bugs ("function call in argument default")
# but for FastAPI they are by design — the framework introspects them at
# request time. Whitelist the call sites instead of sprinkling noqa
# comments across every handler.
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
    "fastapi.Depends",
    "fastapi.Query",
    "fastapi.Path",
    "fastapi.Body",
    "fastapi.Header",
    "fastapi.Cookie",
    "fastapi.File",
    "fastapi.Form",
    "fastapi.Security",
    "dependencies.require_permission",
    "dependencies.require_all_permissions",
    "dependencies.require_api_key_permission",
]

# `bootstrap` must be the first import in any module that uses it
# (it loads .env and configures structlog before anything else can
# read env vars or emit logs). Define it as its own isort section
# placed above standard-library so the formatter never re-sorts it
# below other imports.
[tool.ruff.lint.isort]
section-order = [
    "future",
    "bootstrap",
    "standard-library",
    "third-party",
    "first-party",
    "local-folder",
]

[tool.ruff.lint.isort.sections]
bootstrap = ["bootstrap"]

[tool.mypy]
python_version = "3.13"
ignore_missing_imports = true
no_strict_optional = true
warn_unused_ignores = true
exclude = ["flows/components"]

# FastAPI handlers in these modules declare a Pydantic response model as
# their return type but legitimately return `JSONResponse(...)` on error
# paths. The runtime accepts both, but the annotation can't be widened to
# `SomeResponse | JSONResponse` because FastAPI then tries to derive an
# OpenAPI schema from the union and fails. Suppress only the resulting
# return-value mismatches in these files.
[[tool.mypy.overrides]]
module = ["api.settings.endpoints", "api.v1.settings"]
disable_error_code = ["return-value"]