ExuluDocumentProcessor converts documents to structured markdown for ingestion into knowledge contexts. It supports multiple processor backends — docling (Python, best for complex PDFs), liteparse (JS, broad format support), mistral (OCR via LiteLLM proxy), and officeparser (JS, Office formats) — and optionally validates and corrects each page using a VLM pass.
The advanced-document-processing EE entitlement is checked at runtime; calling process without a valid license throws immediately.
API surface
ExuluDocumentProcessor.process
The document to process. Pass a local file path, an HTTP/HTTPS URL (downloaded automatically), or a
Buffer with the raw file bytes.The file name including extension (e.g.
"report.pdf"). The extension determines which code path handles the file; it is required even when file is a Buffer.The processing backend to use.
LiteLLM
model_name for the "mistral" OCR backend. Defaults to "mistral-ocr".Maximum pages per OCR request for the
"mistral" backend. Defaults to 25 (safely below the 30-page Vertex AI limit). The PDF is split into chunks of this size before sending.LiteLLM
model_name for the optional VLM validation pass (e.g. "vertex-gemini-2.5-flash"). Only supported when processor.name is "docling". When set, pages containing tables or images are re-validated and corrected by the VLM.Number of pages to validate in parallel. Required when
vlm.model is set.Optional cost-attribution fields (
user, role, project, agent, routine, context) forwarded to LiteLLM as spend tags for both OCR and VLM passes.Set to
false to keep the per-job temp directory on disk after processing. Defaults to true.ProcessedDocument is Array<{ page: number; content: string }>. Each element is one page of the document, with final content (VLM-corrected when applicable).Supported file types by processor
Example
Notes
- The
doclingbackend runs Python and sets up a virtual environment automatically on first use viaExuluPython.setup. Python 3.10+ is required. - Pages are separated by
<!-- END_OF_PAGE -->comments in the markdown stream written to disk, but the returnedProcessedDocumentarray already splits them per page. - Temporary files are created under
<cwd>/temp/<uuid>/and deleted after each call unlessdebugging.deleteTempFilesisfalse.
Related
- ExuluPython: manage the Python environment required by
docling. - Knowledge — pipeline: how processed documents feed into knowledge contexts.