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.
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.
The question about the distributor channel's margin requires, before any SQL, four decisions that an experienced analyst makes without noticing:
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.
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 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:
The same analysis organises the building of this layer into five steps:
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.
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.
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 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.