Skip to main content

Quality grades

Every document processed through FlexOrch receives a quality grade: Recommended minimum for production RAG: grade B.

How the score is computed

The quality score is a composite of three signals:
A document with 100% complete fields, healthy average line length, and no noise scores 1.0 → grade A. An OCR-failed scan with short, symbol-heavy lines might score 0.20 → grade D.

OCR confidence penalty

For scanned PDFs and images, an additional OCR confidence check applies:
  • OCR confidence ≥ 0.70 → no penalty
  • OCR confidence < 0.70 → quality score capped at 0.74 → maximum grade C
This ensures that readable-but-unreliable OCR output never receives an A or B grade.

Filtering by quality at export


Filtering with flexorch-audit (OSS)

For local files before they reach the platform:

Chunking strategies

Each chunk is a dict:

Choosing chunk size

rag_metadata() returns a recommended_chunk_size based on the detected text length — use it as a starting point.

PII and RAG

PII in chunks can leak sensitive data to your LLM. FlexOrch masks PII automatically:
  • pii_masked=True on export → [MASKED_EMAIL], [MASKED_NATIONAL_ID_TR], etc.
  • Filter chunks where metadata.pii_masked == true to guarantee clean RAG context
  • Check metadata.pii_findings_count — anything > 0 should be reviewed before entering a public-facing chain

RAG pipeline

End-to-end: export chunks or managed search

PII & privacy

Masking strategies and compliance notes