An AI-powered platform that decodes insurance denials, fetches live regulations, and generates ready-to-send appeal letters β in under 20 seconds.
Insurance denial letters are deliberately opaque. They contain codes like CO-197, dates, and legal citations that most patients have never seen before. Without knowing what those codes mean, which laws apply to their specific plan, and what steps to take within which deadlines, most patients simply give up β leaving billions of dollars in legitimate claims unpaid every year.
Resolvly takes the documents a patient already has β a denial letter, an Explanation of Benefits (EOB), and a medical bill β and turns them into a complete action plan. It live-looks up every code against authoritative federal sources (CMS, NPPES), fetches the exact regulations that apply to the patient's plan type, calculates the deadlines they're racing against, and writes the appeal letter for them. No legal knowledge required.
- Python 3.11+
- Node.js 18+
- At least one LLM API key: Groq (recommended, free) or Google Gemini
- Docker (optional, for containerized deployment)
cd backend
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Create .env from the example
cp .env.example .env
# Add your GROQ_API_KEY or GEMINI_API_KEY to .env
uvicorn main:app --reload
# API available at http://localhost:8000
# Swagger docs at http://localhost:8000/docscd frontend
npm install
npm run dev
# App available at http://localhost:5173cp backend/.env.example backend/.env
# Add your GROQ_API_KEY or GEMINI_API_KEY to backend/.env
docker-compose up --build
# Frontend β http://localhost
# Backend β http://localhost:8000
# API docs β http://localhost:8000/docsCommon commands: docker-compose logs -f Β· docker-compose down Β· docker-compose up --build (after code changes)
A patient uploads three documents, answers two questions about their plan, and clicks Begin Forensic Analysis. What happens next is a multi-stage pipeline that runs in about 15 seconds.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER β
β β
β 1. Upload documents: Denial Letter + EOB + Medical Bill β
β 2. Answer 2 questions: Plan type? ERISA or Fully Insured? β
β 3. Click: Begin Forensic Analysis β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 1 β DOCUMENT INTAKE β
β β
β Each PDF is opened and text is extracted. β
β Digital PDFs β direct text extraction β
β Scanned PDFs / Images β flagged for client-side OCR β
β β
β Three documents are stitched into ONE unified record β
β using authority rules: β
β Denial letter β owns: claim ID, appeal deadlines β
β EOB β owns: billing codes, financial amounts β
β Medical bill β owns: facility name, itemized charges β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 2 β ENTITY EXTRACTION β
β β
β Pass 1 β Regex (free, instant): β
β Extracts codes (ICD-10, CPT, CARC, NPI), dates, amounts, β
β claim numbers, prior auth status β
β β
β Pass 2 β LLM (contextual): β
β Extracts names, narratives, denial reasons, labeled amounts, β
β appeal contact info β things regex can't reliably find β
β β
β Output: A structured ClaimObject with every field populated β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 3 β ORCHESTRATED ANALYSIS β
β β
β Pre-step: Root cause is classified FIRST so the regulation β
β agent knows what laws to pull (e.g. CMS coverage database β
β is only needed for medical necessity denials). β
β β
β Then three agents run in PARALLEL: β
β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β CODE LOOKUP β β REGULATION β β STATE RULES β β
β β AGENT β β AGENT β β AGENT β β
β β β β β β β β
β β Looks up every β β Fetches the β β Gets the state β β
β β code live: β β exact federal β β DOI contact, β β
β β β’ ICD-10 βCMS β β laws that apply:β β external review β β
β β β’ CPT βCMS β β β’ ERISA plans ββ β process, and β β
β β β’ CARC βWPC β β DOL Β§503 β β whether the β β
β β β’ RARC βWPC β β β’ ACA plans β β β state DOI or β β
β β β’ NPI βNPPES β β Β§2719/eCFR β β federal ERISA β β
β β (web fallback β β β’ Medicaid β β β rules govern β β
β β for unfound) β β 42 CFR 431 β β this claim β β
β β β β β’ Med necessityβ β β β
β β β β β CMS NCD DB β β β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ β
β βββββββββββββββββββββ¬β΄ββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ANALYSIS AGENT (sequential) β β
β β β β
β β β’ Root cause: Why was this denied? (6 categories) β β
β β β’ Completeness: Did the denial letter meet ACA/ERISA β β
β β required elements? β β
β β β’ Deadlines: When must the appeal be filed? β β
β β β’ Probability: How likely is the appeal to succeed? β β
β β β’ Severity: Urgent / Time-Sensitive / Routine β β
β β β’ Assumptions: What the system assumed, with impact β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 4 β OUTPUT GENERATION β
β β
β LLM takes the enriched claim + analysis and generates: β
β β
β Plain-English summary β What happened, in plain English β
β Action checklist β Numbered steps + legal "why" β
β Appeal letter β Formal letter with citations β
β Provider message β Request to billing office β
β Insurer message β Message to member services β
β Provider brief β One-pager for treating physician β
β Routing card β ERISA vs. state DOI guidance β
β β
β All outputs are cached in the browser so navigating between β
β pages is instant β no repeat LLM calls. β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 5 β RESULTS TO USER β
β β
β Action Plan dashboard: β
β β’ Denial summary with key points β
β β’ Approval probability gauge β
β β’ Recovery roadmap (prioritized steps) β
β β’ Critical deadlines with one-click calendar (.ics) export β
β β’ Denial notice completeness checklist β
β β’ Regulatory routing card (who to contact) β
β β’ Bill breakdown (billed / paid / denied) β
β β
β Appeal Drafting: β
β β’ Ready-to-send appeal letter β
β β’ Provider and insurer messages β
β β’ PDF download β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββ
β ORCHESTRATOR β
ββββββββββ¬ββββββββββ
β
ββββββββββββββΌββββββββββββββ
β Stage 0: Pre-classify β
β root cause (Why denied?)β
β β so regulation agent β
β knows what to fetch β
ββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββ
β β β
ββββββββΌβββββββ βββββββββΌβββββββ βββββββββΌβββββββ
β CODE LOOKUP β β REGULATION β β STATE RULES β
β AGENT β β AGENT β β AGENT β
β β β β β β
β Live APIs: β β Live APIs: β β Live data: β
β CMS ICD-10 β β eCFR.gov β β State DOI β
β CMS HCPCS β β DOL ERISA β β contacts β
β NPPES NPI β β ACA Β§2719 β β (50 states) β
β WPC CARC/ β β CMS Coverage β β β
β RARC tables β β Database β β β
ββββββββ¬βββββββ βββββββββ¬βββββββ βββββββββ¬βββββββ
β (all 3 run simultaneously) β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β enriched ClaimObject
ββββββββββββββΌββββββββββββββ
β Stage 2: ANALYSIS β
β AGENT (sequential) β
β β
β β’ Root cause (final) β
β β’ Deadlines β
β β’ Completeness β
β β’ Probability β
β β’ Severity triage β
ββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββΌββββββββββββββ
β OUTPUT AGENT β
β (LLM: Groq β Gemini) β
β β
β Generates all letters, β
β summaries, checklists β
ββββββββββββββββββββββββββββ
The system never uses a local knowledge base for regulatory or code data. Everything is fetched live from authoritative sources at the time of analysis.
| What | Source | Why live? |
|---|---|---|
| ICD-10 diagnosis codes | CMS / NLM ICD-10-CM API | Codes update annually |
| CPT / HCPCS procedure codes | CMS / NLM HCPCS API | AMA updates quarterly |
| CARC / RARC denial codes | WPC reference table (local) | No public API exists |
| Provider (NPI) lookup | NPPES NPI Registry API | Provider data changes |
| Federal regulations (ERISA, ACA, Medicaid) | eCFR.gov API | Regulations change |
| ERISA Β§503 appeal rules | DOL EBSA reference | Plan-specific rules |
| ACA Β§2719 internal/external review | eCFR 45 CFR Β§147.136 | Key appeal timelines |
| Medicaid fair hearing rules | eCFR 42 CFR Β§431.220 | State variation exists |
| CMS National Coverage Determinations | CMS Coverage Database | Med-necessity denials only |
| State DOI contacts | Static JSON (50 states) | Rarely changes |
| Unfound codes | Google Custom Search | Last-resort fallback |
Each piece of information collected across the three parallel agents is merged into a single enrichment object that the Analysis Agent and Output Agent then consume:
Code Lookup results ββ
ββββΆ Enrichment Dict βββΆ Analysis Agent
Regulation results ββ€ βββΆ Output Agent (LLM)
β βββΆ Frontend dashboard
State Rules results ββ
Code enrichment adds plain-English descriptions, common fixes, and source citations to every code found in the documents β the LLM uses these when writing the appeal letter so it can say "code CO-197 means prior authorization was not obtained" rather than just quoting the code.
Regulation enrichment determines the exact appeal process steps, deadlines, and whether external review is available. An ERISA plan has a 60-day minimum internal appeal window; an ACA marketplace plan has 180 days. These are not hardcoded β they come from the live regulation text.
State rules enrichment determines the routing: does this claim go to the federal DOL (ERISA), the state Department of Insurance, or a Medicaid agency? It pulls the correct contact, complaint URL, and external review process for that state.
The Analysis Agent then uses all of this β plus the ClaimObject β to produce quantified outputs: a 0β100% probability score, exact deadline dates, and a severity flag. These flow into the Output Agent which combines everything into human-readable content.
- Upload up to 3 documents (PDF, JPG, PNG): Denial Letter, EOB, Medical Bill
- Automatic text extraction from digital PDFs
- Scanned PDF / image detection with client-side OCR fallback
- Multi-document stitching: fields from different documents are merged using authority rules
- Live lookup of all ICD-10, CPT, HCPCS, CARC, RARC, and NPI codes found in documents
- Plain-English explanations for every code
- "Common fix" guidance for denial codes
- Source citation (CMS, NLM, NPPES, WPC)
- Automatic ERISA vs. ACA vs. Medicaid routing based on plan type
- Live federal regulation text from eCFR.gov
- CMS National Coverage Determination lookup for medical necessity denials
- Full 50-state DOI contact database
- Root cause classification β 6 categories: medical necessity, prior auth, coding error, network, eligibility, procedural
- Denial letter completeness check β field-by-field audit against ACA Β§2719 / ERISA Β§503 required elements
- Appeal probability score β 0β100% likelihood of success based on root cause, completeness, and regulatory context
- Deadline calculation β exact dates for internal appeal, external review, and expedited review (72h)
- Severity triage β Urgent / Time-Sensitive / Routine based on deadline proximity and denied amount
- Assumptions panel β explicit list of what the system assumed, with confidence and impact levels
- Plain-English denial summary β written at patient reading level with key points
- Recovery roadmap β numbered action steps with "why is this required?" expandable explanations
- Appeal letter β formal letter to insurer citing applicable regulations and clinical facts
- Provider message β request to the billing office (retroactive auth, corrected codes, etc.)
- Insurer message β message to member services
- Provider brief β one-page summary for the treating physician to support the appeal
- Regulatory routing card β which regulator governs this plan, who to contact, exact process steps
- PDF download β appeal letter, provider brief, or denial summary exported as formatted PDF
- Calendar export (.ics) β add appeal deadlines directly to Google Calendar, Outlook, or Apple Calendar with 30-day and 7-day reminders
- Docker support β containerized deployment with docker-compose for full stack
- SSE streaming endpoint for progressive rendering (backend ready)
- Session-level output caching β navigating between pages is instant; no LLM calls repeated
- Appeal letter prefetching β background fetch so Appeal Drafting page opens immediately
- Smart LLM fallback chain:
- Cloud: Groq 70B β Groq 8B β Gemini 2.5 Flash β Gemini 2.5 Flash Lite
- Local: Groq β Gemini β Ollama (instant fallback, no retries)
- Rate limiting β sequential LLM calls with priority queuing to avoid 429 errors
- Health checks β
/healthendpoint for monitoring and auto-restart
The system uses LLMs for three specific tasks only:
- Pass 2 extraction β extracting contextual entities (names, narratives, labeled amounts) that regex cannot reliably find
- Root cause disambiguation β when heuristics are not confident enough (< 75%), an LLM is called to classify the denial reason
- Output generation β writing the appeal letter, summary, action checklist, and provider brief
All code lookups, regulation fetches, deadline calculations, completeness checks, probability estimation, and routing logic are deterministic β no LLM involved. This keeps costs low and results auditable.
- Connect your GitHub repository to Render
- Create new Web Service
- Configure:
- Root Directory:
backend - Runtime: Docker
- Health Check Path:
/health
- Root Directory:
- Add environment variables (see
backend/.env.example) - Deploy
See DEPLOYMENT_GUIDE.md for detailed instructions.
- Import your GitHub repository to Vercel
- Configure:
- Root Directory:
frontend - Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist
- Root Directory:
- Deploy
The vercel.json file will be auto-detected.
# Build and start both services
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop services
docker-compose downSee DOCKER_SETUP.md for detailed instructions.
- No database β results are only available for the current browser session
- Scanned document OCR β requires client-side processing; server does not run OCR
- Indiana-first β state-specific resources are most complete for Indiana (IDOI); all 50 states have DOI contacts but regulatory depth varies
- Not legal advice β outputs are for informational purposes; patients should consult a patient advocate or attorney for complex cases