AI & Agents · Cloud, DevOps & LLMOps · Databases & Data Engineering
Azure AI Automation: Document Intelligence, RAG & Governed Agents
By David Gadyan · Published
An end-to-end Azure and LLM platform for construction and manufacturing back offices. It turns messy PDFs into validated data with the source quoted for every field, answers staff questions only from company documents with citations, and runs an AI agent whose every write action waits for human approval. Every call is traced and costed, and prompt versions are measured on golden sets. English and German.
The problem
Teams that try to connect Azure AI services to real operations hit the same walls: many services to orchestrate (Document Intelligence, Blob storage, queues, search and the model), state that has to survive async steps and human approvals, tool calls that crash the agent loop, compliance requirements around GDPR, audit and identity, and no way to tell whether a prompt change made answers better or worse.
This platform is built for construction and manufacturing back offices, where the paperwork is supplier invoices, inspection reports, material certificates and drawing sheets, in English and German.
The product in use
What I built
One view of cost and quality. Documents processed, agent runs, pending approvals and model spend for the last 14 days, broken down by module and by model.
Document intelligence with provenance. The pipeline extracts words with coordinates (PyMuPDF, Azure AI Document Intelligence, or vision OCR for scans), classifies the document and extracts a typed record with structured outputs. Every field quotes its source text, so a reviewer can click a value and see where on the page it came from.
Rules before booking. Deterministic checks validate totals, dates and cross-field logic. Here the line items do not add up to the subtotal, so the invoice goes to review instead of into the books.
A governed agent. A tool-calling agent looks up projects, suppliers, purchase orders and tickets and searches the knowledge base. Anything that writes (a ticket, an order status, an e-mail to a supplier) is parked for an approver; the worker executes it after approval and the run resumes. Role-based tool permissions, loop detection, token budgets, tool timeouts, a kill switch and a complete audit log sit around it.
Traced and measured. Every run is an OpenTelemetry trace with token counts and cost per model call, viewable in the app or in Application Insights. Prompts are versioned and golden sets measure retrieval recall, answer correctness and faithfulness, abstention and extraction accuracy. On the demo data, switching to a multilingual embedding model took QA correctness and abstention accuracy from 0.875 to 1.00; the eval view is what showed the gap.
How it runs
Local-first: one docker compose up runs the API, worker, UI, PostgreSQL with pgvector and Azurite, with no Azure resources needed. The same code deploys to Azure Container Apps with managed identity, Key Vault, Blob and Queue storage, PostgreSQL Flexible Server, Document Intelligence and Log Analytics, all defined in Bicep.
Related projects
Crypto Regulation RAG Chatbot (GPT-4 + Pinecone)
AI & Agents · Databases & Data Engineering · Cloud, DevOps & LLMOps
AI Lead Scoring & Churn Detection Engine (S1mple.ai)
AI ERP & SaaS · AI & Agents · AI Marketing & Analytics · Databases & Data Engineering
Virgil.ai: Agentic Health-Insurance Assistant
AI & Agents · AI ERP & SaaS · Cloud, DevOps & LLMOps · Security & Compliance