All catalogue entries

06 / 07 Module catalogue detail

OCR module

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

Browse category: AI & data

Choose the modules you want after opening the builder.

What this module does

Extract structured text from uploaded files with configurable OCR instructions.

Documented 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

Configuration highlights

  • OpenAI OCR model selection under bitecode.ocr.open-ai.model

  • Provider configuration and API key management through the OCR admin endpoints

  • OCR result persistence in the dedicated ocr schema

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.

Core flow source: backend/modules/ocr/AGENTS.md