Skip to main content

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:

Custom schemas

The biggest unlock of the task-agnostic architecture is user-defined schemas. Pass any schema at request time without touching the registry:
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.