Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.docex.dev/llms.txt

Use this file to discover all available pages before exploring further.

Schemas

The only document-specific layer in Docex is the optional built-in schema registry (apps/worker/src/registry.js). Users can bypass it entirely by supplying their own schema at request time.

Built-in schemas

The registry includes convenience defaults for common tasks:
Schema IDUse case
invoice/global-accounts-payableExtract vendor, total, line items, due date
trade-license/uaeExtract company name, license number, expiry
identity/passportExtract full name, document number, date of birth
receipt/retailExtract merchant, items, total, date

Custom schemas

The biggest unlock of the task-agnostic architecture is user-defined schemas. Pass any schema at request time without touching the registry:
const result = await docex.run({
  file: "suspicious-email.png",
  prompt: "Analyze this email attachment for phishing indicators",
  schema: {
    label: "Phishing scan",
    expectedFields: [
      "is_phishing",
      "confidence_score",
      "suspicious_elements",
      "recommended_action"
    ],
    promptScaffold: "Analyze this image for security threats and phishing indicators."
  }
});
This makes Docex genuinely task-agnostic. The built-in schemas are just convenience defaults.

Schema ID vs. custom schema

  • Use schemaId to reference a built-in registry schema
  • Use schema to provide an inline custom schema
  • If neither is provided, the prompt alone drives the analysis (generic vision summary)

Backward compatibility

The old docTypeHint parameter is mapped to schemaId internally. Existing code using docTypeHint will continue to work.