Structured vs unstructured data for AI: what changes

With structured data, AI should write a query and let the database compute. With unstructured data, it must parse and retrieve first. Each fails differently.

By CloudOEngine.ai Engineering · · 11 min read

With structured data, the AI's job is to write a correct query and let the database do the counting, so most failures come from misread schemas and vague metric definitions. With unstructured data such as PDFs, emails and video, the system must first parse the content and retrieve the right pieces before a model reads them, so most failures come from bad extraction and missed passages. The two need different pipelines, different tests and different access controls, and the most useful projects connect them.

Where the line actually falls

Structured data is anything with a schema you can rely on: rows in an ERP, a CRM table, a sensor reading with a timestamp and a value. Every record has the same fields, and the database knows their types. Unstructured data has no such contract. A service engineer's note, a scanned delivery challan, a recorded support call and a CCTV stream all carry information, but nothing tells you in advance where the useful part is.

There is a wide middle band. JSON events, XML invoices and application logs have keys and fields, but the fields change between records and often contain free text. I treat this semi-structured data as two things at once: the predictable fields go down the structured path, and the free-text fields go down the unstructured one.

The usual claim is that most company data is unstructured. MIT Sloan put it at 80% to 90% in 2021, citing multiple analyst estimates, and noted a 2019 Deloitte survey in which only 18% of organisations said they could take advantage of such data. These are estimates, not measurements of your company. What matters more is where the answer to your specific question lives, and that is often split across both kinds.

An illustration that runs through the rest of this article: a pump manufacturer in Coimbatore keeps warranty claims in a database table (claim date, pump model, dealer, amount paid) and keeps the technician's inspection notes as free text, with a few photos attached. "How many claims did the 2 HP model get last quarter?" is a structured question. "Why are the 2 HP pumps failing?" is an unstructured one. "Which failure cause costs us the most?" needs both.

Structured data: let the model write the query

The worst way to use an LLM on a table is to paste the table into the prompt and ask for a total. Models read tables reasonably well, but they are not calculators, and how well they read depends on presentation. The "Table Meets LLM" study (Sui and colleagues, WSDM 2024) tested GPT-3.5 and GPT-4 on structural tasks such as cell lookup and row retrieval and found that performance "varied with different input choices", including the table format and the order of the content. A database has no such sensitivity. So for anything that involves summing, counting or filtering, the model should produce a query, and the database should run it.

That pattern, text-to-SQL, has a long benchmark history, and the numbers are worth reading carefully. BIRD (NeurIPS 2023) covers 95 databases totalling 33.4 GB, with over 12,751 question and SQL pairs. In the original paper, its authors reported that ChatGPT reached only 40.08% execution accuracy against a human result of 92.96%. Progress since then has been fast: the top test-set score on the BIRD leaderboard was 83.40% when I checked in November 2026.

Then look at Spider 2.0, which was built from real enterprise workflows: 632 tasks over real databases that often have more than 1,000 columns, in several SQL dialects, with solutions that often run past 100 lines. Its authors' best agent setup, based on o1-preview, solved 21.3% of tasks, compared with 91.2% on the original Spider and 73.0% on BIRD. The gap between those numbers is the gap between a tidy demo schema and the database your finance team actually uses.

So the hard part of structured data for AI is not syntax. It is meaning. A column called amt might be gross or net. "Revenue" might exclude returns in one report and include them in another. A claim may be counted on the date it was filed or the date it was approved. A model that has only the column names has to guess, and it will guess confidently. The fix is boring and effective: document what tables and columns mean, write down how each important metric is calculated, and give the model those definitions instead of letting it invent them.

This is the problem CloudOEngine's data layer starts from: its AI reads your real data schemas to propose KPIs, so the definitions are drafted from what is actually in your tables and your team can correct them before anyone builds on them.

For prediction rather than question-answering (churn, demand, claim fraud), the advice is even more conservative. Grinsztajn, Oyallon and Varoquaux benchmarked models on 45 tabular datasets and found that "tree-based models remain state-of-the-art on medium-sized data", meaning around 10,000 samples. If your problem is a table with a target column, a gradient-boosted tree is still the first thing I would try, and the LLM is better used to explain the result than to make it.

Unstructured data: the work moves upstream

With documents, recordings and video, the model can't query anything until something has turned the raw content into text, sections and metadata. That step decides most of the quality. A scanned PDF with a two-column layout, a table that spans pages, a stamp across the totals or handwriting in the margin can all come out of a parser as scrambled text, and a model reading scrambled text will produce a fluent answer to the wrong question.

