Inspiration

Health insurance claims today are slow, manual, and opaque, with adjudicators reading 50+ page policies under time pressure and customers getting cryptic rejection letters. HealthClaim AI demonstrates how agentic Gemini 3 systems can automate this workflow while remaining explainable, with a transparent ledger, explicit policy-clause citations, and a live chat interface to answer "Why was this claim denied?".

What it does

HealthClaim AI is a RegTech web app that replaces the manual work of a health insurance Claims Adjudicator. It ingests raw hospital bills and policy PDFs, verifies the claimant's identity with a liveness check, performs deep policy reasoning, and outputs an explainable verdict: Approved, Partially Approved, or Rejected.

The workflow is modeled as an agentic pipeline:

  • Intake: Upload hospital bill and policy (PDF/image); Gemini 3 Flash performs OCR and auto-extracts patient details to pre-fill forms.
  • Liveness: A webcam capture is sent to Gemini 3 Flash, which distinguishes a real human face from spoofs like photos, screens, or deepfakes.
  • Adjudication: Gemini 3 Pro reads 50+ page policy documents and detailed bills, cross-linking each charge (e.g., "Surgical Gloves") to coverage or exclusions (e.g., "Non-medical consumables") and calculating the final payable amount plus a Fraud Risk Score.
  • Decision & Explainability: The app shows the verdict, an itemized deduction ledger with clause citations (e.g., "Deducted ₹500 due to Clause 4.1"), a fraud gauge, and a chat agent ("Ask ClaimGuard") that lets users ask why a decision was made.

This design turns "black box" AI into a transparent, audit-ready decision system for insurers and regulators.

How we built it

  • Frontend: React 19 with TypeScript and Tailwind CSS, with a dark FinTech UI (black backgrounds, teal accents, glassmorphism) and framer-motion animations for step transitions, liveness scanning, and a "breathing" step tracker.
  • AI services (services/geminiSimulator.ts):
    • Gemini 3 Flash for low-latency OCR on bills and for liveness verification from webcam frames.
    • Gemini 3 Pro for adjudicateClaim (policy–bill reasoning, fraud scoring, JSON output) and sendChatQuery (chatbot that remembers adjudication context).
    • Hybrid mode: If an API key is present, the app calls Google's GenAI API; otherwise it falls back to a realistic simulation mode with artificial delays and mock data so the UX can be demoed without cost.
  • Key views:
    • Liveness.tsx: Uses navigator.mediaDevices.getUserMedia, draws to a hidden <canvas>, converts to Base64, and sends to the AI with a custom scanning frame animation.
    • Adjudication.tsx: Simulates a long-running reasoning process and streams back PolicyMetadata (sum insured, co-pay, room rent caps) via a callback as soon as they are parsed.
    • Decision.tsx: Renders the fraud risk gauge, verdict card, detailed deduction ledger, and the Ask ClaimGuard chat interface with local conversation history.
    • DevConsole.tsx: A terminal-style overlay that logs every AI action ("Identity Extraction", "Fraud Scan") to provide auditability for regulators and compliance teams.
  • Typing & data models (types.ts):
    • AdjudicationResult enforces a strict JSON contract (arrays of deductions, numeric amounts, structured verdict and fraud score) so the UI never depends on unstructured text.
    • PolicyMetadata captures key limits like room-rent caps and co-pay percentages extracted from the policy PDF.

Challenges we ran into

  • Gemini 3 Pro context window management: Fitting a 50+ page policy document plus a detailed bill into a single prompt required aggressive chunking and structured prompting strategies.
  • Liveness detection reliability: Distinguishing real faces from high-quality spoofs (printed photos, videos) using vision models alone proved challenging—we had to engineer specific prompt techniques asking the AI to look for depth cues and micro-movements.
  • JSON schema enforcement: Getting Gemini to consistently return valid, structured JSON (especially arrays of deductions with citations) required iterative prompt refinement and validation loops.
  • Real-time UX for long-running reasoning: Adjudication can take 15-30 seconds. We solved this by implementing progressive disclosure—streaming back PolicyMetadata as soon as it's parsed so users see progress immediately.
  • Fallback simulation mode: Building a realistic demo experience without API costs required carefully crafted mock data that mirrors real AI outputs, complete with artificial processing delays.

Accomplishments that we're proud of

  • Built a complete agentic pipeline: Not just a chatbot, but a true autonomous agent that orchestrates multiple specialized AI tasks (OCR, biometrics, reasoning, chat) in sequence.
  • Achieved explainability in AI decision-making: The deduction ledger with policy clause citations proves that RegTech AI can be transparent and auditable, not a black box.
  • Solved the "hallucination" problem for financial AI: By enforcing strict JSON schemas and citation requirements, we ensure every decision is grounded in the actual policy document.
  • Created a production-ready UX pattern: The progressive disclosure during long-running AI tasks, combined with the real-time DevConsole logs, sets a new standard for trust in AI-powered financial apps.
  • Hybrid demo architecture: The simulation mode allows anyone to experience the full workflow without API costs or rate limits, making the project accessible to judges and users worldwide.

What we learned

  • Prompt engineering is a first-class engineering discipline: Crafting prompts that reliably produce structured outputs requires the same rigor as writing code—version control, testing, and iteration.
  • Vision models can replace entire OCR pipelines: Gemini 3 Flash's multimodal capabilities eliminated the need for traditional OCR preprocessing, document alignment, and text extraction libraries.
  • Transparency builds trust in AI: Users are far more likely to accept AI decisions when they can see the reasoning, even if they disagree with the outcome. The DevConsole and citation ledger proved invaluable.
  • Agentic workflows need state management: Passing context between multiple AI calls (intake → liveness → adjudication → chat) required careful design of data flow and error handling.
  • Simulation modes democratize AI demos: Not everyone has API credits or wants to share their API keys. Building a realistic fallback mode made the project accessible to a wider audience.

What's next for HealthClaim AI

  • Integration with real insurance systems: Connect to actual policy databases and hospital billing APIs for live claim processing.
  • Multi-lingual support: Expand beyond English to support claims in Hindi, Spanish, and other languages, leveraging Gemini's multilingual capabilities.
  • Advanced fraud detection: Incorporate anomaly detection models that flag suspicious patterns (e.g., duplicate claims, inflated charges, phantom billing).
  • Appeal workflow: Allow users to challenge denied claims with additional evidence, triggering a re-adjudication with human oversight.
  • Regulatory compliance dashboard: Build a compliance module that tracks adherence to insurance regulations (HIPAA, ACA, state-specific mandates) and generates audit reports.
  • Mobile app: Develop iOS and Android apps with on-device liveness detection for faster, privacy-preserving verification.
  • Enterprise partnerships: Pilot the system with mid-sized insurance carriers and TPAs (Third-Party Administrators) to gather real-world feedback and refine the product.
  • Open-source components: Release the prompt templates and UI patterns as open-source libraries to accelerate RegTech innovation in the broader developer community.

Built With

Share this project:

Updates