OGDA: Ontology-Grounded Data Agents for Reliable Analysis over Heterogeneous Data Lakes

Boyi Zhang, Hong Ting Tsang, Yisen Gao, Qiao Xiao, Li Yufei, Haoyu Huang, Zhongwei Xie, Jiaxin Bai, Yangqiu SongarXiv 2026 · arXiv

TL;DR

OGDA (Ontology-Grounded Data Agent) is a new framework that enables LLM agents to reliably analyze massive, messy "data lakes" by first building a semantic map (ontology) of the data. By grounding all subsequent analysis in this ontology and a formal task graph, OGDA prevents the "context exhaustion" and error propagation that plague standard agents, outperforming state-of-the-art baselines by over 10 percentage points.

What Problem Does This Paper Address?

Modern data analysis often happens over "data lakes"—huge, disorganized collections of files (CSVs, SQL databases, JSONs) with inconsistent schemas and no clear relationships between them. While Large Language Models (LLMs) are great at writing code to analyze a single table, they struggle when they have to find and integrate information across thousands of files.

Current "data agents" typically try to explore these lakes directly. As they search, their "context window" (the amount of information they can keep in active memory) fills up with irrelevant file headers and exploration traces. This leads to reasoning degradation: the agent gets confused, picks the wrong files, and propagates these errors into a final, incorrect answer.

Figure 1: Direct exploration can select incorrect files and propagate source-selection errors into the result. OGDA grounds relevant ontology elements in an ex- plicit task graph that guides exploration of the corre- sponding sources.

Methods

The authors propose a two-stage framework: Agentic Ontology Construction and Ontology-Grounded Action.

  1. Agentic Ontology Construction: Instead of relying on a pre-defined map, OGDA builds its own.
  2. Proposer-Verifier Loop: A "Proposer" agent inspects data batches and suggests hypotheses about schemas (how files are structured) and semantic concepts (how fields in different files relate, e.g., "this 'ID' column is the same as that 'user_id' column"). A "Verifier" agent then writes and executes code to test these hypotheses against the actual data.
  3. Experience Distillation: The system captures "lessons" from this process—like noting that a specific column has misleading headers—and stores them as natural language "experience" to be retrieved later.
  4. Ontology-Grounded Action: During task execution, the agent is strictly governed by the ontology.
  5. Task Graph: The agent doesn't just read files. It must first search the ontology and "ground" relevant elements into a task graph.
  6. Access Control: The agent is physically restricted from reading any raw data file unless its corresponding schema has been inspected and added to this task graph. This ensures the agent's context scales with the task complexity, not the lake size.
Figure 2: Overview of OGDA. Left: a proposer and verifier construct and refine an ontology of the heterogeneous data lake through claims and feedback, while exploration yields reusable experience. Right: a data agent interprets a task, searches the ontology, grounds relevant elements in a task graph, and acts on the corresponding data. The task graph connects grounded files, intermediate results, and the final answer.

Datasets

The researchers evaluated OGDA on two challenging benchmarks:

  • KramaBench: A "data-to-insight" benchmark featuring 104 tasks over ~1,700 real-world files across six domains. It requires complex file discovery, cleaning, and integration.
  • DiscoveryBench: A benchmark for data-driven scientific hypothesis discovery, containing 239 tasks drawn from published studies.

Key Insights and Ideas

  • Constraints are Features: The most surprising finding was that restricting the agent's access to data (via the task graph) was the biggest driver of performance. Without these constraints, agents often ignore the ontology and fall back into error-prone direct exploration.
  • Verification is Non-Negotiable: Ablation studies showed that removing the "Verifier" during ontology construction significantly dropped accuracy. LLMs are prone to making "lucky guesses" about data structure that fail upon actual execution; the Verifier catches these early.
  • Ontologies are Transferable: An ontology built by one model (e.g., DeepSeek-V4.1-Flash) can be effectively reused by a different model (e.g., GPT-6) to perform analysis. This suggests the agentic construction process captures objective truths about the data lake.
Figure 5: Component ablations on KramaBench with DeepSeek-V4.1-Flash. Each variant removes one com- ponent from OGDA. Values are answer scores (%).

Key Results

OGDA consistently outperformed five strong agent baselines (including smolagents and DatawiseAgent) across three different LLM backbones:

  • KramaBench: Using DeepSeek-V4.1-Flash, OGDA achieved an answer score of 73.00%, a massive 16.60 point improvement over the base agent.
  • DiscoveryBench: OGDA improved the Hypothesis Matching Score (HMS) by up to 5.35 points compared to the strongest baseline.
  • Efficiency: By using a compact ontology, OGDA keeps the agent's context clean, leading to more reliable multi-step reasoning.
Figure 4: Ontology reuse across generation backbones on KramaBench. We compare OGDA, smolagents, and EvoOntology with Gemma-4-31B-IT, GPT-OSS-120B, DeepSeek-V4.1-Flash, and MiMo-V2.6-Pro.

Limitations and Future Work

  • Structured Data Focus: OGDA is currently designed for record-structured data (tables, spreadsheets, databases). It doesn't yet handle multimodal data like images, audio, or video, which lack clear "fields" for schema induction.
  • Dependency on Data Quality: The ontology is only as good as the underlying data. If the data lake is extremely noisy or inconsistent, the Verifier might accept claims that are technically consistent with the noise but semantically incorrect.
  • Future Directions: The authors suggest extending the framework to multimodal sources and improving the "conservative" construction process so that partially understood files aren't completely invisible to the agent.

Summary updated

Abstract

Full-pipeline data analysis over real-world data lakes requires LLM agents to locate and integrate information across large collections of tables with different schemas. Existing data agents follow task-specific exploration, which exhausts the context window in massive lakes. As the context fills, the agent's reasoning degrades, leading it to locate and process incorrect data files. These errors propagate into the final answer. To overcome these limitations, we introduce Ontology-Grounded Data Agent (OGDA), which utilizes a compact ontology to reduce exploration overhead and constrain data processing. OGDA constructs the ontology through agentic hypothesis testing. At each step, a proposer agent induces schemas, concepts, and relations from raw sources, and a verifier checks each proposal against the underlying data. During task execution, the ontology serves as a representation of the data lake for the agent to explore. Every data-processing action is constrained by a task graph, which the agent can extend only after observing the semantic meaning of the data. Across KramaBench and DiscoveryBench with three LLM backbones, OGDA outperforms the strongest baselines by up to 10.82 points. These results suggest that explicitly modeling the data lake is a key step toward reliable end-to-end data agents.
BibTeX
@misc{zhang2026ogda,
  author = {Boyi Zhang and Hong Ting Tsang and Yisen Gao and Qiao Xiao and LI Yufei and Haoyu Huang and Zhongwei Xie and Jiaxin Bai and Yangqiu Song},
  title = {{OGDA: Ontology-Grounded Data Agents for Reliable Analysis over Heterogeneous Data Lakes}},
  year = {2026},
  eprint = {2611.12114},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.12114},
}
Figure