ragflow_orchestrator
Universal and extensible RAG module with standardized interfaces and adapters.
Authors
- Alexander Ivanov
- email: VeryComplexAndLongName@gamil.com
- Telegram: @alexander_ivan0v
Key Updates
- Storage architecture is PostgreSQL + Qdrant only.
- New combined provider:
postgres+qdrant(PostgreSQL metadata + Qdrant vectors). - Adaptive document pipeline supports semantic subtype classification with hybrid scoring:
- rules-based scoring
- optional LLM scoring (
ollamaoropenai_compat) - weighted merge and confidence threshold fallback
- Document subtype is persisted in PostgreSQL metadata (
documents,document_versions) and propagated into chunk metadata/tags. - Added infrastructure compose files for local development:
docker-compose.postgres.ymldocker-compose.qdrant.ymldocker-compose.infra.yml
Goals
- One internal chunk contract across vector stores.
- Standardized ingestion pipeline: cleaning -> chunking -> embedding -> upsert.
- Adaptive document pipeline: detection -> normalization -> strategy-aware chunking.
- Standard retrieval APIs with semantic/hybrid strategies.
- First-class interoperability with PromptOrchestrator pipelines.
- Extensible migration framework and quality evaluation utilities.
Providers
Supported provider kinds in create_provider:
postgres+qdrant(recommended)postgresql+qdrantpostgres_qdrantpgvector/postgres/postgresql(legacy)qdrant(legacy)
Quick Start (PostgreSQL + Qdrant)
- Start infrastructure:
docker compose -f docker-compose.infra.yml up -d
- Configure environment:
export RAG_POSTGRES_DSN="postgresql://rag_user:rag_password@localhost:5432/rag_db"
export RAG_QDRANT_URL="http://localhost:6333"
export RAG_QDRANT_COLLECTION="rag_chunks"
PowerShell:
$env:RAG_POSTGRES_DSN = "postgresql://rag_user:rag_password@localhost:5432/rag_db"
$env:RAG_QDRANT_URL = "http://localhost:6333"
$env:RAG_QDRANT_COLLECTION = "rag_chunks"
- Ingest and search:
from ragflow_orchestrator.factory import create_provider
from ragflow_orchestrator.orchestrator import RAGOrchestrator
from ragflow_orchestrator.embedding import HashEmbedder
from ragflow_orchestrator.presets import document_preset
provider = create_provider(
"postgres+qdrant",
dsn="postgresql://rag_user:rag_password@localhost:5432/rag_db",
qdrant_url="http://localhost:6333",
qdrant_collection="rag_chunks",
)
preset = document_preset()
orchestrator = RAGOrchestrator(
provider=provider,
embedder=HashEmbedder(dimensions=256),
chunker=preset.chunker,
cleaner=preset.cleaner,
)
orchestrator.ingest(
source_id="doc-1",
raw_text="RAG orchestration standardizes ingestion and retrieval.",
metadata={"tenant_id": "t1", "language": "en", "doctype": "note"},
)
hits = orchestrator.search("How does orchestration help?", top_k=3)
for hit in hits:
print(hit.score, hit.chunk.id, hit.chunk.text)
ConfigStore Example
from ragflow_orchestrator import (
ConfigStore,
EmbeddingConfig,
ModuleConfig,
PipelineConfig,
ProviderConfig,
RAGOrchestratorFactory,
)
store = ConfigStore(
ModuleConfig(
provider=ProviderConfig(
kind="postgres+qdrant",
params={
"dsn": "postgresql://rag_user:rag_password@localhost:5432/rag_db",
"qdrant_url": "http://localhost:6333",
"qdrant_collection": "rag_chunks",
},
),
embedding=EmbeddingConfig(
provider="ollama",
model="nomic-embed-text:latest",
options={"base_url": "http://localhost:11434", "timeout_seconds": 60},
),
pipeline=PipelineConfig(preset="document"),
)
)
orchestrator = RAGOrchestratorFactory.from_config_store(store)
Document Subtype Classification
Subtype classification is integrated into ingestion and versioned metadata pipeline.
Main behavior:
- If subtype is missing, classifier predicts it from content and metadata.
- Final subtype and confidence are attached to:
- document metadata
- version metadata
- chunk metadata/tags
- Fallback subtype is applied when confidence is below threshold.
Config fields in ModuleConfig.subtype_classification:
enabledfallback_subtypeconfidence_thresholdrules_weightllm_weightallowed_subtypesllmsettings:provider:none | ollama | openai_compatmodelbase_urlapi_key_envtimeout_secondstemperature
Document Pipeline
Default document preset routes content by detected type.
Supported types include:
pdfdocxxlsxhtmlmarkdownjsonxmlcsvtxtcodeunsupported
Detection can use extension hints, magic bytes, and content-type metadata.
Examples
Examples in examples/ now use PostgreSQL + Qdrant only:
examples/basic_usage.pyexamples/query_rag.pyexamples/template_ingestion.pyexamples/evaluate_retrieval.py
Each example reads environment variables:
RAG_POSTGRES_DSNRAG_QDRANT_URLRAG_QDRANT_COLLECTION
Docker Compose Files
1) PostgreSQL + pgAdmin only
docker compose -f docker-compose.postgres.yml up -d
Services:
postgresonlocalhost:5432pgadminonlocalhost:5050
2) Qdrant only
docker compose -f docker-compose.qdrant.yml up -d
Service:
qdrantonlocalhost:6333(HTTP),localhost:6334(gRPC)
3) Full infrastructure (recommended)
docker compose -f docker-compose.infra.yml up -d
Services:
postgrespgadminqdrant
OpenTelemetry (Optional)
Enable local collector:
docker compose -f docker-compose.otel.yml up -d
Files:
docker-compose.otel.ymlobservability/otel-collector-config.yamlobservability/signoz-dashboard-ragflow.yaml
Installation
pip install -e .
Optional extras:
pip install -e .[qdrant]
pip install -e .[pgvector]
pip install -e .[hf]
pip install -e .[all]
Testing and Quality
ruff check .
mypy src tests scripts
pytest -q
Integration Tests
Defaults:
QDRANT_URL=http://localhost:6333PGVECTOR_DSN=postgresql+psycopg://postgres:N0th1ing@localhost:5432/app
Run preflight:
python scripts/preflight_check.py
Run preflight + integration tests:
python scripts/run_preflight_and_integration.py
PromptOrchestrator Interoperability
Use PromptStyleRAGProviderAdapter to expose retrieve(query, limit) style retrieval for PromptOrchestrator flows while keeping ragflow_orchestrator ingestion/storage responsibilities.
Repository Structure
src/ragflow_orchestrator/: package sourceexamples/: usage samplesscripts/: runnable demos and utility scriptstests/: test suitedatasets/: evaluation datasets
License
See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragflow_orchestrator-0.1.18.tar.gz.
File metadata
- Download URL: ragflow_orchestrator-0.1.18.tar.gz
- Upload date:
- Size: 145.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13fd0f993cac281a6fa688d7a2f70c95d5ec2136352ed1c39f3c0b2b7dd17d54
|
|
| MD5 |
5b908bb7427773bf2c79317f188d6092
|
|
| BLAKE2b-256 |
b1dbc0eb0dae9cc47a5381439f3610796c6f63eda786757c9c7780174c79d395
|
Provenance
The following attestation bundles were made for ragflow_orchestrator-0.1.18.tar.gz:
Publisher:
publish.yml on VeryComplexAndLongName/RagOrchestrator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragflow_orchestrator-0.1.18.tar.gz -
Subject digest:
13fd0f993cac281a6fa688d7a2f70c95d5ec2136352ed1c39f3c0b2b7dd17d54 - Sigstore transparency entry: 1939318258
- Sigstore integration time:
-
Permalink:
VeryComplexAndLongName/RagOrchestrator@f4ff10aa4d1d54157e53ec77539f44db4f6bb5a6 -
Branch / Tag:
refs/tags/0.1.18 - Owner: https://github.com/VeryComplexAndLongName
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4ff10aa4d1d54157e53ec77539f44db4f6bb5a6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ragflow_orchestrator-0.1.18-py3-none-any.whl.
File metadata
- Download URL: ragflow_orchestrator-0.1.18-py3-none-any.whl
- Upload date:
- Size: 154.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c145c543a11f1d2022ce8d7f8d7f6cb5a43ad0427fca3d143e26a7b1ae11bd2b
|
|
| MD5 |
3ef3996030ffe9ea38c184237b9d514b
|
|
| BLAKE2b-256 |
1b5d97765f1660c15e9c341ef1a9caceb13e69ddaca9f10a75479d1adf23f313
|
Provenance
The following attestation bundles were made for ragflow_orchestrator-0.1.18-py3-none-any.whl:
Publisher:
publish.yml on VeryComplexAndLongName/RagOrchestrator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragflow_orchestrator-0.1.18-py3-none-any.whl -
Subject digest:
c145c543a11f1d2022ce8d7f8d7f6cb5a43ad0427fca3d143e26a7b1ae11bd2b - Sigstore transparency entry: 1939318508
- Sigstore integration time:
-
Permalink:
VeryComplexAndLongName/RagOrchestrator@f4ff10aa4d1d54157e53ec77539f44db4f6bb5a6 -
Branch / Tag:
refs/tags/0.1.18 - Owner: https://github.com/VeryComplexAndLongName
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4ff10aa4d1d54157e53ec77539f44db4f6bb5a6 -
Trigger Event:
release
-
Statement type: