Deep transform is a preview feature. The request and response shapes may change before general availability. The SDK helper methods shown here are available in the 2.0.4 Python and TypeScript SDKs.
Before you begin
You need three things to run an extraction:- An API key, sent in the
Meibel-API-Keyheader. The SDKs read it from theMEIBEL_API_KEYenvironment variable in the examples below. - A JSON Schema describing the entities to extract. The shape of this schema is the shape of your output: objects become nested objects, arrays become collections, and scalar fields become single values. A field declared as a string comes back as a string; a field declared as an object comes back fully populated.
- A document to extract from, such as a PDF.
- Domain guidance (optional), sent as
guidance. This is free-text instruction about how your domain names and structures things: the terminology it uses, how to disambiguate values that look alike, and which fields to prioritize. Specialized documents extract more accurately when the model is told the conventions the document assumes its reader already knows.
Submit an extraction
Submitting sends the document and schema together and returns a job ID right away, so the extraction runs server-side while your application stays responsive. Theroot_name names the top-level entity in your schema, and max_pages caps how many pages are processed, which is useful for a quick trial before a full run. Pass your domain instructions as guidance so the extraction reads the document the way a specialist in your field would.
guidance from a guidance.md file, which keeps longer instructions out of your code. Guidance is optional, so you can omit it for documents that need no domain context, and it can grow from a sentence to a full page as a domain demands.
Check status
A deep transform runs asynchronously across the document’s pages, so you poll the job until it reaches a terminal state. The status moves throughqueued and running to either succeeded or failed.
A succeeded job also reports
metrics (such as wall-clock time and identity resolution rate) and an aeq extraction-quality score, alongside the list of artifacts you can download.Download results
Once the job succeeds, the extraction is available as named artifacts. Theoutput.json artifact holds the schema-conformant result. The provenance.json artifact maps each value in that result to its source spans, so a reviewer can land on the exact page region a field came from.
You can review provenance visually in the Meibel app instead of reading
provenance.json by hand. Open the Transform menu in the app sidebar and enter your job ID, or go straight to https://app.meibel.ai/projects/{project_id}/transform/job/{job_id} with your project and job IDs substituted. Either way you see each extracted value linked to the page region it came from.Reuse a parsed document
If you have already parsed a document through the Documents API, you can run a deep transform against that parse instead of uploading the file again. Submit toPOST /documents/deep-transform/from-document with the parse job ID and your schema, and the document is not parsed a second time.
Prompts & Artifact Schemas
Define the JSON Schema that shapes your extraction output.
Document Processing
Parse a document first, then reuse that parse in a deep transform.