ClaimsRAG//Pro Repo
agentic · offline-first · graphRAG

Ask hard questions
of healthcare denials.

ClaimsRAG Pro is a production-oriented RAG pipeline over claim-denial data. An agentic router sends each question to hybrid vector retrieval or a GraphRAG knowledge graph, self-reflects when confidence is low, and answers only from grounded evidence. This page is an interactive simulation of that system.

300 claims7 payers9 departments10 denial reasons vector + graph
answers served
1,284
p95 latency
126ms
throughput
214/min
denials.csv · live tail
streaming
claimpayer · deptamountstatus
C000000Aetna · Ophthalmology$157Denied
C000001Medicaid · Orthopedics$2,849Paid
C000002Humana · Oncology$2,968Denied
C000003Humana · Ophthalmology$1,349Denied
C000004Medicaid · Oncology$782Pending
C000005Humana · Gastroenterology$107Pending
300 rows indexedvector + graph rebuilt on ingest
the system

A miniature data platform for denial analytics

Not a single-row lookup tool. The engine is always running: claims stream through and pulse the bars in real time. Cross-filter the live dataset by reason, department, payer, and status, watch it re-process, inspect the matching claims, and flag any for human review. It's the same grounded aggregation the pipeline runs to answer questions.

status
filtersnone, click a bar to add
liveprocessed 0 · matched 300/300
Claims in view
300
100% of dataset
Distinct reason
10
graph nodes
Billed in view
$741,701
avg $2,472
Top reason
Out of network
41 · 14%

Reason distribution

click to filter

matching claims

C000183United·Cardiology$4,996
C000019Humana·Cardiology$4,988
C000242United·Cardiology$4,963
C000222Blue Cross·Dermatology$4,952
C000011Aetna·Oncology$4,951
C000149Aetna·Ophthalmology$4,942
C000041Cigna·Cardiology$4,936
C000133Medicare·Orthopedics$4,898
C000080Medicare·Oncology$4,893

showing 9 of 300, ⚑ flags a claim for review

Continuous ingestion

A watchdog daemon validates each new CSV, de-dupes on claim_id, and rebuilds the vector + graph indexes.

GraphRAG

A NetworkX graph links payers, departments, statuses, and denial reasons for multi-hop reasoning.

Agentic routing

A heuristic (optionally LLM) router sends each question to the vector or graph engine.

Self-reflective retrieval

On low confidence it rewrites the query with extracted constraints and retries via the graph.

Async batch

An asyncio runner answers large question sets concurrently with latency metadata.

the pipeline

From a raw CSV to a grounded answer

Watch one question travel the whole system: a new file is ingested and validated, de-duplicated, then routed. Hybrid retrieval runs first, and when its confidence is low, the agent reflects, rewrites the query, and falls back to the graph before synthesizing an answer that cites only real rows.

  • 01 Continuous ingestion rebuilds both indexes on every new file.
  • 02 The agentic router chooses vector or graph per question.
  • 03 Self-reflection catches weak retrievals instead of hallucinating.
  • 04 Answers are deterministic and grounded in evidence.

Live pipeline · a question's journey

Why are cardiology claims denied most often?

Ingest · watchdog01 / 08
watchdog · data/ directory
denials_2024_11.csv
detected · 42 new rows · 9 columns

A new claims file lands; the daemon picks it up automatically. No manual trigger.

interactive · drag to orbit

The denial embedding space

Every dot is a real claim, positioned by its embedding. Semantically similar claims sit together and cluster by department. Ask a question; its vector lands in the space, a radar sweep fires, and curved arcs trace the nearest neighbors the retriever hands to the synthesizer.

Cardiology Oncology Ophthalmology Dermatology Pediatrics Gastroenterology Radiology Orthopedics Neurology query

query vector

Why are cardiology claims denied?

