Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 7 min read

My AI writes your health insurance appeal for 9 cents. Then a second AI grades its citations.

Your insurer can say no in one paragraph. Saying no back takes a clinical policy, a medical guideline, federal appeal rules and a formal letter. So I built an agent that does the reading and writes the first draft, in

My AI writes your health insurance appeal for 9 cents. Then a second AI grades its citations.

Your insurer can say no in one paragraph.

Saying no back takes a clinical policy, a medical guideline, federal appeal rules and a formal letter.

So I built an agent that does the reading and writes the first draft, in about 22 seconds, for about 9 cents.

Then I gave it a second job: check every sentence it cited. Across three recorded runs, 11 of 18 cited sentences held up. The other 7 overreached, and the app underlines them in amber so you see it before your insurer does.

GitHub logo codeswithroh / overturn

Cited health-insurance appeal letters in a minute. NVIDIA Nemotron on Nebius Token Factory + Tavily.

Overturn logo

Overturn

Your insurer said no. Write back.

Upload a health-insurance denial letter. Get a cited appeal letter, the evidence behind it, and every deadline on your calendar.

Live demo License: MIT

NVIDIA Nemotron Nebius Token Factory Tavily Next.js TypeScript

Live app ยท Try a sample ยท How it works ยท Run it locally ยท Feedback


A live appeal run: each model call appears on the timeline as Nemotron reads, researches and writes

A real run on the emergency-surgery sample. Every bar is one model call, colored by model.

Built for the Nebius ร— NVIDIA Global AI Hackathon, Best Apps and Agents track.

Table of contents

The problem

