Insurance claims assessment with deterministic gates
An agentic pipeline that classifies motor and medical-aid claim PDFs, reconciles every figure in plain code, and returns a structured review plus an annotated PDF.
The challenge
Claims assessors must check long estimates and itemised bills line by line for non-footing totals, duplicate billing and over-authorisation. The work is repetitive and error-prone, and an LLM that checks its own arithmetic can simply repeat the mistake it is meant to catch.
What we built
The system ingests a claim PDF, classifies it as motor or medical, and routes it to a domain-specific schema, prompt and arithmetic gate. A lead agent governs tool calling and may escalate to a stronger model on hard cases, but arithmetic reconciliation, schema validation and invariant checks run as deterministic Python gates the agent cannot override and that host code re-runs after the agent finishes. Findings are benchmarked against a rate card and written into the source PDF as anchored margin comments. A per-run budget guard and token metering escalate pathological files to a human, and a FastAPI dashboard adds role-based login, claim search, comments and Word report export.
Key capabilities
- Automatic classification of claims into motor (body-repair estimate) and medical-aid domains
- Deterministic checks for quantity x price, line sums, tariff totals, member liability and duplicate service lines
- Authorise / query / reject recommendation with severity-ranked findings
- Annotated copy of the source PDF with anchored margin comments
- Rate-card benchmarking and reference-document lookup
- Per-run cost metering with a budget guard, and a role-based web dashboard with Word report export
What it delivers
- Arithmetic verdicts come from plain code outside the model's discretion, so a model cannot rubber-stamp its own sums
- Every review ships with an annotated PDF so a human can verify each flagged figure at its source
- Token usage is metered per claim and a spend ceiling hands runaway cases to a person
- The motor and medical domains share one agentic spine, so a new claim type needs a schema, prompt and gate rather than a rewrite
Have a similar backlog?
Most of our work started as a single painful workflow. Tell us yours.