Document parsing is hard enough to have its own benchmarks. OmniDocBench (accepted at CVPR 2025) covers nine document sources, from academic papers and textbooks to handwritten notes and densely typeset newspapers, and evaluates both pipeline tools and vision-language models end to end, reporting different strengths and weaknesses for different document types. The practical lesson: test your parser on your documents, not on a sample PDF from the vendor, because the method that works on clean digital invoices may struggle on your faxed purchase orders.

After parsing comes retrieval. Most systems split documents into chunks, index them, and fetch the few most relevant chunks for each question, which is retrieval-augmented generation. Our article on RAG chunking strategies covers the splitting decisions in detail. The point here is that every stage can lose the answer before the model sees it: the parser drops a table, the chunk boundary cuts a sentence in half, the search returns the wrong policy version. When the model then answers anyway, the error looks like a hallucination, but its cause was upstream.

Video belongs here too. A camera stream is the least structured data most companies own, and the value usually comes from turning it into a number, such as how many people walked into a store between 6pm and 7pm. That conversion is exactly where errors creep in, which is why CloudOEngine's Vision AI counts with two independent trackers and sends any crossing where they disagree to a human review queue, and why a finalised count ships with a published accuracy report.

What changes, side by side

Structured data Unstructured data
Typical question How many, how much, which ones Why, what does it say, what happened
How the AI reaches it Writes a query; the database computes Parses, chunks, retrieves; the model reads
Main failure Wrong join, wrong filter, wrong metric definition Bad parsing, missed passage, outdated document
What to test The query and its result against a known answer Whether the right passages were found and the answer sticks to them
Access control Rows and columns Files and folders, plus sensitive details buried in text
Freshness Usually as fresh as the source table Only as fresh as the last parse and index run
Two paths from a question to an answer (illustration)Structured: tables and recordsQuestioncounts, totalsLLM writes SQLfrom the schemaDatabase runs itexact arithmeticAnswer from rowscheck the queryUnstructured: documents, videoQuestionwhy, what, howSearch passagesparsed and chunkedLLM reads themmay fill gaps itselfAnswer + citationscheck faithfulnessExtraction turns documentfields into rowsTop path fails on meaning (joins, metric definitions). Bottom path fails on parsing and retrieval.
Structured questions should end in a database query; unstructured ones end in retrieved passages. Extraction is the bridge that lets document facts be counted like table rows.

The useful projects cross the line

Back to the pump manufacturer. "Which failure cause costs us the most?" can't be answered from the claims table, because the cause is only in the technician's notes, and it can't be answered by RAG, because retrieving ten notes and asking a model to estimate a total gives you a guess with a confident tone.

The approach that works is extraction. Run each note through a model with a fixed output schema (cause, part, whether the pump was installed per the manual) and write the result as new columns next to the claim. Now the question is structured again, and the database can group by cause and sum the amount paid. The model did what it is good at, reading messy text, and the database did what it is good at, arithmetic.

Extraction is not free of errors, so treat it like any other data feed. Restrict each field to a fixed list of allowed values, keep a link from every extracted row back to the note it came from, sample a few dozen rows by hand before trusting the totals, and rerun extraction when the prompt or model changes. The checks in our article on data quality before launch apply to extracted columns as much as to anything typed in by a person. Once a cause like "dry running" has been pulled from thousands of notes, it looks exactly as authoritative as the claim amount next to it, even though one was typed by an accountant and the other inferred by a model.

The reverse direction matters too. Structured data makes unstructured answers better. If the RAG system knows the claim's pump model and installation date, it can filter retrieval to the right manual version instead of searching every manual ever written.

Permissions do not carry over by themselves

On a table, access rules are crisp: this role sees these rows and these columns. Documents are usually permissioned per file or folder, and a single file can mix harmless and sensitive content. A technician's note might include the customer's mobile number and home address in the middle of a description of a burnt winding. When that note is chunked and indexed, the index needs to carry the original file's permissions, and when its contents are extracted into a table, the new columns need rules of their own.

The risk sits at the joins between systems. Data copied from a permissioned document store into a vector index or a new table can quietly lose the restrictions it had. Keeping one set of rules across the data connections, the pipelines that transform them and the AI that reads the result is much easier than syncing three. CloudOEngine puts data connections, pipelines and its AI runtime under one permission model and one audit trail, so source files, tables and whatever a pipeline produces from them are governed by the same roles.

Testing changes too

