Introduction
Causal inference—the determination of whether one variable truly causes an effect in another—is fundamental to evidence-based decision-making across medicine, public policy, and business. Despite its importance, performing causal analysis on real-world data remains a significant challenge due to the complexities of data engineering and the specialized statistical knowledge required. ORCA (ORchestrating Causal Agent) is a multi-agent Large Language Model (LLM) system designed to automate the end-to-end causal inference pipeline, bridging the gap between raw relational databases and actionable statistical insights.
The Causal Inference Challenge
The transition from a natural language question to a causal estimate is hindered by two primary bottlenecks:
- The Data Engineering Bottleneck: Real-world data is typically stored in complex Relational Database Management Systems (RDBMS). Extracting the necessary data requires writing precise SQL queries to join and filter dozens of tables, a process that is both time-consuming and prone to error.
- The Statistical Expertise Gap: Selecting the appropriate causal model (e.g., backdoor adjustment vs. instrumental variables) requires specialized knowledge. Domain experts often lack the statistical depth to configure complex libraries like DoWhy correctly.
Existing tools often address these issues in isolation. ORCA aims to provide a unified framework that handles both data retrieval and statistical modeling through an agentic "divide and conquer" strategy.
The ORCA Framework
Built on the LangGraph framework, ORCA utilizes specialized agents that collaborate to solve causal tasks. This orchestration allows the system to handle the entire journey from a natural language query to a validated causal estimate.
- Agent Router: Directs the user's query to the appropriate specialized agent based on whether the task involves data exploration or causal analysis.
- Data Wrangler: Acts as a virtual data engineer. It includes a Table Explorer for schema summarization, a Table Recommender for identifying relevant data, and a Text2SQL Generator. The generator employs a self-correction loop, executing code and validating logic against database errors to ensure high-quality data retrieval.
- Causal Analyzer: Functions as a statistician. It uses the retrieved data and the DoWhy library to estimate causal effects. A Config Selector automatically determines the optimal estimation strategy (e.g., linear regression or propensity score matching) based on data characteristics and the user-provided causal graph.
Evaluation and Datasets
ORCA was evaluated using two primary benchmarks:
- BIRD: A large-scale benchmark for cross-domain Text-to-SQL tasks.
- REEF (Relational E-commerce Evaluation Framework): A new semi-synthetic dataset introduced by the authors. REEF simulates a complex e-commerce environment with 18 interrelated tables and known "ground-truth" causal relationships, enabling precise measurement of an agent's estimation accuracy.
Key Results
ORCA demonstrates substantial improvements over standard LLM baselines, such as GPT-4o mini, particularly in complex relational environments. By integrating a self-correction loop and specialized agents, ORCA significantly reduces hallucinations in SQL generation and improves statistical reliability.
Key performance metrics include:
- Text-to-SQL Accuracy: On the complex REEF dataset, ORCA achieved a 60% execution accuracy, vastly outperforming the baseline's 6.67%.
- Causal Estimation: In estimating the Average Treatment Effect (ATE), ORCA reached a 74.8% confidence interval coverage rate, representing a 7x improvement over the baseline (13%).
- Schema Understanding: Automated table descriptions generated by ORCA were rated at ~92/100, compared to ~62/100 for the baseline, indicating superior comprehension of database structures.
Discussion and Future Work
The success of ORCA highlights the importance of orchestration and self-correction in complex data tasks. By allowing the Causal Analyzer to refine data requirements through the Data Wrangler, the system avoids the pitfalls of siloed analysis.
However, limitations remain. ORCA currently requires a pre-defined causal graph and relies on human oversight to validate domain-specific assumptions. Future work will focus on integrating "causal discovery" to infer graph structures directly from data and exploring open-ended discovery tasks where the agent can suggest relevant causal questions.
Summary updated