Inspiration

When we learned the contest topic was health, we reached out to friends and contacts in the health-care industry to ask what challenges they face. A friend working in the business side of a hospital responded quickly, saying health insurance is difficult for consumers and something they would like to see simplified.

Then it became personal. A friend recently visited a hospital and was billed twice for the same service. The payer didn't notice the duplicate billing, and the friend wasn't sure how to verify the charges and ended up paying more than necessary. No one involved in the friend's care was advocating for them, so we created a tool to help other patients.

Our friend is not the only one:

Statistic Explanation
14% of insured Americans have knowledge of all four key concepts: deductible, copay, coinsurance, and out-of-pocket limit
11% correctly estimated the cost of a 4-day hospitalization, given information about their insurance plan
58% of insured adults report problems with their health insurance
60% do not know they have the right to appeal
76% don't know what government agency to contact for assistance
\$220B+ of medical debt carried by people in the U.S.

The appeal gap is the most significant statistic. In 2024, ACA plans sold through HealthCare.gov denied about 85 million in-network claims and received at least 262,982 appeals from policyholders:

$$ \text{Appeal rate} \approx \frac{262{,}982}{85{,}000{,}000} \approx 0.3\% $$

That means 99 of every 100 denied claims were not appealed. Consumers are concerned about medical bills. One barrier is that the medical claims process uses a complicated language that most consumers don't understand. ClearClaim provides translation and other services to help consumers dispute bills.

Sources: Loewenstein et al., Journal of Health Economics (2013) · KFF Survey of Consumer Experiences with Health Insurance (2023) · KFF, Claims Denials and Appeals in ACA Marketplace Plans in 2024 · KFF, The Burden of Medical Debt in the United States

What it does

ClearClaim is an AI assistant that helps consumers with health care finance issues, including learning more about their coverage and advocating on their behalf to dispute incorrect charges.

  • Helps you review your benefits. You can upload a PDF or picture of your benefits document or copy and paste the text into ClearClaim. ClearClaim identifies your deductible, coinsurance, and out-of-pocket limit and provides easy-to-understand explanations.
  • Reviews medical bills. You can upload an Explanation of Benefits or other bill, including images taken with an iPhone in HEIC format. Gemini checks the information on your bills against your insurance policy to identify overcharges and duplicate charges and estimate correct charges. Bills you upload count toward your deductible, which keeps your coverage card current.
  • Understands your legal protections. The rules engine, not the AI, identifies legal protections available to you for services on the bill, including protections under the No Surprises Act (emergency services, nonemergency services by out-of-network providers at in-network facilities, air ambulance services), free preventive services, and duplicate charges. It also provides information on how to dispute the bill. Links to CMS and HealthCare.gov provide more information about your legal protections.
  • Assists in resolving billing issues. With one click, you can create a letter to dispute the bill and a script and guide for speaking with the billing department, which you can print or email.
  • Answers questions with tools. Ask questions such as "What would a \$3,000 MRI cost me?" Gemini helps you look up information about your health plan and benefits, review your health care bill, and use ClearClaim's cost calculator. ClearClaim's cost calculator, not Gemini, provides cost estimates. In this example, you have \$1,500 remaining on your annual deductible and 20% coinsurance:

$$ \text{You pay} = \underset{\text{remaining deductible}}{\underbrace{1{,}500}} + \underset{\text{coinsurance}}{\underbrace{0.20 \times (3{,}000 - 1{,}500)}} = 1{,}800 \text{ dollars} $$

In general, for a bill $B$, remaining deductible $D$, coinsurance rate $c$, and remaining out-of-pocket maximum $M$:

$$ \text{You pay} = \min\big(M,\; \min(B, D) + c \cdot \max(0,\, B - D)\big) $$

Every answer includes a "How I answered" section that lists the information used to answer the question.

No registration required. Each web browser automatically gets its own private account. ClearClaim states that it provides financial and administrative information, but not medical or legal advice.

How we built it

Layer Technology
Frontend React 19 and TypeScript using Vite, with a mobile-style UI that provides a native app experience
Backend Python and FastAPI, with Pydantic models for request and response data
AI Google Gemini for plan and bill image processing with structured output, embeddings for plan search, and chat with function calling
Data Supabase Postgres with pgvector, anonymous authentication, and row-level security
Testing 276 backend tests, all of which run offline