retrieved · nearest 6

  • [1]C000068 · Duplicate claimPending0.10
  • [2]C000177 · Coding errorDenied0.28
  • [3]C000097 · Medical necessityPaid0.34
  • [4]C000119 · Expired coveragePending0.62
  • [5]C000114 · Out of networkAppealed0.73
  • [6]C000251 · Duplicate claimPaid1.01

grounded answer

Nearest neighbors in Cardiology are dominated by Duplicate claim (6 of 37 · 16%).

Distances are true Euclidean nearest-neighbor over the embedding. Production swaps this for dense vectors (BGE / E5) in a FAISS / HNSW index, fused with BM25 via RRF.

graphRAG · click to traverse

The payer knowledge graph

Vector search can't answer “how are these connected?”. The graph index links every payer to the departments it sees denials in and the reasons behind them. Pick a payer; click a department to traverse the multi-hop path PAYER → DEPARTMENT → REASON.

payers

click a department node

Oncology8 claimsDermatology8 claimsOphthalmology5 claimsOrthopedics4 claimsRadiology4 claimsBundled service7Invalid CPT6Timely filing4Coding error4Out of network4Expired coverage4AetnaPAYERSEES_DENIALS_INDENIED_FOR

Aetna sees denials across 5 departments; leading reason overall is Bundled service. Click a department to traverse deeper.

chatbot · a claims CLI

Interrogate the denials

The same pipeline, at your fingertips. Ask in plain English; watch the router pick an engine, reflect when unsure, and answer from real rows. Nothing is invented; every number is recomputed live.

claims@ragpro:~/ClaimsRAG-HM● ready
ClaimsRAG Pro · claims terminal v1.0
300 claims · 7 payers · 9 departments · offline-first
Type a question, or `help`. Try: claims ask "Why are cardiology claims denied most often?"
claims@ragpro$
try:
security & governance

Grounded is not enough. It has to be safe.

Claims data is PHI. ClaimsRAG is offline-first: identifiers are de-identified before anything reaches a model, every answer passes input and output guardrails, quality is measured by evals, and the data never leaves your network perimeter. Explore each control below.

record C000006
raw record · stays in your vault
what the model sees
claim_id: C000006
claim_id: C000006
patient_id: P16115
patient_id: pt_fd9b1a
patient_age: 83
patient_age: 80-89
service_date: 2023-07-31
service_date: 2023
payer: Cigna
payer: Cigna
department: Neurology
department: Neurology
amount: $1,738
amount: $1,738
denial_reason: Missing info
denial_reason: Missing info
status: Denied
status: Denied

3 PHI fields tokenized or generalized before the model. The reversible mapping lives only in your vault; the model answers from de-identified context and never sees raw identifiers.

SYSTEM ONLINE
ingest ▸ C000159 merged · dedup ok graph ▸ United → Cardiology retrieve ▸ top-5 · fused 0.91 · 108ms reflect ▸ conf 0.27 → graph route ▸ vector · conf 0.85 guardrail ▸ output clean · cited redact ▸ pt_d75e5 tokenized guardrail ▸ output clean · cited synth ▸ Pediatrics answer · 54ms synth ▸ Pediatrics answer · 53ms redact ▸ pt_42392 tokenized synth ▸ Neurology answer · 113ms graph ▸ Humana → Neurology eval ▸ PASS · grounded denied ▸ Aetna · Expired coverage route ▸ vector · conf 0.86 ingest ▸ C000159 merged · dedup ok graph ▸ United → Cardiology retrieve ▸ top-5 · fused 0.91 · 108ms reflect ▸ conf 0.27 → graph route ▸ vector · conf 0.85 guardrail ▸ output clean · cited redact ▸ pt_d75e5 tokenized guardrail ▸ output clean · cited synth ▸ Pediatrics answer · 54ms synth ▸ Pediatrics answer · 53ms redact ▸ pt_42392 tokenized synth ▸ Neurology answer · 113ms graph ▸ Humana → Neurology eval ▸ PASS · grounded denied ▸ Aetna · Expired coverage route ▸ vector · conf 0.86
p95 128ms