How priyanshuiitghy2006/claim-contest works
Claim Contest audits health-insurance deductions against policy wording and regulations, then returns verified evidence, deterministic recoverable amounts, and grievance actions. The user uploads and confirms claim documents or selects a saved case; the agent gathers case and rule evidence, invokes backend tools, and submits verdicts through a citation/calculation gate. The backend handles document ingestion, search, rules, calculators, precedents, and saved results; the frontend presents the audit and action centre. The README documents these capabilities; several backend routes and frontend components were not sampled, so their internal wiring is not inferred.
Main entry points: main.py FastAPI application · server.ts Agent API · runner.ts Analysis runner · api.ts Frontend API client
Components 26
Claim experience
- Claim UI
frontend/app/case/[id]/page.tsx - Upload flow
frontend/app/upload/page.tsx - Claims dashboard
frontend/app/dashboard/page.tsx - Frontend API client
frontend/lib/api.ts - Evidence and verdict views
frontend/components/EvidencePanel.tsx - Grievance actions
frontend/components/ActionCentre.tsx
Audit agent
- Agent API
agent/src/server.ts - Analysis runner
agent/src/runner.ts - LLM tool agent
agent/src/llm/agent.ts - Backend tools
agent/src/llm/tools.ts - Backend client
agent/src/backend.ts - Citation gate
agent/src/gate.ts - Letter drafting
agent/src/draft.ts - Analysis event store
agent/src/store.ts
Analysis services
- FastAPI application
backend/app/main.py - PDF prefill
backend/app/services/ingest.py - Policy search
backend/app/services/search.py - Rules and verification
backend/app/services/rules.py - Deterministic calculators
backend/app/services/calculators.py - Ombudsman precedents
backend/app/services/precedents.py - Case service
backend/app/services/cases.py - Saved analyses
backend/app/services/store.py
Claim records
- Claim data schemas
backend/app/models/schemas.py - SQLite database
backend/app/db.py
Other components
- Claimant
- LLM provider
Connections 31
- Claimant → Upload flow: uploads claim
README.md - Claimant → Claim UI: reviews audit
README.md - Upload flow → Frontend API client: submits documents
README.md - Frontend API client → Agent API: calls REST/SSE
README.md - Frontend API client → FastAPI application: calls REST
- Agent API → Analysis runner: starts analysis
agent/src/server.ts - Agent API → Backend client: creates client
agent/src/server.ts - Analysis runner → LLM tool agent: runs session
agent/src/llm/agent.ts - LLM tool agent → Backend tools: registers tools
agent/src/llm/agent.ts - Backend tools → Backend client: calls backend
agent/src/llm/tools.ts - Backend client → FastAPI application: requests analysis data
README.md - LLM tool agent → Citation gate: records evidence
agent/src/llm/agent.ts - Analysis runner → Citation gate: validates submission
agent/src/runner.ts - Citation gate → Analysis runner: returns gate result
agent/src/runner.ts - Analysis runner → Analysis event store: records events
agent/src/runner.ts - Agent API → Letter drafting: serves letters
agent/src/server.ts - Letter drafting → Backend client: loads analysis data
agent/src/draft.ts - FastAPI application → PDF prefill: prefills uploads
- FastAPI application → Policy search: searches policy text
README.md - FastAPI application → Rules and verification: checks regulations
README.md - FastAPI application → Deterministic calculators: computes amounts
- FastAPI application → Ombudsman precedents: finds awards
README.md - FastAPI application → Case service: serves saved cases
- FastAPI application → Saved analyses: stores analyses
- FastAPI application → Claim data schemas: validates payloads
- FastAPI application → SQLite database: initializes database
backend/app/main.py - Claim UI → Frontend API client: loads audit data
- Claims dashboard → Frontend API client: loads claims
- Claim UI → Evidence and verdict views: shows evidence
- Claim UI → Grievance actions: offers grievance actions
- Agent API → LLM provider: runs model agent
README.md