Announcing US$ 3.2M pre-seed round · OneVC · Maya · Norte Ventures Read →
Back to blog

AI agents without structured data get the answer wrong

In short

A sales director asks an agent what the distributor channel's margin was last quarter. The agent finds three sales tables, picks one and returns a number. The query runs without error, and the number is wrong: the chosen table does not deduct returns. AI agents that answer questions about company data go wrong like this when they do not receive structured data, that is, data with a definition, an official source, resolved entities and recorded rules, served to the agent in an organised way. Providing it is the role of the Company Brain, the layer that knows the company: what data exists, where it lives, how it connects and who may see what.

AI agents turn a business question into analysis

An agent of this kind receives the question in natural language, identifies the tables involved, writes and runs the queries and returns the answer, sometimes with a chart.

The idea is to take the leadership team's recurring questions out of the data team's queue. Models write syntactically correct SQL most of the time, and the answers are still wrong.

A simple question hides four decisions the schema does not record

The question about the distributor channel's margin requires, before any SQL, four decisions that an experienced analyst makes without noticing:

  • Definition: gross margin or contribution margin, with or without freight. Each department uses a different one.
  • Authoritative source: among billing, the consolidated view and the sales extract, only one table is the reference for the month-end close.
  • Tacit knowledge: distributor returns are booked in the month after the sale, and orders from before the ERP change are in the old system. Neither rule is written in the database.
  • Identity: the same distributor has one record per branch, and the branches need to be added up.

The database schema gives columns and types. Without structured data that says which table counts and which exception applies, the model picks the most likely option: the table whose name looks most like the question.

The four decisions that structured data settles before the AI agent writes the query
Before the SQL, structured data brings definition, source, tacit rule and identity

AI agents get it wrong without structured data, and correct SQL hides the error

In an analysis published by a16z in March 2026, Jason Cui and Jennifer Li note that even with models far better at generating code, these agents keep getting it wrong, because the problem goes beyond text-to-SQL: metric definitions and the right source for each number lie outside the schema.

A query that runs and returns a plausible number raises no alarm. The answer arrives formatted and goes into the presentation without anyone redoing the calculation. Better text-to-SQL techniques still depend on the structured data they receive.

The context layer goes beyond the BI semantic layer

The semantic layer in BI tools defines metrics such as revenue, churn and average ticket with a single calculation. It was designed for dashboards, covers what the data team modelled by hand and goes stale when the person who maintained it leaves the company.

The a16z analysis treats the context layer as a larger set, which contains the semantic layer and adds what AI agents need to operate autonomously:

  • canonical entities, with the official list of customers, products and channels;
  • identity resolution across records of the same entity in different systems;
  • tacit knowledge, with the conditional and historical rules that today live in people's heads;
  • governance guidance, with who may see each piece of data and which source counts for each use.
The semantic layer inside the context layer that delivers structured data to AI agents
The context layer delivers structured data to AI agents and goes beyond metrics

Five steps bring structured data to AI agents

The same analysis organises the building of this layer into five steps:

  1. make accessible the data the questions depend on, including knowledge recorded outside the data warehouse;
  2. automatically build a first draft of the context from high-signal sources, such as query history, transformation models and existing metric definitions;
  3. refine the draft with the people who know the conditional and historical rules;
  4. connect the agents to the layer through an API or MCP;
  5. keep the context up to date as systems, rules and agent feedback change.

The third step carries the most weight. The history shows which tables analysts use. The reason the month-end query excludes a group of orders is in the memory of whoever wrote it.

Five steps to bring structured data to AI agents in the Company Brain
In the Company Brain, human refinement completes the structured data with the tacit rules

In the Company Brain, each step has a component responsible for it

The Company Brain connects ERP, CRM, data warehouse and documents once. The knowledge graph records the canonical entities and links the branches to the same distributor. The business ontology holds what margin and channel mean in the company, with the authoritative source of each attribute. The semantic layer translates the question into the right query over these definitions.

Tacit knowledge comes in through human review. The controller who knows the returns rule records it once, with a start date and an owner, and every AI agent starts applying it. When the rule changes, she updates the record.

The structured data is served to agents via MCP, with the permissions inherited from the source system: anyone who cannot see margin by customer in the ERP does not receive it through the agent either. Every answer points to the table, definition and rule applied.

Structured data goes stale when the rule has no owner

A channel reclassification, a system migration or a new sales policy invalidate recorded rules. Without an owner per domain, the structured data describes the company as it was a year ago, and the agents repeat the old version.

Sources that exist only in personal spreadsheets need to move to a place that can be queried before they enter the context. And an answer marked as wrong by someone using the agent needs to go back to whoever maintains the rule.

The first structured data comes from the month-end close questions

The questions that the controller's office and the sales team answer every month, such as margin by channel, inventory turnover and renewal rate by segment, are a good starting point. They have a known answer to compare against.

The initial work is to record, with the people who calculate them today, the authoritative source and the exceptions for each one and to connect an AI agent to that slice. Each new question reuses the entities and rules already recorded in the Company Brain.

Get the next articles on the Company Brain