Document AI · Fertilizer & Clean Ammonia (Enterprise)
Fabric Policy Extraction Pipeline for Fertiglobe
End-to-end Microsoft Fabric pipeline extracting 40+ structured fields from policy PDFs into Delta tables, at 95% extraction and 98.75% evaluation accuracy.
- Role
- AI Engineer
- Designed the agent, extraction schema and accuracy guardrails, and built the parameterized Fabric pipeline.
- Industry
- Fertilizer & Clean Ammonia (Enterprise)
- Timeline
- Delivered - agent v2 in operation
Business impact
- extraction accuracy
- 95%
- evaluation accuracy
- 98.75%
- fields extracted
- 40+
- passes per document
- Multi-step + evaluation
- destination
- Fabric Delta Tables
Overview
End-to-end Microsoft Fabric pipeline ingesting policy PDFs from SharePoint and extracting 40+ structured fields into Delta tables. Azure AI Foundry agents with JSON-schema response formats drive a multi-step per-PDF extraction plus a dedicated evaluation agent for sensitive financial figures.
The evaluation agent re-checks every financial figure against the source document before a row is written, reaching 95% extraction accuracy and 98.75% evaluation accuracy in production.
Technical architecture
- Source
- Policy PDFs synced from SharePoint into a date partitioned data lake landing folder
- Trigger
- Fabric Data Pipeline passing file name and path as base parameters to the notebook
- Agent
- Pre created versioned Foundry agent invoked through the projects client with service principal auth
- Contract
- Pydantic model with field aliases matching register columns and literal enums on vocabularies
- Sink
- Validated JSON written to a mirrored sink path for register ingestion
Key features
- Two mode agent - extraction from the PDF, then validation of the extracted JSON against the same document
- Zero tolerance accuracy mandate - no approximation, rounding, inference or paraphrase on any factual value
- Document only content rule copying clause text verbatim with no synonyms or reordering
- Typed extraction schema with constrained enums for policy type, entity, country and renewal status
- Entity, country and currency consistency table with documented defaults and override rules
- Ten mandatory cross field checks including digit error detection on premium versus sum insured
- Confidence driven review routing - only high confidence records auto accept
- Structured rejection when the uploaded document is not an insurance policy
- Parameterized pipeline resolving a landing path to a matching JSON sink path per document
Challenges solved
- A single wrong digit is a financial incident - solved with explicit null and flag behaviour plus a second pass
- Models want to paraphrase, but legal clause text must survive verbatim
- A multi entity, multi currency, multi language portfolio needing a mandatory consistency table
- Structurally different policy types encoded as type conditional nullability rather than blanket errors
Tech stack
- Azure AI Foundry Agent Service
- Azure OpenAI
- Microsoft Fabric
- Python
- Pydantic
- Structured JSON Output
- Azure Identity
- SharePoint
- Data Pipelines