DataFactory: Collaborative Multi-Agent Framework for Advanced Table Question Answering
Authors: Tong Wang, Chi Jin, Yongkang Chen, Huan Deng, Xiaohui Kuang, Gang Zhao
Organizations: Institute of Systems Engineering, Academy of Military Sciences, Beijing, 100101, China · School of Information Resource Management, Renmin University of China, Beijing, 100872, China
Table Question Answering (TableQA) enables natural language interaction with structured tabular data. However, existing large language model (LLM) approaches face critical limitations: context length constraints that restrict data handling capabilities, hallucination issues that compromise answer reliability, and single-agent architectures that struggle with complex reasoning scenarios involving semantic relationships and multi-hop logic. This paper introduces DataFactory, a multi-agent framework that addresses these limitations through specialized team coordination and automated knowledge transformation. The framework comprises a Data Leader employing the ReAct paradigm for reasoning orchestration, together with dedicated Database and Knowledge Graph teams, enabling the systematic decomposition of complex queries into structured and relational reasoning tasks. We formalize automated data-to-knowledge graph transformation via the mapping function T:D x S x R -> G, and implement natural language-based consultation that - unlike fixed workflow multi-agent systems - enables flexible inter-agent deliberation and adaptive planning to improve coordination robustness. We also apply context engineering strategies that integrate historical patterns and domain knowledge to reduce hallucinations and improve query accuracy. Across TabFact, WikiTableQuestions, and FeTaQA, using eight LLMs from five providers, results show consistent gains. Our approach improves accuracy by 20.2% (TabFact) and 23.9% (WikiTQ) over baselines, with significant effects (Cohen's d > 1). Team coordination also outperforms single-team variants (+5.5% TabFact, +14.4% WikiTQ, +17.1% FeTaQA ROUGE-2). The framework offers design guidelines for multi-agent collaboration and a practical platform for enterprise data analysis through integrated structured querying and graph-based knowledge representation.
Figures & tables
Figure 1: Overview of the LLM-based multi-agent DataFactory framework for TableQA. The system consists of a Database Team, a Knowledge Graph Team, and a Data Leader that orchestrates their collaboration from an initial data phase through three processing phases: information storage, knowledge extraction, and insight generation.
Figure 2: Workflow of the Database Information Processing Agent. The automated pipeline combines rule-based operations for schema construction with LLM-based analysis for semantic understanding, covering table analysis, DDL generation, data ingestion, and quality assessment.
Figure 3: Architecture of the Database Information Retrieval Agent. The agent integrates table schema and DDL information, domain knowledge, and retrieved historical question-SQL pairs to construct prompts for SQL generation and database querying.
Figure 4: Database Information Analysis and Visualization Agents. (a) The Analysis Agent transforms retrieved tables into natural-language summaries with domain context. (b) The Visualization Agent generates plotting code to produce interactive charts for data exploration.
Figure 5: Workflow of the Knowledge Graph Information Processing Agent. The agent follows a three-stage process of strategy generation, configuration validation, and graph construction to transform tabular data into a knowledge graph.
Figure 6: Architecture of the Knowledge Graph Information Retrieval Agent. The agent generates Cypher queries by combining graph schema information, retrieved historical question-Cypher pairs, and external domain knowledge to support robust multi-hop graph traversal.
Figure 7: Architecture of the Knowledge Graph Information Analysis and Visualization Agents. The Analysis Agent explains retrieved subgraphs in natural language, and the Subgraph Drawing Agent renders corresponding graph visualizations for the web interface.
Figure 8: Workflow of the Data Leader. The three-stage process—data discovery, evidence-based query planning, and comprehensive analysis and synthesis—implements the ReAct paradigm to coordinate Database and Knowledge Graph teams.
Figure 9: Prompt template for the Data Leader agent. It encodes the three-stage exploration principle, coordination rules for the two teams, and the ReAct-style thought–action–observation format used during reasoning.
Dataset
Task Type
Test Size
Table Size
Key Challenges
Metric
TabFact
Fact Verification
12,779 statements
5-6 cols, 14 rows
Multi-hop reasoning,
Accuracy
( Chen et al., 2020 )
(Binary)
1,695 tables
(avg.)
logical operations
WikiTQ
Computational
4,344 questions
≥ 8 rows, ≥ 5 cols
Aggregation, sorting,
Exact Match
( Pasupat and Liang, 2015 )
Analysis
arithmetic operations
Accuracy
FeTaQA
Multi-hop
2,003 instances
5.9 cols, 13.8 rows
Causal reasoning,
ROUGE-1/2/L
( Nan et al., 2022 )
Generation
(avg.)
free-form answers
F-score
Table 1: Benchmark datasets overview with key characteristics and metrics
Model
Provider
Type
Release
Parameters
Architecture
Deployment
Claude 4.0 Sonnet
Anthropic
Commercial
May 2025
Undisclosed
Dense
API
( Anthropic, 2024 )
(Mid-weight)
Gemini 2.5 Flash
Google
Commercial
Jan 2025
Undisclosed
Dense
API
( Google DeepMind, 2024 )
DeepMind
(Lightweight)
GPT-4o mini
OpenAI
Commercial
July 2024
Undisclosed
Dense
API
( OpenAI, 2024 )
(Compact)
Table 2: Large Language Models used in evaluation with key specifications
Table 3: Performance comparison of different methods on TabFact and WikiTQ datasets
Method
TabFact
WikiTQ
Avg Tokens
Avg Tokens
End-to-end
546
794
Few-shot
935
1,189
TableCoT
1,084
1,495
StructGPT
1,721
1,999
TabSQLify
2,194
2,317
Table 4: Average token usage comparison across different methods
Model
FeTaQA
WikiTQ
TabFact
ROUGE-1 F
ROUGE-2 F
ROUGE-L F
Accuracy
Accuracy
Claude 4.0 Sonnet
0.6234
0.3885
0.5067
83.2%
90.8%
Gemini 2.5 Flash
0.6107
0.3767
0.4995
77.9%
87.9%
Qwen3-235B-A22B
0.5972
0.3607
0.4776
73.2%
91.2 %
DeepSeek-V3
0.5403
0.3075
0.4309
73.6%
84.2%
GPT-4o mini
0.5576
0.3320
0.4555
67.8%
79.3%
Table 5: Performance comparison across different model providers and sizes
Figure 10: Team invocation patterns across different models and datasets. The visualization demonstrates how task complexity influences tool selection strategies: (a) TabFact shows uniform Database Team preference due to binary classification nature, (b) WikiTQ exhibits moderate diversification with increased Knowledge Graph usage for complex retrieval tasks, and (c) FeTaQA displays highest combined team usage rates reflecting multi-hop reasoning requirements. Blue represents Database Team-only usage, red indicates Knowledge Graph Team-only usage, and orange represents combined team usage.
Dataset
Metric
Model
No KG Team
Complete Framework
Avg. Improvement
TabFact
Accuracy
Claude 4.0 Sonnet
86.7%
90.8% ( ↑ 4.7%)
5.5%
Gemini-2.5 Flash
85.1%
87.9% ( ↑ 3.3%)
Qwen3-235B-A22B
85.6%
91.2% ( ↑ 6.5%)
DeepSeek Chat
82.0%
84.2% ( ↑ 2.7%)
GPT-4o mini
77.3%
79.3% ( ↑ 2.6%)
Qwen3-32B
67.7%
79.8% ( ↑ 17.9%)
Table 6: Performance comparison between framework without KG Team and complete framework
Figure 11: Model average performance across different team call frequencies. Error bars represent standard deviation across all models. Blue line shows TabFact dataset results, orange line shows WikiTQ dataset results.
Figure 12: Performance heatmaps showing model accuracy across different team collaboration call frequencies. The color intensity represents performance levels, with darker red indicating higher accuracy. Each row represents a different model, and each column represents a different call frequency range (1 call, 2–3 calls, 4–5 calls, 6–10 calls, 10+ calls).