How imyangc7/lungnoduleagent works
LungNoduleAgent turns CT cases into AIS/MIA/IAC diagnoses. The main workflow accepts an image and optional mask or report, then runs detection, sizing, report generation, and multi-agent diagnosis in order; the pipeline returns a diagnosis trace. The README also documents standalone MoE detection and optional GraphRAG retrieval. Stage wiring is supported by the sampled pipeline and README; details inside unsampled stage implementations are represented only where documented.
Main entry points: pipeline.py Pipeline Orchestrator · nodule_spotter/pipeline.py Spotter Pipeline · litellm_model.py LLM Adapter · orchestrator.py Debate Orchestrator
Components 25
Case Pipeline
- CLI Entry
main.py - Pipeline Orchestrator
pipeline.py - Case State
case.py
Nodule Detection
- Spotter Stage
stages/spotter.py - Spotter Pipeline
nodule_spotter/pipeline.py - Detector Experts
nodule_spotter/detectors - Detector MoE
nodule_spotter/moe.py - Mask Clustering
nodule_spotter/clustering.py - VLM Panel
nodule_spotter/judging_panel.py
Measurement And Reports
- Sizer Stage
stages/sizer.py - Nodule Measurement
nodule_sizer/measure.py - Radiologist Stage
stages/radiologist.py - DAM Report Generation
simulated_radiologist/dam/describe_anything_model.py - DAM Server
simulated_radiologist/dam_server.py
Clinical Debate
- Doctor Stage
stages/doctor.py - Debate Orchestrator
lung_agents/orchestrator.py - Specialist Judges
lung_agents/judge_agent.py - Summary Agent
lung_agents/summary_agent.py - GraphRAG Tool
lung_agents/graphrag/tool.py - GraphRAG Retriever
lung_agents/graphrag/retriever.py
Agent Runtime
- LLM Adapter
agentbase/model/litellm_model.py
Other components
- Clinician / Operator
- CT Case Inputs
- Diagnosis Trace
- LLM Provider
Connections 26
- Clinician / Operator → CLI Entry: starts run
- CT Case Inputs → CLI Entry: supplies case
- CLI Entry → Pipeline Orchestrator: runs cases
- Pipeline Orchestrator → Case State: builds state
- Pipeline Orchestrator → Spotter Stage: runs first
- Spotter Stage → Spotter Pipeline: requests masks
- Spotter Pipeline → Detector MoE: runs experts
- Detector MoE → Detector Experts: dispatches detection
- Spotter Pipeline → Mask Clustering: clusters candidates
- Spotter Pipeline → VLM Panel: judges clusters
- Pipeline Orchestrator → Sizer Stage: runs next
- Sizer Stage → Nodule Measurement: measures nodule
- Pipeline Orchestrator → Radiologist Stage: runs next
- Radiologist Stage → DAM Report Generation: generates report
- DAM Server → DAM Report Generation: serves model
- Pipeline Orchestrator → Doctor Stage: runs last
- Doctor Stage → Debate Orchestrator: starts debate
- Debate Orchestrator → Specialist Judges: runs rounds
- Debate Orchestrator → Summary Agent: requests summaries
- Specialist Judges → GraphRAG Tool: retrieves knowledge
- GraphRAG Tool → GraphRAG Retriever: queries backend
- Specialist Judges → LLM Adapter: requests reasoning
- Summary Agent → LLM Adapter: requests summary
- VLM Panel → LLM Adapter: requests judgments
- LLM Adapter → LLM Provider: calls provider
- Pipeline Orchestrator → Diagnosis Trace: returns diagnosis