How don-gabriel/medgraph-sentinel works
MedGraph Sentinel generates a reproducible synthetic medical-tourism economy, loads its graph into Neo4j, and runs graph-based fraud detection to produce scored alerts. Investigators then use the console’s queue-to-case workflow to inspect an alert’s evidence subgraph and narration and record a disposition. The README documents detection and narration as offline build-time outputs; runtime serves committed alert and narration data. Some capability links are README-based because the relevant implementation was not sampled.
Main entry points: run.py Detection run · alerts.py Alert endpoints · AlertView.jsx Alert case view · App.jsx Console app
Components 30
Synthetic data
- Economy generator
generator/economy.py - Fraud overlays
generator/fraud.py - Scenario overlays
generator/scenario.py - Graph loader
loader/load.py - Neo4j graph
Fraud detection
- Detection run
detection/run.py - Rule helpers
detection/rules/impl/common.py - Ghost clinic rule
detection/rules/impl/ghost_clinic.py - Impossible travel rule
detection/rules/impl/impossible_travel.py - Kickback ring rule
detection/rules/impl/kickback_ring.py - Credential laundering rule
detection/rules/impl - Alert exports
detection/export.py
API and graph access
- FastAPI service
api/main.py - Alert endpoints
api/alerts.py - Entity endpoints
api/entities.py - Neo4j access
api/graph.py - Evidence subgraphs
api/subgraph.py - Narration build
api/narration/build.py - Narration fallback
api/narration/fallback.py - Optional live narration
api/narration/live.py
Investigator console
- Console app
frontend/src/App.jsx - API client
frontend/src/api.js - Alert case view
frontend/src/components/AlertView.jsx - Alert queue
frontend/src/components/AlertQueue.jsx - Evidence case file
frontend/src/components/CaseFile.jsx - Review disposition
frontend/src/components/Disposition.jsx - Subgraph canvas
frontend/src/components/SubgraphCanvas.jsx - Graph styling
frontend/src/lib/graphStyle.js - Evidence formatting
frontend/src/lib/format.js
Other components
- Investigator
Connections 40
- Economy generator → Fraud overlays: uses parameters
generator/economy.py - Scenario overlays → Economy generator: extends economy
generator/scenario.py - Scenario overlays → Fraud overlays: uses overlays
generator/scenario.py - Economy generator → Graph loader: writes dataset
- Graph loader → Neo4j graph: loads graph
README.md - Detection run → Neo4j graph: queries graph
README.md - Detection run → Ghost clinic rule: runs rule
- Detection run → Impossible travel rule: runs rule
- Detection run → Kickback ring rule: runs rule
- Detection run → Credential laundering rule: runs rule
- Ghost clinic rule → Rule helpers: uses helpers
detection/rules/impl/ghost_clinic.py - Kickback ring rule → Rule helpers: uses helpers
detection/rules/impl/kickback_ring.py - Detection run → Alert exports: exports alerts
README.md - Alert exports → Neo4j graph: committed alert data
README.md - Detection run → Narration build: builds narration
README.md - FastAPI service → Alert endpoints: mounts routes
api/main.py - FastAPI service → Entity endpoints: mounts routes
api/main.py - Alert endpoints → Neo4j access: queries graph
api/alerts.py - Entity endpoints → Neo4j access: uses access
api/entities.py - Neo4j access → Neo4j graph: reads and writes
README.md - Alert endpoints → Evidence subgraphs: builds evidence
api/alerts.py - Alert endpoints → Narration build: reads cache
api/alerts.py - Alert endpoints → Narration fallback: uses fallback
api/alerts.py - Alert endpoints → Optional live narration: optional narration
api/alerts.py - Investigator → Console app: reviews alerts
README.md - Console app → API client: requests data
frontend/src/App.jsx - Console app → Alert queue: renders queue
frontend/src/App.jsx - Console app → Alert case view: opens case
frontend/src/App.jsx - Alert case view → API client: fetches case data
frontend/src/components/AlertView.jsx - API client → FastAPI service: HTTP JSON
README.md - Alert case view → Subgraph canvas: renders evidence
frontend/src/components/AlertView.jsx - Alert case view → Evidence case file: shows evidence
frontend/src/components/AlertView.jsx - Alert case view → Review disposition: offers review
frontend/src/components/AlertView.jsx - Alert case view → Alert queue: uses status display
frontend/src/components/AlertView.jsx - Subgraph canvas → Graph styling: applies styles
frontend/src/components/SubgraphCanvas.jsx - Subgraph canvas → Evidence formatting: formats labels
frontend/src/components/SubgraphCanvas.jsx - Evidence case file → Evidence formatting: formats evidence
frontend/src/components/CaseFile.jsx - Evidence case file → Graph styling: uses graph styles
frontend/src/components/CaseFile.jsx - Alert queue → Evidence formatting: formats alerts
frontend/src/components/AlertQueue.jsx - Review disposition → Evidence case file: uses case content
frontend/src/components/Disposition.jsx