Abstract
Causal inference holds immense value in fields such as healthcare, economics, and social sciences. However, traditional causal analysis workflows impose significant technical barriers, requiring researchers to possess dual backgrounds in statistics and computer science, while manually selecting algorithms, handling data quality issues, and interpreting complex results. To address these challenges, we propose CausalAgent, a conversational multi-agent system for end-to-end causal inference. The system innovatively integrates Multi-Agent Systems (MAS), Retrieval-Augmented Generation (RAG), and the Model Context Protocol (MCP) to achieve automation from data cleaning and causal structure learning to bias correction and report generation through natural language interaction. Users need only upload a dataset and pose questions in natural language to receive a rigorous, interactive analysis report. As a novel user-centered human-AI collaboration paradigm, CausalAgent explicitly models the analysis workflow. By leveraging interactive visualizations, it significantly lowers the barrier to entry for causal analysis while ensuring the rigor and interpretability of the process.
Introduction
Causal inference is a cornerstone of scientific discovery, enabling researchers to move beyond simple correlations to understand the underlying mechanisms of cause and effect. This understanding is vital for high-stakes decision-making in domains like medicine, neuroscience, and economics. Despite its importance, the practical application of causal inference remains gated by a high barrier to entry. Practitioners must navigate complex data cleaning, select appropriate statistical algorithms (e.g., PC or FCI), and interpret dense mathematical outputs—tasks that typically require specialized expertise in both statistics and computer science.
While Large Language Models (LLMs) have demonstrated impressive reasoning capabilities, they often struggle with the long-horizon, multi-step workflows required for causal analysis, leading to hallucinations or loss of context. CausalAgent addresses these limitations by introducing a conversational, multi-agent framework that automates the entire causal pipeline, making rigorous analysis accessible through natural language.
System Architecture and Methodology
CausalAgent is built on a Multi-Agent System (MAS) architecture, utilizing the GLM-4.6 backbone and orchestrated via LangGraph. To ensure reliability and mitigate hallucinations, the system decomposes the complex causal workflow into specialized agent roles, each with distinct responsibilities and constraints.
The core components of the system include:
- Router Agent: Directs user queries to the appropriate specialized agent.
- Data Processing Agent: Manages data validation and cleaning. It employs graph algorithms to detect cycles, ensuring the Directed Acyclic Graph (DAG) assumption—a fundamental requirement for many causal discovery methods—is met.
- Causal Structure Learning Agent: Functions as an algorithm scheduler. By leveraging the Model Context Protocol (MCP), it decouples LLM reasoning from mathematical execution, invoking established Python libraries (e.g.,
causal-learn) to perform discovery based on data characteristics. - Reporting Agent: Translates statistical results into human-readable reports. This agent uses Retrieval-Augmented Generation (RAG) grounded in authoritative causal textbooks to ensure technical accuracy and clarity.
Case Study: The Sachs Protein Signaling Dataset
To demonstrate the system's efficacy, we applied CausalAgent to the Sachs Protein Signaling Dataset, a benchmark in causal discovery containing measurements of 11 proteins from human immune cells.
In this case study, the user simply uploaded the dataset and requested a causal analysis. CausalAgent autonomously executed the following steps:
- Data Ingestion and Validation: The Data Processing Agent validated the CSV and checked for data quality issues.
- Algorithm Selection: Based on the biological context and data type, the Causal Agent selected the PC algorithm for pathway reconstruction.
- Interactive Reporting: The Reporting Agent generated a comprehensive "Causal Analysis Report," identifying key regulators like Akt and Pka as potential intervention targets.
- Visualization: The system provided an interactive causal graph, allowing the user to visually inspect the discovered relationships and ask follow-up questions.
Key Insights and Discussion
The multi-agent approach provides several advantages over monolithic LLM implementations. By "dividing and conquering" the workflow, CausalAgent maintains high context fidelity and reduces the risk of hallucination. The integration of MCP ensures that while the LLM handles high-level strategy and user interaction, the rigorous mathematical heavy lifting is performed by proven statistical tools.
Furthermore, CausalAgent transforms causal discovery from a static, one-shot process into an interactive dialogue. Users can refine the model through natural language, exploring "what-if" scenarios and incorporating domain knowledge without writing a single line of code.
Conclusion and Future Work
CausalAgent significantly lowers the technical barrier to causal inference, providing a bridge between complex statistical methodologies and domain-specific research needs. While the current system excels at causal discovery (identifying the graph structure), future iterations will focus on integrating quantitative causal effect estimation and counterfactual reasoning. Additionally, the team aims to enhance support for latent confounders and implement "expert-in-the-loop" mechanisms to further bolster reliability in critical applications.
Summary updated