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.
Pipeline
The Docex worker pipeline is model- and task-agnostic. It does not assume “documents.” The only document-specific layer is the optional built-in schema registry, which provides convenience defaults for common extraction tasks.
Stages
Upload
The client requests a presigned upload URL via
POST /v1/uploads/presign, then uploads the file directly to storage. This keeps large files out of your API request body.Queue
The client submits a run request via
POST /v1/runs with the upload ID, prompt, and optional schema or workflow hints. The job is queued for processing.Classify
The worker inspects file metadata (type, dimensions, page count) and classifies the task type. This informs provider selection and cost estimation.
Plan
The planner resolves candidate providers per step based on the catalog (
catalog.js). It considers capabilities, costs, and auth requirements to build an execution strategy.Execute
The executor runs the strategy. If a provider fails (timeout, rate limit, error), it automatically falls back to the next candidate in the plan.
Execution strategies
The worker supports multiple strategies depending on the task and file:| Strategy | When used |
|---|---|
| Direct multimodal | Single image, vision-capable model can handle it directly |
| OCR then analyze | PDF or image where text extraction improves accuracy |
| Parser then analyze | Structured documents where a dedicated parser exists |
| Generic vision summary | Open-ended analysis where no structured schema is provided |
Cost confirmation
Jobs exceedingDOCEX_COST_CONFIRMATION_THRESHOLD_USD (default $1.00) require explicit confirmation via confirmCost: true or a maxCostUsd budget. The estimate is based on file metadata; refunds are issued if actual cost is below the estimate.