Manuscript Offprint

arXiv:2610.20959

Same Context, Different Agents: A Behavioral Study of Semantic Layers, Orchestration and Compaction in Data Agents

Zhivar Sourati, Marianne Menglin Liu, Zheng Wang, Rongguang Wang, Sai Ashish Somayajula, Tao Sheng, Kyu J. Han, Sujith Ravi, Dan Roth

Abstract

Answering questions over heterogeneous data means combining evidence from files, databases, documents and the web. Data agents automate this, but their success depends on context. Three context-engineering techniques (CETs) help by shaping it: semantic layers describe the data, orchestration splits work among agents, and compaction condenses interaction history. Existing studies validate each CET alone, leaving open how agent behavior shapes its effect. We present a comprehensive analysis of the three CETs, alone and combined, with seven large language models (LLMs) on 1,514 long-horizon tasks from five benchmarks, covering behavior, accuracy and cost. We find that data agents without CETs form three behavior groups: investigators, premature answerers that answer without inspecting data, and early stoppers that give up. Each CET delivers its known benefit, from more investigation to smaller prompts, but only the behavior group it matches turns that benefit into accuracy, such as premature answerers under orchestration. For investigators, the same CETs can hurt: the semantic layer stops them from looking, orchestration makes them overconfident, costing 5 percentage points, and compaction makes them repeat steps. Combining CETs yields smaller gains and losses than their sum. We derive guidance for choosing CETs by agent behavior, task demands and accuracy-cost trade-offs.

1 Introduction

The goal of data analysis is to turn raw data into answers. Analysts start from a question but must find the relevant sources among many files, tables, documents and web pages (Lai et al., 2026; Zhang et al., 2026; Wang et al., 2026; Wu et al., 2026), read data that is heterogeneous across and within sources, with irregular layouts, entity names in multiple languages, obfuscated columns and metrics defined elsewhere (Ma et al., 2026; Li et al., 2026; Lei et al., 2025), align it and compute a result. Agents

Figure

Figure 1: Same context, different agents (illustration). Given the same question and data, an investigator checks every source and answers from the data, a premature answerer answers without looking, and an early stopper gives up partway.

built on large language models (LLMs) that reason and act with tools (Yao et al., 2022; Jimenez et al., 2024; Liu et al., 2026b) are increasingly applied to this problem (Hong et al., 2025; Jing et al., 2025) and complete ever longer tasks (Kwa et al., 2025), yet they remain unreliable (Jing et al., 2025; Lai et al., 2026). Much of the difficulty comes from the model's context. The data is too large to show in full, so the agent must decide what to look at; its history grows with every step; and models use long inputs unevenly, overlooking information in the middle of a long prompt and degrading as it grows even when it holds what they need (Liu et al., 2024; Du et al., 2025). The result is an agent that forgets what it found, states values it never computed or acts without knowing where to look. Given the same context, agents fail differently: one checks every source, another answers without looking, and a third gives up partway (Figure 1).

Context engineering designs what an LLM conditions on at each step (Mei et al., 2025). Three context-engineering techniques (CETs) target these problems (Figure 2B). A semantic layer supplies a curated description of the data (Sequeda et al., 2024; Rumiantsau and Fokeev, 2026; Chong et al., 2026). Orchestration distributes work among a planner and specialist agents, each with its own

References (72)