TL;DR
This paper introduces NEXUS, an autonomous multi-agent framework designed to act as a "virtual neuroscientist" capable of executing end-to-end neuroimaging analysis. By shifting from static, predefined pipelines to a code-centric, closed-loop multi-agent collaboration, NEXUS dynamically constructs, executes, and refines complex neuroimaging workflows based on real-time quality control and downstream scientific objectives.
What Problem Does This Paper Address?
Neuroimaging analysis (such as processing structural or functional MRI scans) is vital for discovering clinical biomarkers for diseases like Alzheimer's or ADHD. However, it is notoriously knowledge-intensive and labor-intensive. While standardized pipelines (e.g., fMRIPrep) exist, they are statically configured and brittle: they cannot reason about downstream goals, deliberate over alternative strategies when a step fails, or perform human-like quality control (QC). This leaves researchers stuck in a tedious loop of manual parameter tuning and troubleshooting.
Automating this with LLM agents is exceptionally challenging due to ecosystem heterogeneity (dozens of specialized software packages with incompatible representations), long-horizon complexity, and the need for highly specialized visual and metric-based QC judgment.
Methods
The authors present NEXUS (Neuroimaging Execution and Understanding System), which employs a hierarchical multi-agent architecture with centralized planning and decentralized execution:
- Supervisor Agent: Acts as the central orchestrator, translating high-level goals into workflows, dispatching tasks, and managing sub-agents.
- Specialist Agents: Includes a Data Awareness Agent (extracts dataset context), a Processing Agent (instantiates and executes pipelines), a Quality Control Agent (performs hierarchical quality assessment), and a Downstream Analysis Agent (handles statistical modeling and predictive analysis).
NEXUS introduces three core technical designs:
- Code-Centric Execution with Composable Primitives: Instead of using conventional flat tool-calling (which is fragile for long tasks), specialist agents synthesize entire Python programs that orchestrate standardized domain primitives wrapping tools like FSL, AFNI, and ANTs.
- Just-in-Time (JIT) Context Injection: To prevent prompt bloat and cognitive overload, NEXUS dynamically retrieves and injects only the schemas of task-relevant primitives into an agent's prompt based on the current instruction.
- Agent-as-a-Judge Closed-Loop QC: A two-stage hierarchical QC framework. It screens cohorts using quantitative metrics and then uses a Vision-Language Model (VLM) for fine-grained, iterative visual inspection (zooming, cropping) to dynamically reject or remediate poor-quality data.
Datasets
NEXUS was evaluated on two widely used benchmark neuroimaging datasets:
- ADHD-200: Functional MRI (fMRI) data from 200 subjects (100 ADHD, 100 healthy controls) used for functional connectome-based diagnosis prediction.
- ADNI (Alzheimer’s Disease Neuroimaging Initiative): Structural MRI (sMRI) data from 200 subjects (100 Alzheimer's Disease, 100 cognitively normal) used for structural diagnosis prediction via voxel-based morphometry.
Key Insights and Ideas
- Code-as-an-Act beats Tool-Calling: Writing executable scripts with structured control logic, parallel execution, and error handling is essential for long-horizon scientific workflows. Flat tool-calling completely fails when tasks scale.
- Closed-Loop QC is Non-Negotiable: Quality control shouldn't just be a post-hoc reporting step. Dynamically filtering out artifacts and poor-quality scans directly prevents downstream model degradation, especially in noisy modalities like fMRI.
- Specialization Prevents State Drift: Collapsing all tasks into a single monolithic agent causes severe cognitive overload, leading to hallucinations and a failure to recover from execution errors. Dividing labor among specialized agents keeps action spaces bounded and reliable.
Key Results
- Superior Predictive Performance: NEXUS consistently outperformed standard static pipelines combined with automated downstream machine learning (DS). On ADHD-200, NEXUS achieved an accuracy of 65.40% and an AUC of 65.55% (outperforming the best baseline at 62.60% AUC). On ADNI, it achieved an accuracy of 84.50% and an AUC of 93.00% (outperforming the best baseline at 90.60% AUC).
- 100% Completion and Robust Error Recovery: Across independent runs, NEXUS maintained a 100% completion rate, successfully exploring alternative pipelines (e.g., switching from FSL to AFNI when a normalization error was detected) and autonomously recovering from errors.
- Ablation Cruciality: Removing code-centric execution caused the system to fail catastrophically (0/5 completion rate on both datasets), proving that standard LLM tool-calling cannot handle complex scientific workflows.

Limitations and Future Work
The current study focuses on a representative but bounded set of neuroimaging modalities (sMRI and fMRI) and specific downstream tasks. The authors note that future work will focus on extending this framework to support broader neuroimaging modalities (like diffusion MRI or PET), expanding the primitive libraries, and tackling more open-ended, complex scientific discovery goals.
Summary updated