arXiv:2611.12114cs.AINov 2026

Manuscript Offprint

arXiv:2611.12114

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 Song

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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 Kram-aBench 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.

1 Introduction

Data analysis answers a question end-to-end from raw data, spanning data preparation, integration, and computation. Traditional approaches decompose this process into separately designed stages, including data discovery, cleaning, integration, and computation (Castro Fernandez et al., 2018; Wang et al., 2020; Yu et al., 2018). Each stage assumes a predefined problem space with fixed objectives and a known target structure. Thus, it must be redesigned by hand whenever the data or question changes.

Figure

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

LLMs have shown strong reasoning abilities required for data analysis, from interpreting tabular data to generating analysis code that answers complex questions (Cheng et al., 2023; Lai et al., 2023). Motivated by such capabilities, many works utilize LLMs to remove much of the manual design by translating natural-language questions directly into executable queries or analysis code (Hong et al., 2024; Gao et al., 2024; Pourreza and Rafiei, 2023). Furthermore, LLM agents extend this capability to multi-step tasks. By interleaving reasoning with actions, agents gather information, revise plans, and carry out tasks through successive interactions with an environment (Yao et al., 2023). Building on this paradigm, data analysis agents automate the data analysis pipeline, from locating relevant files to iteratively refining analysis solutions (Nam et al., 2026; Hong et al., 2025; You et al., 2025). Their design implicitly assumes that the data relevant to a task can be found and understood by exploring sources within the agent's context.

However, this assumption does not hold in real-world data lakes. A lake typically mixes vari-ous relational tables with no shared schema describing what they contain or how their fields relate (Lei et al., 2025; Lai et al., 2026). As illustrated in Figure 1, this exploration often exhausts the agent's context window before the task reaches its final step. Moreover, evidence discovered early is likely to be buried under the growing exploration trace, causing hallucinations and error propagation (Zhang et al., 2024; Liu et al., 2024). Existing context management methods mitigate context limitations by managing external memory, summarizing completed subgoals, or compressing interaction histories (Hu et al., 2025; Liu et al., 2026; Zhang et al., 2025). While these approaches improve context efficiency, they do not explicitly model the semantic meaning of the underlying data or the relationships between sources. Data analysts confront the same problem when managing large, heterogeneous collections, and a common practice is to maintain a semantic layer over the data (Hai et al., 2016; Xiao et al., 2018; Halevy et al., 2016). A table's schema describes what each field inside the table represents. Building on this, an ontology of the data lake records how various fields connect through shared concepts, so that an analyst can locate and combine the data a question requires without inspecting every raw file.

Inspired by this practice, grounding data agents in an ontology offers a promising way to guide analysis using the semantic knowledge underlying a data lake. However, realizing this approach presents two challenges. First, real-world data lakes rarely provide a predefined ontology. Second, merely supplying an ontology as additional context does not ensure that an agent will use it effectively. Without explicit constraints, the agent may still explore irrelevant files or perform computations without consulting the available semantic knowledge.

To address these challenges, we propose Ontology-Grounded Data Agent (OGDA) 1^{1}, a framework that automatically constructs an ontology over a data lake and uses it to govern both the context and the actions of an LLM agent. First, agentic ontology construction abstracts the lake into an ontology in which schemas group files holding the same kind of record and concepts align semantically equivalent fields across files. During construction, a data agent proposes each schema, concept, and edge as a hypothesis induced from exploration of the data lake. An independent verifier tests each hypothesis by designing and executing experiments over the lake. Experience distillation captures lessons from this exploration and verification. These lessons complement the ontology with knowledge beyond its explicit elements. Second, ontology-grounded action turns this representation into an explicit constraint on execution. The agent must commit the ontology elements relevant to the task to a task graph, and any action on data outside that graph is rejected. The ontology thus orchestrates both what enters the agent's context and which data the agent may act on, so the agent's context scales with the task rather than with the size of the lake.

In summary, our contributions are:

• We introduce OGDA, which orchestrates agent execution and context through an ontology-based task graph.

• We develop a hypothesis-testing procedure that constructs structural and semantic representations from raw files and distills reusable experience from exploration.

• Our experiments demonstrate that OGDA significantly outperforms existing methods across KramaBench (Lai et al., 2026) and DiscoveryBench (Majumder et al., 2025) over three backbone models.