Inspiration

After undergoing a costly laparoscopic appendectomy last summer, Alex was struck by the unreasonableness of hospital bills. Items like painkiller prescriptions and IV bags seemed dramatically overpriced; without insurance, the costs might have been more absurd. Inspired by the power of insurance companies and the Affordable Care Act to negotiate these prices down to market price(a competitive price for the region), we set out to create an agentic system that carries these negotiations out for individuals beset by outrageous and erroneous bills.

What it does

The user first creates their account with some basic information to use later to see if they qualify for financial aid. After submitting a request for and receiving an itemized bill from the hospital, the user will upload it and our agents will search for the market price, identifying overcharges and allowing the user to manually choose which items to contest. An email to the providers is then generated based on the contested charges, and can be sent within the website. Users will also be sent notifications when emails are received and the software will autodraft negotiation strategies throughout the process.

How we built it

Architecture

  • Monorepo with Turborepo and pnpm
  • Next.js 16 App Router for API routes and frontend
  • Shared TypeScript packages for code reuse

AI pipeline

  • Google Gemini 3 Flash for multimodal extraction (bill images/PDFs → structured data)
  • Anthropic Claude for market price research from medical databases
  • Fallback between AI providers for reliability
  • Zod for end-to-end schema validation
  • Google Gemini 3 Pro for Generating Medical Negotiation Email

Backend

  • Supabase (PostgreSQL) with JSONB for flexible analysis storage
  • Binary file storage for original documents
  • Parallel processing for performance
  • Statistical calculations for severity classification

Data processing

  • Document parsing from images and PDFs
  • Market price comparison against medical databases
  • Filtering to identify actionable overcharges
  • Severity classification based on statistical confidence

Frontend

  • CSS Modules for styling
  • Client-side state management
  • Real-time results display

System design

  • Shared type definitions across packages
  • Modular package structure for maintainability
  • Type-safe communication between services
  • End-to-end validation pipeline ## Challenges we ran into As we researched deeper into the process, we discovered that we kept needing to add new fields to our database. We ran 9 database migrations across the course of the hackathon! ## Accomplishments that we're proud of We are proud of the amount of features we were able to implement in such a short amount of time. We did this by breaking the problem into components and tackling each aspect of the problem throughout the hack. We were able to cover market price analysis, financial aid checks, massive UI overhauls, database updates, email sends, confidence interval calculation, and more. ## What we learned We learned about pub sub, connection with email, and the healthcare negotiation process. ## What's next for FairCharge An aid application portal is in the works. We are also considering adding text message notifications and support for iOS. Additionally, we are considering adding an option to invoke the No Surprises Act.

Built With

Share this project:

Updates