๐Ÿ“„ Insurers say no ๐Ÿงญ Appeals are hard โณ The clock is running
US insurers deny a large share of in-network claims (see KFF's analyses of ACA marketplace data). An appeal means reading the plan's clinical policy, the medical guideline and federal
โ€ฆ

Meet Dana

Dana Whitfield has back pain and numbness down one leg. Her doctor orders an MRI. Her plan says no.

The letter reads like this:

Imaging for low back pain is not considered medically necessary in the absence of red-flag symptoms or failure of at least 6 weeks of conservative therapy.

Dana did seven weeks of physical therapy. The denial says the documents "do not demonstrate" it.

Dana is fictional. She's one of three sample letters I wrote for the app, with made-up names, IDs and insurers. But the shape of her problem is real, and the clock on it is real: most US plans give you 180 days to file an appeal. Miss it and the denial stands.

To fight it, Dana would need to:

  1. Find the insurer's clinical policy the letter names.
  2. Find the professional guideline that says when an MRI is appropriate.
  3. Figure out her appeal rights for her plan type.
  4. Write a formal letter that answers the exact reason, point by point.

That's a weekend of reading for someone who is already in pain. So most people don't do it.

What Overturn gives you

You upload the denial as text, a PDF or a photo. You get four things:

  • A letter that rebuts the insurer's stated reason, with citations.
  • The evidence: every search the agent ran and the exact quotes it pulled.
  • A citation check on every cited sentence: green if supported, amber if it stretches.
  • Deadlines on a calendar: when to send, when they must answer, the last day to file, and the external review cutoff.

Overturn appeal letter with green and amber citation underlines

Anything only Dana knows, like her PT dates or her doctor's notes, is left as a highlighted blank like [ATTACH: physical therapy notes, dates]. The model is told never to guess those. It's a draft for a person to review and send. It is not legal or medical advice.

The pipeline: smallest model that can do each step

I built this for the Nebius โˆšรณ NVIDIA Global AI Hackathon, on Nemotron models served through Nebius Token Factory. I gave myself one rule. Each step goes to the cheapest model that does it well.

Overturn pipeline: read, plan, research, argue, verify, deadlines

Step Model Why
Read the letter Nemotron 3 Nano, Super VL for photos Structured extraction is cheap work
Plan the research Nemotron 3 Super Knows which evidence beats which denial
Search Tavily, 5 queries in parallel The evidence layer
Pull quotes Nano, once per source Many small calls, verbatim only
Write the argument Nemotron 3 Ultra, thinking on The one step that wins or loses
Check citations Nano Each sentence against its quotes
Deadlines No model Plain federal rules

The app calls Ultra once per appeal. It calls Nano 14 times.

The API route streams every step and every model call to the browser as NDJSON, so you watch the agent work on a live timeline instead of staring at a spinner.

The numbers

These come from the three recorded runs in the repo's replays/ folder. I re-added them from the raw traces for this post.

Lumbar MRI Glucose monitor ER surgery
Model calls, incl. 5 searches 21 21 21
Nemotron spend $0.0098 $0.0091 $0.0076
Tavily spend $0.08 $0.08 $0.08
End-to-end time 23 s 22 s 21 s
Letter length 514 words 459 words 397 words
Citations supported 4 / 7 5 / 8 2 / 3

Two things surprised me.

The models are the cheap part. All the Nemotron calls together cost under a cent per appeal. Five advanced web searches cost 8 cents. If I wanted this cheaper, I'd cut searches, not models.

Ultra is one call but most of the model bill. On the MRI run, Ultra cost $0.0082 of the $0.0098. Nano handled about 70% of the tokens for about 12% of the spend. That split is the whole point of routing.

Overturn dashboard with days left, citations verified, sources and model cost

The part I care about: the agent checks itself

An appeal letter with a made-up citation is worse than no letter. The insurer's reviewer will check it, and then they stop trusting everything else you wrote.

So I added two guardrails.

Guardrail 1: quotes must be verbatim. When Nano reads each source, it keeps at most two facts, and each one must be copied word for word:

content: `From the source below, pull at most 2 facts that would help
the appeal. Each "quote" MUST be copied verbatim from the source.
If nothing is useful, return an empty list.
...
JSON only: {"facts":[{"claim": string, "quote": string}]}`,

Ultra then writes the letter from those quotes only, cited as [S1], [S2]. It never sees the open web.

Guardrail 2: a separate pass grades every cited sentence. After the letter is written, the code splits it into sentences, keeps the ones with an [S#], and hands each one to Nano with only the quotes from the sources it cites:

const sentences = splitSentences(letter)
  .map((s) => s.trim())
  .filter((s) => /\[S\d+\]/.test(s));
// ...for each: the sentence + the quotes behind its [S#] tags
// "supported" = evidence states it
// "partial" = evidence is related but the sentence overreaches
// "unsupported" = evidence does not say this

Here's a real catch from the ER surgery run. Ultra wrote:

Large outcome series report that 40% of patients are discharged at 2 days, with a median stay of 2.06โ€šร„รฌ2.7 days [S4][S5][S7][S8].

The checker marked it partial. Its note said the figures came from different datasets and the sentence blended them into one claim. That's exactly the kind of sentence a reviewer would pick apart, and the app underlines it amber so you fix it first.

Across all three runs: 11 supported, 7 partial, 0 unsupported. Nothing invented out of thin air, but more than a third of the cited sentences claimed more than their source said. I'd rather show you that number than hide it.

Evidence view with each source and the exact quotes pulled from it

Deadlines are code, not a model

I didn't want an LLM guessing legal deadlines. So the calendar is plain rules:

// Federal defaults. A deadline printed on the letter always wins.
const FILE_WINDOW: Record<DenialFacts["planType"], number> = {
  employer: 180,
  marketplace: 180,
  unknown: 180,
  medicare_advantage: 65,
  medicaid: 60,
};

The model only extracts facts from the letter: plan type, denial date, whether it's urgent, and any deadline printed on it. If the letter says a number, that number wins. Urgent cases get a 72-hour decision date. Everything else falls back to the federal default, and the app tells you to confirm it on your letter.

One click exports it all as an .ics file, with a reminder 7 days before each hard deadline.

Deadline calendar and timeline

What's not solved yet

I'd rather you hear it from me:

  • Live runs are slower and flakier than the recordings. The replays take 21 to 23 seconds. Runs on the hosted app have taken 31 to 79 seconds, mostly search latency. When I opened the live demo to write this post, one run stalled at the verify step with a network error. The app has no retry on that step yet.
  • "Partial" still ships. The checker flags overreach, but it doesn't rewrite the sentence. You have to.
  • US federal rules only. State-specific appeal rules and the many plan-specific windows aren't modeled. A deadline printed on your letter overrides the defaults, which is the safe direction.
  • No outcome data. I have no idea how many of these letters would win, because no real denial has gone through it. All three samples are fictional.
  • It can't know your medical history. That's on purpose. The blanks are the most important part of the letter, and only you and your doctor can fill them.

Try it

Two questions for the comments:

  1. Would you trust an AI-drafted appeal more if it showed you which of its own sentences overreached, or less?
  2. Have you ever appealed a denial? Insurance, a refund, a visa, anything. What was the hardest document to find?

I'm Rohit. I build tools for the person stuck with the paperwork: a scam reader for my mom, an order sheet for home bakers, and now a reply to your insurer. More on GitHub.

๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.