OCR module

OCR execution, provider configuration, saved extraction instructions, and persisted result history for document-processing workflows.

What this module does

Extract structured text from uploaded files with configurable OCR instructions.

Key capabilities

  • User-owned OCR instructions with reusable extraction prompts
  • OCR execution against uploaded files with provider validation
  • Persisted OCR results plus admin-level provider configuration and oversight

Core flows

  1. Save OCR instruction

    • Trigger: authenticated request to /ocr/instructions.
    • Steps: resolve current user UUID, persist instruction title and instruction text.
    • Output: saved instruction DTO.
    • Failure/edge cases: invalid payload, unknown instruction on update/delete.
  2. Execute OCR

    • Trigger: authenticated request to /ocr/results.
    • Steps: resolve user UUID, load saved instruction or use ad hoc text, validate requested provider and uploaded file against provider validator, call provider adapter with exact instruction text snapshot and file content, persist final OCR result row.
    • Output: saved OCR result DTO with success or error outcome.
    • Failure/edge cases: missing provider config, unsupported file type, upstream OCR error, missing instruction, empty file.
  3. List user OCR results

    • Trigger: authenticated request to /ocr/results.
    • Steps: query OCR result rows owned by caller, map entities to API DTOs.
    • Output: paged user-owned OCR results.
    • Failure/edge cases: none beyond auth and pagination validation.
  4. Admin OCR oversight

    • Trigger: admin requests to /admin/ocr/results and /admin/ocr/providers.
    • Steps: list all OCR results, delete OCR result rows, manage provider API keys.
    • Output: paged global OCR result list, deleted rows, provider config state.
    • Failure/edge cases: unknown result/provider rows return 404.

Module is included in

  • This module is currently available only as an individual module selection.

Source paths

  • backend/modules/ocr
  • frontend/modules/ocr