How pranjal-kukreja/trialguard works
TrialGuard is a point-of-care clinical-trial dose-change review system. A researcher submits a proposed action; the backend retrieves patient and protocol context, checks guardrails, obtains parallel compliance, safety, and financial assessments, reduces them to a recommendation, and presents a human decision that is audited. The README documents the domain flow; sampled source and the SOURCE INDEX support selected internal links. Some agent and orchestration internals were not sampled, so those edges rely on README statements rather than inferred code calls.
Main entry points: graph.py Workflow Runtime · a2a_server.py Agent Dispatcher · orchestrator.py Gateway API · intake-view.tsx Dose Intake
Components 21
Researcher Experience
- Dose Intake
apps/web/components/intake-view.tsx - Gateway API
apps/gateway/routers/orchestrator.py - Decision Console
apps/web/components/decision-gateway.tsx
Adjudication Workflow
- Workflow Runtime
apps/orchestrator/graph.py - Protocol Analysis
apps/orchestrator/nodes/protocol.py - Safety Guardrails
services/rag_service/src/safety/rule_engine_v3.py - Consensus Reducer
apps/orchestrator/nodes/protocol_adjudication.py - Human Decision Gate
apps/orchestrator/nodes/hitl.py - Audit Trail
apps/orchestrator/nodes/audit.py - Decision Report
apps/orchestrator/report_generator.py - Shared Workflow State
packages/shared-schemas/shared_schemas/state.py
Specialist Reviews
- Agent Dispatcher
apps/agent_master/a2a_server.py - Compliance Agent
apps/agent-compliance/server.py - Safety Agent
apps/agent-safety/server.py - Financial Agent
apps/agent-financial/server.py
Clinical Evidence
- Patient FHIR
apps/orchestrator/nodes/fhir_client.py - Evidence Pipeline
services/rag_service/src/pipeline_v3.py - Trial Retriever
services/rag_service/src/rag/retriever.py - Vector Store
services/rag_service/src/rag/vector_store.py - FHIR EHR
packages/mcp-ehr/src/mcp_ehr/fhir_client.py
Other components
- Researcher
Connections 21
- Researcher → Dose Intake: submits action
README.md - Dose Intake → Gateway API: sends request
- Gateway API → Workflow Runtime: starts workflow
- Workflow Runtime → Patient FHIR: loads patient
apps/orchestrator/graph.py - Patient FHIR → FHIR EHR: queries FHIR
- Workflow Runtime → Protocol Analysis: checks protocol
apps/orchestrator/graph.py - Workflow Runtime → Safety Guardrails: checks safety limits
README.md - Protocol Analysis → Evidence Pipeline: retrieves evidence
- Evidence Pipeline → Trial Retriever: retrieves clauses
services/rag_service/src/pipeline_v3.py - Trial Retriever → Vector Store: queries vectors
services/rag_service/src/rag/retriever.py - Workflow Runtime → Agent Dispatcher: dispatches reviews
README.md - Agent Dispatcher → Compliance Agent: requests review
README.md - Agent Dispatcher → Safety Agent: requests review
README.md - Agent Dispatcher → Financial Agent: requests review
README.md - Workflow Runtime → Consensus Reducer: combines verdicts
README.md - Consensus Reducer → Human Decision Gate: offers recommendation
README.md - Human Decision Gate → Decision Console: presents decision
README.md - Researcher → Decision Console: accepts or modifies
README.md - Workflow Runtime → Audit Trail: records decisions
README.md - Gateway API → Decision Report: generates report
apps/gateway/routers/orchestrator.py - Workflow Runtime → Shared Workflow State: uses workflow state
apps/orchestrator/graph.py