Skip to main content
Forms and intake documents bring a different shape: a person’s identity at the top, then several parallel lists (employment, education, skills, references). The agent fills out the nested structure in one pass. Place the resume to extract at resume.pdf in the directory where you run this code.
The same shape covers job applications and KYC intake. Swap the schema’s outer model and the instructions; the File() plumbing and the agent definition do not change.

KYC intake

Identity verification forms add typed fields the downstream system has to accept verbatim (passport numbers, dates of birth, addresses). The schema should be conservative about types: keep IDs as strings to preserve leading zeros and country-specific formats.
For KYC, every field is review-worthy. Combine this schema with the confidence pattern so the downstream queue knows what to send to a compliance reviewer.

Multi-page applications

Job applications arrive as one combined PDF or as a set of loose attachments. files takes a sequence, so the whole bundle goes into a single run against one schema.
Run once per attachment when you want an isolated schema per document, then compose in plain Python. Every run needs its own schema, because output_schema takes a Pydantic model: Resume for the resume, and a wrapper for the reference list. A bare List[str] is not a schema.

Schema-shape comparison

The agent code is the same across all four. The schema decides the workload.

Next steps

Developer Resources