← Back to Blog

2026-05-20 · 2 min read

ClaimGuard-AI: A Three-Layer Engine for Pre-Submission Claim Risk

A pipeline that catches denial risk before a claim ships. Gemma extracts structure from documents, XGBoost scores denial likelihood, a DuckDB knapsack query orders the review queue.

FastAPIXGBoostDuckDBNext.js

The idea

Claim denials are expensive because they surface late, after submission and a rework cycle. ClaimGuard-AI moves the check upstream: it scores denial risk before submission so the riskiest claims get human attention first. Three layers, each matched to the job it fits.

Layer 1 — extraction with Nebius Gemma

A Nebius Gemma model pulls structured fields out of unstructured claim documents. This is the language-shaped part of the problem: messy source text into clean, typed features. Confining the model to extraction means its output feeds a deterministic scorer instead of making the risk call itself.

Layer 2 — denial scoring with XGBoost

The extracted features flow into an XGBoost model that scores denial likelihood. Gradient boosting fits the shape of the problem: tabular features, non-linear interactions, and scores you can reason about instead of a black-box verdict. The output is a probability per claim, not a yes/no.

Layer 3 — a knapsack queue over DuckDB

Reviewer time is finite, so the third layer treats triage as an optimization problem. A DuckDB query orders claims as a knapsack: given limited capacity, pick the set that maximizes caught risk. DuckDB keeps the query fast and in-process, with no separate warehouse to run.

Documents → Gemma extraction → XGBoost denial score → DuckDB knapsack queue → reviewer

Application layer

A FastAPI backend and Next.js front end wrap the engine as a usable review tool rather than a notebook. Extraction, scoring, and queueing each stay inspectable on their own.

Takeaway

The choice worth stealing: match each layer to its natural tool. An LLM reads documents, gradient boosting scores tabular risk, a knapsack query allocates scarce review time. Together they turn late, costly denials into an early, prioritized checklist.

Related project

ClaimGuard-AI

Scores healthcare claims for denial risk before submission. Gemma extracts the fields, XGBoost scores them, a DuckDB knapsack orders the review queue.