CellAgent: An LLM-driven Multi-Agent Framework for Automated Single-cell Data Analysis

Yihang Xiao, Jinyi Liu, Yan Zheng, Xiaohan Xie, Jianye Hao, Mingzhi Li, Ruitao Wang, Fei Ni, Yuxiao Li, Jintian Luo, Shaoqing Jiao, Jiajie PengarXiv 2024

Abstract

Single-cell RNA sequencing (scRNA-seq) data analysis is crucial for biological research, as it enables the precise characterization of cellular heterogeneity. However, manual manipulation of various tools to achieve desired outcomes can be labor-intensive for researchers. To address this, we introduce CellAgent, an LLM-driven multi-agent framework specifically designed for the automatic processing and execution of scRNA-seq data analysis tasks, providing high-quality results with no human intervention. CellAgent constructs LLM-driven biological expert roles—planner, executor, and evaluator—each with specific responsibilities. It introduces a hierarchical decision-making mechanism to coordinate these experts, effectively driving the planning and step-by-step execution of complex data analysis tasks. Furthermore, we propose a self-iterative optimization mechanism, enabling CellAgent to autonomously evaluate and optimize solutions, thereby guaranteeing output quality. Evaluation results consistently show that CellAgent effectively identifies the most suitable tools and hyperparameters for single-cell analysis tasks, achieving optimal performance.

Introduction

The explosion of single-cell RNA sequencing (scRNA-seq) has revolutionized biology, but it has also created a massive computational bottleneck. Analyzing this data requires a rare skill set: deep biological intuition, advanced programming, and the patience to navigate over 1,400 different computational tools. Single-cell analysis is notoriously "fiddly," involving quality control, batch correction, clustering, and cell-type annotation, where each step requires choosing the right tool and tuning hyperparameters that can drastically change the biological interpretation.

CellAgent proposes a solution that moves us closer to the "Agent for Science" era. By organizing Large Language Models (LLMs) into a collaborative team of "experts," the framework can take raw data and a natural language request and return high-quality, expert-level biological insights with zero human intervention.

The CellAgent Framework

The core of CellAgent is its hierarchical decision-making mechanism, which divides labor among three distinct LLM-driven roles: the Planner, the Executor, and the Evaluator.

The CellAgent framework overview, illustrating the workflow from user input to final result through hierarchical multi-agent coordination across planning, execution, and evaluation phases.
  • The Planner: Acts as the project manager, decomposing a high-level user request (e.g., "Annotate the cell types in this lung dataset") into a sequence of logical sub-tasks.
  • The Executor: The "coder" of the group. It consists of a Tool Selector that picks the best library for the job and a Code Programmer that writes the actual Python or R code.
  • The Evaluator: The "senior scientist" that reviews the Executor's output. Crucially, CellAgent utilizes GPT-4V (Vision) to allow the Evaluator to "look" at UMAP plots and charts to judge if a batch correction or clustering step was successful.

These agents are supported by a Code Sandbox for safe execution, a Tool Retrieval module containing a curated library of biological tools, and a Memory Module that separates global task progress from local, step-specific debugging. This "closed-loop" system allows CellAgent to outperform human-written scripts that might not be as rigorously tuned.

Performance Benchmarking

CellAgent was evaluated on a comprehensive benchmark dataset encompassing over 50 single-cell datasets, covering dozens of tissues and hundreds of distinct cell types. The framework was benchmarked against standalone GPT-4 and industry-standard tools like scVI, LIGER, Harmony, and Slingshot.

Performance comparison of CellAgent against state-of-the-art tools across batch correction and biological conservation metrics, including quantitative rankings and UMAP visualizations.

Key results from the evaluation include:

  • Reliability: CellAgent completed tasks in 92% of cases, doubling the performance of a standard GPT-4 setup.
  • Batch Correction: It achieved an average score of 0.684, outperforming popular tools like scVI (0.642) and Harmony.
  • Cell Annotation: In complex PBMC datasets, it correctly annotated 94% of clusters, matching expert-level labels.
  • Trajectory Inference: It surpassed Slingshot with an overall score of 0.496 vs 0.473, demonstrating its ability to handle mathematically complex biological tasks.

Discussion and Future Work

CellAgent demonstrates that multi-agent LLM systems can bridge the gap between raw numbers and biological significance by using vision-based feedback and structured memory. However, self-evaluation remains a challenge; currently, the system relies heavily on GPT-4V's judgment, which may not always align with niche user preferences. Future work aims to allow for more granular "preference prompts" and to integrate a more diverse array of biological tools into the retrieval library.

Paper Citation: Xiao, Y., et al. (2024). CellAgent: An LLM-driven Multi-Agent Framework for Automated Single-cell Data Analysis. arXiv:2407.09811v1. http://cell.agent4science.cn/

Summary updated

BibTeX
@misc{xiao2024cellagent,
  author = {Yihang Xiao and Jinyi Liu and Yan Zheng and Xiaohan Xie and Jianye Hao and Mingzhi Li and Ruitao Wang and Fei Ni and Yuxiao Li and Jintian Luo and Shaoqing Jiao and Jiajie Peng},
  title = {{CellAgent: An LLM-driven Multi-Agent Framework for Automated Single-cell Data Analysis}},
  year = {2024},
  eprint = {2407.09811},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.09811},
}
Figure