# hridaypradhan/claim-denial-triage-agent architecture

> Architecture diagram of the GitHub repository hridaypradhan/claim-denial-triage-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hridaypradhan/claim-denial-triage-agent
- Repository: https://github.com/hridaypradhan/claim-denial-triage-agent

## Overview

Claim Denial Triage Agent is an academic prototype for reviewing synthetic denied outpatient claims. A claim is parsed and routed through deterministic rules; when authorized, the bounded agent requests read-only evidence, proposes a disposition, and undergoes deterministic validation before a tool-less verification step and grounded appeal drafting. The result is assembled as a pending human-review package, never submitted automatically. The repository also includes a frozen baseline and a pilot/held-out evaluation harness. Runtime connections follow the README workflow; some internal orchestration is unsampled, so uncertain links are omitted.

Main entry points: [`src/claim_agent/agent/integrated_runtime.py`](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/integrated_runtime.py) (Integrated Runtime), [`evaluation/run_pilot.py`](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/run_pilot.py) (Pilot Runner), [`src/claim_agent/agent/router.py`](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/router.py) (Claim Router), [`src/claim_agent/tools/dispatcher.py`](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/dispatcher.py) (Tool Dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Claim Routing"]
  node_claim["Claim Parser<br/>[claim.py]"]
  node_rules["Baseline Rules<br/>[rules.py]"]
  node_router["Claim Router<br/>[router.py]"]
end

subgraph group_runtime["Bounded Agent Runtime"]
  node_contracts["Runtime Contracts<br/>[schema.py]"]
  node_integrated["Integrated Runtime"]
  node_hosted_factory["Hosted Client Factory<br/>[factory.py]"]
  node_hosted_client["Hosted Model Client<br/>[client.py]"]
end

subgraph group_evidence["Evidence and Safety"]
  node_dispatcher["Tool Dispatcher<br/>[dispatcher.py]"]
  node_knowledge[("Knowledge Store<br/>[knowledge_store.py]")]
  node_policy["Policy Retrieval"]
  node_deadline["Deadline Tool<br/>[deadline_tool.py]"]
  node_validator["Decision Validator<br/>[validator.py]"]
end

subgraph group_outcomes["Review Outcomes"]
  node_verifier["Proposal Verification<br/>[execution.py]"]
  node_drafting["Appeal Drafting<br/>[execution.py]"]
  node_draft_safety["Draft Safety Checks<br/>[drafting.py]"]
  node_package["Review Package<br/>[package.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_eval_data["Evaluation Data<br/>[pilot_data.py]"]
  node_eval_systems["Compared Systems<br/>[systems.py]"]
  node_eval_metrics["Scoring Metrics<br/>[metrics.py]"]
  node_eval_runner["Pilot Runner<br/>[run_pilot.py]"]
end

node_claimant(("Denied Claim"))
node_model{{"Hosted Model Service"}}
node_reviewer(("Human Reviewer"))

node_claimant -->|"submits claim"| node_claim
node_claim -->|"parses for"| node_rules
node_rules -->|"findings inform"| node_router
node_router -->|"authorizes agent"| node_integrated
node_integrated -.->|"uses hosted clients"| node_hosted_factory
node_hosted_factory -->|"builds client"| node_hosted_client
node_hosted_client -->|"sends model call"| node_model
node_integrated -->|"requests evidence"| node_dispatcher
node_dispatcher -->|"routes policy requests"| node_policy
node_policy -->|"reads snapshot"| node_knowledge
node_dispatcher -->|"reads snapshot"| node_knowledge
node_router -->|"checks deadline"| node_deadline
node_integrated -->|"validates proposal"| node_validator
node_validator -->|"passes safe proposal"| node_verifier
node_verifier -->|"approves appeal draft"| node_drafting
node_drafting -->|"checks grounded text"| node_draft_safety
node_integrated -->|"assembles result"| node_package
node_drafting -->|"provides accepted draft"| node_package
node_package -->|"presents pending review"| node_reviewer
node_eval_data -->|"provides cases"| node_eval_systems
node_eval_runner -->|"loads dataset"| node_eval_data
node_eval_runner -->|"runs predictions"| node_eval_systems
node_eval_runner -->|"scores predictions"| node_eval_metrics

click node_claim "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/baseline/triage/claim.py"
click node_rules "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/baseline/triage/rules.py"
click node_router "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/router.py"
click node_contracts "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/contracts/schema.py"
click node_integrated "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/integrated_runtime.py"
click node_hosted_factory "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/hosted/factory.py"
click node_hosted_client "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/hosted/client.py"
click node_dispatcher "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/dispatcher.py"
click node_knowledge "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/knowledge_store.py"
click node_policy "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/policy_retrieval.py"
click node_deadline "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/deadline_tool.py"
click node_validator "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/safety/validator.py"
click node_verifier "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/verification/execution.py"
click node_drafting "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/drafting/execution.py"
click node_draft_safety "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/safety/drafting.py"
click node_package "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/output/package.py"
click node_eval_data "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/pilot_data.py"
click node_eval_systems "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/systems.py"
click node_eval_metrics "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/metrics.py"
click node_eval_runner "https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/run_pilot.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_claim,node_rules,node_router,node_reviewer toneBlue
class node_contracts,node_integrated,node_hosted_factory,node_hosted_client toneAmber
class node_dispatcher,node_knowledge,node_policy,node_deadline,node_validator toneMint
class node_verifier,node_drafting,node_draft_safety,node_package toneRose
class node_eval_data,node_eval_systems,node_eval_metrics,node_eval_runner,node_claimant,node_model toneIndigo
```

## Components

### Claim Routing

- [Claim Parser](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/baseline/triage/claim.py): `baseline/triage/claim.py`
- [Baseline Rules](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/baseline/triage/rules.py): `baseline/triage/rules.py`
- [Claim Router](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/router.py): `src/claim_agent/agent/router.py`

### Bounded Agent Runtime

- [Runtime Contracts](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/contracts/schema.py): `src/claim_agent/contracts/schema.py`
- [Integrated Runtime](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/integrated_runtime.py): `src/claim_agent/agent/integrated_runtime.py`
- [Hosted Client Factory](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/hosted/factory.py): `src/claim_agent/agent/hosted/factory.py`
- [Hosted Model Client](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/hosted/client.py): `src/claim_agent/agent/hosted/client.py`

### Evidence and Safety

- [Tool Dispatcher](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/dispatcher.py): `src/claim_agent/tools/dispatcher.py`
- [Knowledge Store](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/knowledge_store.py): `src/claim_agent/tools/knowledge_store.py`
- [Policy Retrieval](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/policy_retrieval.py): `src/claim_agent/tools/policy_retrieval.py`
- [Deadline Tool](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/tools/deadline_tool.py): `src/claim_agent/tools/deadline_tool.py`
- [Decision Validator](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/safety/validator.py): `src/claim_agent/safety/validator.py`

### Review Outcomes

- [Proposal Verification](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/verification/execution.py): `src/claim_agent/agent/verification/execution.py`
- [Appeal Drafting](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/agent/drafting/execution.py): `src/claim_agent/agent/drafting/execution.py`
- [Draft Safety Checks](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/safety/drafting.py): `src/claim_agent/safety/drafting.py`
- [Review Package](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/src/claim_agent/output/package.py): `src/claim_agent/output/package.py`

### Evaluation

- [Evaluation Data](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/pilot_data.py): `evaluation/pilot_data.py`
- [Compared Systems](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/systems.py): `evaluation/systems.py`
- [Scoring Metrics](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/metrics.py): `evaluation/metrics.py`
- [Pilot Runner](https://github.com/hridaypradhan/claim-denial-triage-agent/blob/main/evaluation/run_pilot.py): `evaluation/run_pilot.py`

### Other components

- **Denied Claim**
- **Hosted Model Service**
- **Human Reviewer**

## Connections

- Denied Claim → Claim Parser: submits claim (evidence: `README.md`)
- Claim Parser → Baseline Rules: parses for (evidence: `src/claim_agent/agent/router.py`)
- Baseline Rules → Claim Router: findings inform (evidence: `src/claim_agent/agent/router.py`)
- Claim Router → Integrated Runtime: authorizes agent (evidence: `README.md`)
- Integrated Runtime → Hosted Client Factory: uses hosted clients
- Hosted Client Factory → Hosted Model Client: builds client (evidence: `src/claim_agent/agent/hosted/factory.py`)
- Hosted Model Client → Hosted Model Service: sends model call (evidence: `README.md`)
- Integrated Runtime → Tool Dispatcher: requests evidence (evidence: `README.md`)
- Tool Dispatcher → Policy Retrieval: routes policy requests (evidence: `src/claim_agent/tools/dispatcher.py`)
- Policy Retrieval → Knowledge Store: reads snapshot (evidence: `src/claim_agent/tools/policy_retrieval.py`)
- Tool Dispatcher → Knowledge Store: reads snapshot (evidence: `src/claim_agent/tools/dispatcher.py`)
- Claim Router → Deadline Tool: checks deadline (evidence: `src/claim_agent/agent/router.py`)
- Integrated Runtime → Decision Validator: validates proposal (evidence: `README.md`)
- Decision Validator → Proposal Verification: passes safe proposal (evidence: `README.md`)
- Proposal Verification → Appeal Drafting: approves appeal draft (evidence: `README.md`)
- Appeal Drafting → Draft Safety Checks: checks grounded text (evidence: `src/claim_agent/agent/drafting/execution.py`)
- Integrated Runtime → Review Package: assembles result (evidence: `README.md`)
- Appeal Drafting → Review Package: provides accepted draft (evidence: `README.md`)
- Review Package → Human Reviewer: presents pending review (evidence: `README.md`)
- Evaluation Data → Compared Systems: provides cases (evidence: `evaluation/systems.py`)
- Pilot Runner → Evaluation Data: loads dataset (evidence: `evaluation/run_pilot.py`)
- Pilot Runner → Compared Systems: runs predictions (evidence: `evaluation/run_pilot.py`)
- Pilot Runner → Scoring Metrics: scores predictions (evidence: `evaluation/run_pilot.py`)
