arXiv(opens in a new tab)cs.AIAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.31082

Token-Efficient Data Reasoning Agents via Adaptive Structuring of Unstructured Data

Milad Rezaei Hajidehi, Qitong Wang, Stratos Idreos

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

Abstract

Across open and enterprise settings, valuable data remains embedded in unstructured sources: web pages, reports, contracts, filings, earnings calls, and PDFs. The big bet in enterprise AI is deploying LLM agents that reason over this data to answer complex questions for every knowledge worker. Agents can do this today, but at prohibitive cost. Each question repeatedly opens large documents to recover scattered evidence, consuming up to a million tokens. However, if the data were already structured, the same question would reduce to a cheap database lookup. For example, on the FanOutQA benchmark, reasoning over an ideal pre-structured store is 28×28\times cheaper, and the gap grows to orders of magnitude as questions fan out over more documents. Yet structuring everything in advance is not viable: documents hold vastly more possible structure than any workload will use, and the useful structure and documents are unknown until queries arrive.

We propose agentic context cracking, an approach that structures unstructured data adaptively and speculatively as a byproduct of reasoning itself, in the spirit of database cracking and adaptive data systems. Structuring is adaptive because observed queries decide when it happens and what matters, and speculative because it goes beyond the current question. Whenever the agent opens a document to answer, a cracking sub-agent forks from the already-loaded context at marginal cost and extracts grounded structure likely to serve related future queries. Over time, an increasing share of queries is fully covered by structured data and answered without opening a document, keeping agentic accuracy at close to RAG cost. On FanOutQA, extended with merely one related question per test question, cracking cuts cost by 53% while preserving accuracy, and already runs 9× cheaper at the 10th percentile of per-question savings. Agentic context cracking is a first step toward next-generation data infrastructure for agentic reasoning over unstructured data: a shared substrate beneath the model where knowledge that reasoning already paid to uncover accumulates, so the system improves with use for every agent and user that queries it.

1 Introduction

Knowledge and Insights Are Encased in Unstructured Data. Much of the world's knowledge is not stored in clean tables. It lives in unstructured sources such as books, enterprise and legal documents, web pages, SEC filings, earnings calls, and PDFs. The evidence required to answer questions over these sources is scattered across many documents. Consider this question: which cast members worked with both Alfred Hitchcock and Martin Scorsese? Over Wikipedia, answering it requires enumerating each director's

▲ RAG ■ Agentic Reasoning ★ Acc (Ours) ☑ Ideal

Figure

Figure 1: Left: On the full FanOutQA [36] benchmark over Wikipedia, agentic reasoning far outperforms fixed top-k RAG but at high cost. Our approach, agentic context cracking, preserves almost all of this accuracy advantage while reducing cost by 53%. Right: On ten sampled questions, we extracted every fact required to answer each question from the unstructured documents and stored it in a database. Reasoning over this ideal store is 28×28\times cheaper. This gap is the cost reduction available to adaptive structuring systems.

films from their pages, extracting cast members from each film's page, connecting the resulting director-film and film-cast relations, and intersecting the two cast sets. This flow is general: at each step, evidence is gathered from documents, assembled into intermediate entities, attributes, and relations, and passed to later steps. The answer is not a set of retrieved passages. It is a latent structured dataset, constructed step by step from sparse evidence inside many large documents. We call this pattern data reasoning.

Data Reasoning over Unstructured Data is Already Everywhere and Still Growing. More than eighty commercial and open-source systems have publicly launched to answer complex questions over the web and other large document collections [18, 22, 30], and many more run privately inside enterprises [9, 10]. Many of the questions real users ask follow exactly the data reasoning pattern [29]. Personal questions dominate in volume, and millions of people ask them over the open web. Professional questions carry higher stakes and target enterprise archives and public government records [19]. A financial analyst might ask which companies blamed supply chains on their earnings calls yet reported rising inventory in their annual reports, matching a single remark in an hour-long transcript against one line in a long filing. A health department might ask which suppliers appear in both food recall notices and restaurant inspection reports across multiple cities, with supplier names scattered through lengthy inspection narratives. Answering either means fanning out over hundreds of documents in multiple steps.

