Back to Home

PolicyPilot

Health insurance-appeal platform that creates/sends citation-heavy appeal drafts for coverage denials using a multimodal RAG system.

Start: August 2025 • End: December 2025

Project Overview

PolicyPilot is an AI-powered advocacy platform designed to help patients who have been denied health insurance by automating the appeals process. It allows users to upload comprehensive policy documents and denial letters, which are processed by a Retrieval-Augmented Generation (RAG) pipeline to identify the specific clauses that invalidate the insurer's decision. It then drafts professional, citation-heavy appeal letters and manages the email correspondence loop with patient approval for each draft.

The motivation for this project originated during my Junior Capstone course with my teammates Mae Chen and Kate Jeong. Following the assassination of United Healthcare CEO, the tragedy highlighted a "broken" system where legitimate claims are frequently rejected, leaving patients feeling helpless against massive institutions. During our research, we discovered that in the United States, insurers deny roughly 19% of in-network claims, yet less than 0.1% of patients ever appeal. This discrepancy exists not because the denials are valid (data shows most appeals are successful) but because the process has the barrier of dense legal jargon and fragmented correspondence that overwhelms the primarily the "sandwich generation", caregivers in their 40's-50's managing health needs for both their children and aging parents.

Out of the team, I primarily handled the backend and the MongoDB database, including the storing of PDF documents in Supabase Storage. I developed the APIS and key features including complex term highlighting during the AI analysis of the denial given both the insurance policy document and denial letter. Mae Chen was the primary architect for the RAG pipeline, and Kate Jeong designed much of the UI.

Build Process

1) User Research & Discovery. Conducted interviews with patients denied health insurance (particularly caregivers) and healthcare providers, discovering that users wanted empowerment and privacy rather than a "black box" solution. This drove the decision to include approval gates. I also assisted with the RAG pipeline to ensure the quality of the generations created.

2) Product Design. From the data our interviews, we developed the user flow diagrams for our product and key features that would address issues our interviewees would bring up.

2) Architecture and UI Design. Developed the layout for the UI, design for the RAG pipeline, and created the system design of the backend, including MongoDB schema

3) System Integration. Developed the backend to handle file storage in Supabase Storage (to bypass MongoDB size limits) and spawn Python subprocesses for AI analysis.

4) Core Development (RAG Pipeline). Built the document processing engine using LangChain and ChromaDB to chunk policies and retrieve relevant context for the Gemini LLM.

5) Agent Automation. implemented the Gmail API and Google Cloud Pub/Sub to allow the system to send emails and listen for replies without polling, creating a seamless feedback loop.

Technology Stack

TypeScript Python LangChain Gemini 2.5 Pro API ChromaDB MongoDB React Node.js Gmail API Google Cloud Pub/Sub Supabase Storage Jira

Architecture & User Flow

Below are the system schema and user-flow diagrams used to guide the design and implementation.

Database / System Schema

PolicyPilot schema diagram

System Design

PolicyPilot system design diagram

User Flow (New Users / Onboarding)

PolicyPilot user flow diagram for new users

User Flow (After Login)

PolicyPilot user flow diagram after logging in

Key Features

Smart Policy Parsing

Users upload massive comprehensive policy documents (PDFs) once; the system extracts key metadata (insurer, plan limits) and associates it with multiple family members to avoid repetitive uploads.

Secure Document Ingestion

Direct-to-object-storage uploads (Supabase) with metadata persisted in MongoDB for reliable retrieval and auditing.

RAG-Powered Denial Analysis

The application uses vector search to find specific clauses in the user's policy that contradict the denial, translating legal/medical jargon into plain English with hover-tooltips for education.

Automated Email Agent

PolicyPilot drafts professional, citation-heavy appeal letters and sends them directly to the insurer from a dedicated agent account (policypilotco@gmail.com) on the user's behalf.

Automated Follow-ups

The system monitors for insurer replies from the PolicyPilot email. When a reply is received, the AI analyzes the response to determine if the appeal was won or if a follow-up argument is needed.

Challenges & Solutions

Challenge: Getting reliable, outputs from a RAG system on long, insurance policies where relevant clauses can be scattered and easy to miss.

Solution: We used a chunking + embedding + vector-retrieval pipeline (LangChain + ChromaDB) and tuned retrieval to pull the most relevant clauses, then constrained the LLM to ground claims in the documents they uploaded (insurance policy) to produce citations in the appeal draft.

Project Links