A bounded agent loop. The chat loop has upper bounds on iterations and tool use, plus a time limit:

$$ \text{rounds} \le 4, \quad \text{calls per round} \le 4, \quad t \le 60\,\text{s} \;\;\Longrightarrow\;\; \le 16 \text{ tool calls per question} $$

If the primary model has reached its usage limits, ClearClaim automatically switches to a secondary model.

Privacy without logins. Anonymous logins give every website visitor their own private account without a login page. Row-level security prevents other visitors from accessing a visitor's plans, bills, and messages. The backend never uses the Supabase admin key to access visitor data; each visitor's own login token is used instead.

Math and rules outside the AI. Cost calculations, deductible tracking, and patient-rights checks are written in plain Python, so the numbers and legal references are always accurate.

Offline demo mode. Without API keys, all app features still work. The app uses cached results for sample bills, local substitutes for embeddings, and letter templates, and every AI response is labeled as live or offline. Tests substitute a mock Gemini service that returns real Gemini response objects.

Challenges we ran into

  • LLMs perform poorly at math. Some initial responses included incorrect coinsurance calculations. We designed the cost calculator as a tool the LLM must call, and our app includes a note that "the AI never does the math."
  • Rights cannot be inferred. Allowing the model to make determinations about the No Surprises Act was risky. We did our own research using CMS and HealthCare.gov resources and built a rules engine from the findings. Gemini is used only to extract the facts those rules need: network status, emergency care, preventive services, and facility network status.
  • Gemini free tier limits. We exceeded the daily free-tier allowance for our primary model during testing and implemented a model failover process that switches to alternative models on 429 (limit exceeded) and 503 (busy) errors, even midway through a tool-calling exchange.
  • Private user data without authentication. We needed each user's data isolated from other users without requiring judges to create an account. Supabase anonymous authentication and row-level security met our needs. We also prevented one browser from creating multiple users and made sure session renewals don't cause data loss.
  • Configuration mismatches between frontend and backend. Supabase initially needed to be configured in two places, and mismatches prevented requests from working. We consolidated the configuration so the frontend gets its Supabase settings from a health endpoint on the backend.
  • Real bills are messy. They may be HEIC images or scanned PDFs, with missing information. The app displays unknown values as missing rather than defaulting them to zero.

Accomplishments that we're proud of

  • A tool-using AI agent with understandable responses for the user, rather than a black box.
  • A patient-rights engine with seven sourced rules that catches real surprise billing, including an out-of-network anesthesiologist at an in-network surgery center.
  • A complete path from a confusing bill to a ready-to-send dispute letter, which works even without access to the AI.
  • Private, separate data for each person without registration.
  • 276 passing tests and a demo that won't break, since each AI-dependent function has a clearly labeled offline fallback.

What we learned

  • The best AI apps use the model for language and reading, and plain code for math and rules.
  • Function calling needs strict limits (on rounds, calls per round, time, and input checks) to stay predictable.
  • Designing for failure conditions early (quota issues, timeouts, missing keys) made our demo far more reliable than adding it at the end would have.
  • Healthcare billing laws are more specific than we expected. For instance, ground ambulances aren't covered by the No Surprises Act, and ClearClaim tells users about this.
  • Row-level security plus anonymous authentication is a fast way to secure user data during a hackathon.

What's next for ClearClaim

  • Public access. Render and Vercel configurations are ready, so anyone can try the project from a link.
  • Accounts you can keep. Upgrade an anonymous session to a real account so your plan and bills follow you to other devices.
  • Greater protection. State surprise-billing laws, Good Faith Estimates for uninsured patients, and hospital charity care eligibility.
  • Cost information. Compare billed amounts with hospitals' published prices to identify overcharges.
  • Appeals monitoring. Deadlines, alerts, and status tracking for each dispute, to help raise that sub-1% appeal rate.
  • A mobile app and more languages, so the people most at risk of being confused by their bills can use ClearClaim in their preferred language.

Built With

Share this project:

Updates

Submission history