Agentic Data Reasoning Extracts Encased Knowledge but at Prohibitive Cost. Agentic systems can execute the multi-step flow needed to answer data reasoning questions. An agent plans, searches, opens documents, extracts facts, executes code, maintains intermediate state, and selects its next action based on the evidence gathered so far [1, 4]. These capabilities bring far higher answer quality than models relying on parametric knowledge or fixed top-k retrieval [19, 36]. Figure 1 (left) also shows this. This quality comes at high cost. Data reasoning is largely prefill-intensive: the agent repeatedly loads large documents into context to recover scattered facts, while the final answer is often short. Cost grows with dependent steps, entities, and documents. In our FanOutQA experiments, one question can consume up to one million tokens and cost nearly one dollar. Real-world data reasoning questions can have greater fan-out, evidence requirements, and reasoning depth, making them substantially more expensive [29].

Read it Once, Pay it Once: Queries Reveal Useful Structure. If the data were magically structured, many of these questions, including our Hitchcock example, would reduce to a simple and low-cost Text2SQL query. We demonstrate this phenomenon in Figure 1 (right). We sampled questions from FanOutQA, manually extracted every fact their answers require into a database, and reran the agent over the database instead of the raw documents. Each task reduced to data discovery and a short query, without opening a single document. This ideal pre-structured store makes reasoning 28× cheaper. This factor is specific to FanOutQA, whose questions span seven documents on average [36]. Once structure covers a question, the agent skips every document open, so the saving reaches orders of magnitude for real questions that fan out over hundreds of documents. While LLMs are excellent at capturing such structure, structuring everything in advance is infeasible. Documents contain orders of magnitude more entities, attributes, and relations than any workload will use, and extracting them all is an unbounded decode. Moreover, we do not know in advance which structure a workload wants, or how often it will be reused. Only the workload reveals which structure is worth extracting.

Two insights turn this dead end into an opportunity. First, at the workload level, related queries reopen the same documents and repeat much of the same work, while each query reveals which structure and relations matter. This semantic locality is the norm, not the exception. From the user's side, conversations become investigations and users hold similar interests. From the data's side, the same documents get opened over and over because they hold many related facts and evidence that queries need. Second, at the inference level, once the agent loads a document, its prefill has already been computed and its KV-cache entries already exist. With careful prompt structure, shared-prefix serving [12, 34], and API prompt caching, a second generation over the same context avoids or sharply reduces repeated prefill cost, leaving decoded tokens as the main additional work. We give this decode a fixed budget that is small relative to the prefill it saves, yet sufficient to produce reusable structure. Together, the two insights suggest a move stronger than caching. Cached answers help only when the exact question returns. Speculating about useful structures goes much further: While the document is loaded and paid for, extract grounded evidence that related but distinct future queries will need.

Agentic Context Cracking for Token/Cost-Efficient Data Reasoning. We introduce agentic context cracking, an approach that brings the query-driven philosophy of database cracking and adaptive data systems to AI reasoning [11, 26]. The system never opens documents solely to extract structure. Instead, whenever the reasoning agent opens one to answer, a cracking sub-agent forks from the already-loaded context at low marginal cost. It speculates about grounded, evidence-backed entities, attributes, and relations likely to serve future queries. The system validates and catalogs these cracked objects. Later queries reuse them via structured reads, avoiding document opens entirely, and fall back to original documents on a miss. Unlike database cracking, which reorganizes relations, agentic context cracking creates useful structure where none exists. This structuring is adaptive because observed queries guide what is worth extracting, and agentic because a reasoning sub-agent, not a fixed extractor or schema, uses semantic understanding to read each document and speculate about what to extract.

The savings available to adaptive structuring are substantial. Longer-running workloads and smarter cracking unlock them. The ideal store is 28×28\times cheaper on the FanOutQA benchmark, and this gap widens with fan-out. In our case study, which models an evolving investigation, cracking cuts cost by 3×3\times. On FanOutQA extended with only a single reuse chance per test question, one earlier related question, cracking still cuts cost by 53% while preserving accuracy. At the tenth percentile of savings, cracking already runs 9×9\times cheaper. Reuse separates the average from this best case, and reuse chances accumulate as the workload runs. The store an enterprise or AI service accumulates through use becomes a durable asset, a data moat that, unlike KV caches, transfers across models.