Skip to main content

OCR & Table Extraction

Starting from v1.9.0, RAG-DocBot can optionally add OCR and table-row extraction during indexing.


When to Enable OCR

Enable OCR when your content includes scanned or image-only documents, for example:

  • scanned PDFs without embedded selectable text
  • screenshots or image exports of reports
  • image attachments (.png, .jpg, .jpeg, .tiff)

For documents that already contain extractable text, RAG-DocBot keeps using the fast native extraction path. OCR is additive, not a replacement.


Enable OCR

Set the following in your .env file:

INDEXING_OCR_ENABLED=true
INDEXING_OCR_LANGUAGES=eng,deu
  • INDEXING_OCR_ENABLED=true turns OCR on.
  • INDEXING_OCR_LANGUAGES accepts comma-separated Tesseract language codes.

CUDA-aware OCR backend selection is automatic in v1.9.0. You do not need to set a separate GPU/CPU OCR switch.


Table Extraction

Enable additive table-row extraction with:

INDEXING_TABLES_ENABLED=true

Supported inputs for table extraction:

  • PDF
  • DOCX
  • Excel (.xlsx)
  • CSV

When enabled, table rows are indexed alongside regular text chunks and include opt-in table metadata payloads for retrieval/filtering workflows.


Performance and Re-indexing Notes

  • OCR and table extraction increase indexing work per document.
  • Expect longer indexing time and higher CPU/GPU utilization on large scans.
  • If you enable these features on an existing deployment, trigger a re-index so older documents can benefit from the new extraction paths.

See also: Environment Variables.