For structured questions, you can usually check the answer exactly. Write 30 to 50 real questions with known results, run the generated SQL, and compare the numbers. Inspect the queries themselves, because a query can return the right number for the wrong reason and break next month.

For unstructured questions, there is rarely one right string. You test in two parts: did retrieval find the passages that contain the answer, and does the answer stay faithful to them. Our guide to evaluating LLM applications covers both. Extraction sits in between: each extracted field has a right answer that a person can check, so you can measure accuracy per field on a labelled sample.

What I would do first

If you are deciding how to point AI at your company's data, this order keeps the expensive mistakes small:

  1. Take ten real questions people ask, and for each one write down where the answer lives: a table, a document, or both.
  2. For the table questions, document the five to ten metrics they depend on in plain language, and use text-to-SQL against those definitions rather than raw column names.
  3. For the document questions, test your parser on a sample of your worst documents before choosing a retrieval setup.
  4. For the questions that need both, extract the few fields you actually need into columns, with a link back to the source and a hand-checked sample.
  5. Carry permissions along at every copy, and build a small test set for each path before you show anyone a demo.

How CloudOEngine helps

CloudOEngine is one platform and console for connecting data (databases, files and camera streams), pipelines, an AI runtime (LLM gateway, agents with tool access, RAG), Vision AI and live video. Structured tables and unstructured files arrive in the same place, under one permission model and one audit trail, so the documents you index and the tables you query share the same access rules and the same audit trail.

On the structured side, AI reads your real data schemas to propose KPIs. That gives you written metric definitions grounded in your actual tables, which is the context a model needs to write correct queries instead of guessing what a column means.

On the unstructured side, the AI runtime includes RAG over your documents, and agents can run real tools, for example filing a ticket. Every step and tool call is traced and inspectable, so when an answer looks wrong you can see which passages and which calls produced it.

For video, Vision AI counting uses two independent trackers. Where they disagree, the case goes to a human review queue where your staff check it, and a finalised count ships with a published accuracy report that shows every counted crossing.

Governance is included, not upsold: tenant isolation, role-based access, audit logs and per-tenant encrypted secrets. CloudOEngine is built in Bengaluru, India.

Book a demo or see the data layer.

Frequently asked questions

What is the difference between structured and unstructured data for AI?

Structured data sits in tables with a fixed schema, so an AI system can answer by writing a query that the database executes exactly. Unstructured data, such as PDFs, emails, call recordings and video, has no schema, so the system first has to parse it and find the relevant passages or frames before a model can read them.

Can an LLM answer questions directly from a database?

Yes, usually by translating the question into SQL that the database runs. It works well on clean, well-documented schemas, but accuracy drops on large, messy enterprise databases: on the Spider 2.0 benchmark, the best agent setup tested by its authors solved 21.3% of tasks, against 73.0% on the easier BIRD benchmark.

Should I paste spreadsheet data into an LLM prompt?

Only for small tables and questions that need reading rather than calculation. Research on LLMs and tables found that results change with the table format and order you choose, and models are weaker at exact arithmetic than a database. For totals, averages and counts, let the model write a query instead.

Is semi-structured data like JSON treated as structured or unstructured?

It sits between the two. JSON, XML and log lines have fields and keys, so you can filter and aggregate them, but the fields vary between records and often contain free text. Treat the predictable fields as structured and the free-text fields as unstructured.

What share of company data is unstructured?

A common estimate is 80% to 90%. MIT Sloan reported that range in 2021, citing multiple analyst estimates. Treat it as an industry estimate rather than a measurement, and check your own systems, because the share of data that matters for a given AI use case can be very different.

Do structured and unstructured data need different access controls?

The principle is the same, but the mechanics differ. Tables can be restricted by row and column, while documents are usually restricted per file or folder, and sensitive details hidden in free text, such as a phone number in an email, are harder to find and mask.

Sources

  1. Tapping the power of unstructured data (MIT Sloan, February 2021)
  2. Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs (Li et al., NeurIPS 2023)
  3. BIRD-SQL benchmark and leaderboard
  4. Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows (Lei et al., arXiv 2411.07763)
  5. Table Meets LLM: Can Large Language Models Understand Structured Table Data? (Sui et al., WSDM 2024)
  6. Why do tree-based models still outperform deep learning on tabular data? (Grinsztajn, Oyallon, Varoquaux, 2022)
  7. OmniDocBench: Benchmarking Diverse PDF Document Parsing with Comprehensive Annotations (CVPR 2025)

#structured data #unstructured data #text-to-sql #rag #data for ai