How ponnapatichandubhargav-cyber/med works
MedFlow AI is a clinical workflow system: users submit PDF reports, Excel lab results, or clinical notes, and receive a structured risk assessment and physician-review report. The documented workflow runs through planning, medical-data extraction and lab analysis, risk detection, and report generation. The README describes the five MCP agents and A2A orchestration; sampled source confirms the UI/process-manager entry, DAG execution, shared extraction tools, and registry. Several server implementations were not excerpted, so their documented capabilities are shown without inferring internal details.
Main entry points: orchestrator.py DAG Orchestrator · main.py Process Manager · llm_factory.py LLM Selector · app.py Streamlit UI
Components 27
User Workflow
- Streamlit UI
app.py - Process Manager
main.py
Clinical Agents
- Task Planner
mcp_servers/planner_server.py - Medical Reader
mcp_servers/medical_reader_server.py - Lab Analyzer
mcp_servers/lab_analyzer_server.py - Risk Detector
mcp_servers/risk_detector_server.py - Report Generator
mcp_servers/report_generator_server.py - Document & Lab Tools
mcp_servers/shared_tools.py
Coordination
- DAG Orchestrator
a2a/orchestrator.py - Task DAG
core/task_dag.py - A2A Message Bus
a2a/message_bus.py - Agent Registry
registry/agent_registry.py - Agent Supervisor
core/supervisor.py
Runtime Support
- LLM Selector
mcp_servers/llm_factory.py - LangGraph Workflow
core/graph.py - Clinical Nodes
agents/nodes.py - Agent Tools
agents/tools.py - Clinical State
core/state.py - Clinical Prompts
core/prompts.py - Audit Log
core/audit_log.py - Circuit Breaker
core/circuit_breaker.py - Dead Letter Queue
core/dead_letter_queue.py - MCP Validator
core/mcp_validator.py - Security Controls
core/security.py - Tracing
core/tracing.py - Idempotency
core/idempotency.py
Other components
- Clinician
Connections 31
- Clinician → Streamlit UI: submits files
README.md - Streamlit UI → Process Manager: starts analysis
app.py - Process Manager → Task Planner: requests plan
main.py - Task Planner → Task DAG: builds DAG
mcp_servers/planner_server.py - Process Manager → DAG Orchestrator: runs DAG
main.py - DAG Orchestrator → Agent Registry: resolves capabilities
a2a/orchestrator.py - DAG Orchestrator → Medical Reader: dispatches extraction
README.md - DAG Orchestrator → Lab Analyzer: dispatches analysis
README.md - DAG Orchestrator → Risk Detector: dispatches detection
README.md - DAG Orchestrator → Report Generator: dispatches reporting
README.md - Medical Reader → Document & Lab Tools: extracts PDF text
mcp_servers/medical_reader_server.py - Lab Analyzer → Document & Lab Tools: analyzes workbook
mcp_servers/lab_analyzer_server.py - Medical Reader → LLM Selector: uses model
mcp_servers/medical_reader_server.py - Task Planner → LLM Selector: uses model
mcp_servers/planner_server.py - Risk Detector → LLM Selector: uses model
mcp_servers/risk_detector_server.py - Report Generator → LLM Selector: uses model
mcp_servers/report_generator_server.py - DAG Orchestrator → A2A Message Bus: publishes messages
a2a/orchestrator.py - Process Manager → Agent Supervisor: starts agents
main.py - Agent Supervisor → A2A Message Bus: broadcasts recovery
core/supervisor.py - LangGraph Workflow → Clinical Nodes: runs nodes
core/graph.py - Clinical Nodes → Clinical Prompts: uses prompts
agents/nodes.py - Clinical Nodes → Agent Tools: calls tools
agents/nodes.py - LangGraph Workflow → Clinical State: reads and writes
core/graph.py - DAG Orchestrator → Circuit Breaker: uses resilience
a2a/orchestrator.py - DAG Orchestrator → Dead Letter Queue: uses queue
a2a/orchestrator.py - DAG Orchestrator → MCP Validator: validates calls
a2a/orchestrator.py - DAG Orchestrator → Security Controls: uses controls
a2a/orchestrator.py - DAG Orchestrator → Tracing: records traces
a2a/orchestrator.py - Process Manager → Idempotency: uses keys
main.py - Streamlit UI → Clinician: shows report
README.md - DAG Orchestrator → Audit Log: records audit
a2a/orchestrator.py