Ideas · AI Agents
Why an ontology gives AI agents better context than a database
A database stores the rows. An ontology tells an AI agent what the rows mean and how they connect, and that changes both the quality of the answer and what it costs to get it.
01. The question
A relationship manager asks an AI assistant a simple question: what is in this client's growth portfolio?
The assistant answers quickly. The list is correct. Every holding is there. And the answer is still incomplete, because the question the manager really cared about was bigger than the one they typed.
I have been thinking about why this happens, and about what fixes it. The short version is that most AI agents are pointed at databases, and a database was never designed to explain itself to a reader that has no background. A different structure does that job better. It is called an ontology.
02. An ontology
What I mean by an ontology
An ontology is a shared map of what your data means and how it connects. In wealth management, that means things like clients, relationship groups, portfolios and holdings, and the rules that tie them together. A portfolio belongs to a client. A client belongs to a relationship group. A holding sits inside a portfolio.
A knowledge graph is the data stored in that shape: things, and the links between them. You can start at any one thing and walk to the others.
A database holds the same facts as rows in tables. Each table is good at one job. The links between tables exist, but they live in column names, in join conditions, and in the heads of the people who built the reports.
I have built an ontology for private wealth management. The examples below are generic, but they come from that work.
03. One portfolio
Example one: one portfolio, the full picture
Take a client relationship group, which is a family or a household whose wealth is managed together. The group holds several portfolios. Each one might have a different purpose, a different mandate, or a different currency.
Now the relationship manager asks about one of them.
In a table model, the agent looks up that portfolio and gets a line from one table. That line has an identifier, a name and perhaps a status. Everything else sits in other tables: the group, the sibling portfolios, the holdings, the mandate. The agent sees any of it only if a developer has already programmed it to go and look. So the quality of the answer depends on what somebody anticipated when they wrote the code.
In a graph model, one request for the portfolio brings back everything connected to it. The group, the other portfolios and the holdings come along because they are linked, not because someone remembered to ask for them. Nothing is missed through a gap in the plumbing.
04. The same holding
Example two: the same holding, somewhere else
Here is where it starts to matter for decisions.
The manager asks what is held in one portfolio. The table model looks at that portfolio and nothing else. It can't tell the manager that the same client has two more portfolios, and that the same holding also sits in one of them.
That detail changes the conversation. A position that looks modest inside one portfolio can be a much larger exposure across the whole relationship. The manager reading the first answer would walk into the client meeting with a partial picture and no reason to doubt it.
The graph shows the holding across the relationship, because the holding is one thing with several links, not three unrelated lines in three result sets.
My inference is simple: if an agent can't see a connection, it can't reason about it. The agent in the table model wasn't careless. It answered the question it was given, using the information it was handed.
05. Agents and people
Why this matters more for agents than for people
A person with a report in front of them fills gaps from experience. They know which other screens to check. They know the client.
An agent has none of that. It has the tools it has been given, and each tool call is a request to another system: run this query, fetch that record. To answer a question from a database, the agent often has to work out which tables matter, what the columns mean, and how to join them. Then it reads what came back, decides it needs something else, and goes again.
Every one of those steps takes time. Every one also uses tokens, which are the small chunks of text a language model reads and writes, and which is how most providers charge for usage. More steps means more tokens, and more places for a join to go quietly wrong.
With a graph, the agent asks for the right neighbourhood of the data and gets it in one step. The meaning is already attached to the things that come back, so it doesn't have to rediscover the schema on every question. It is faster and cheaper, and it is less likely to miss something.
06. Scale
The size problem
There is a second reason, and it is about scale.
Enterprise databases are huge. Take a data mart, which is a curated slice of the warehouse built for one business area. It sounds contained. In a large organisation, it can still hold a great many tables, with a great deal of history in each.
Opening that up to an AI agent doesn't give it the right context at the right time. Hand it everything, and it drowns in detail it can't weigh. Let it explore, and it has to keep querying to piece together what it needs, one tool call after another, burning tokens as it goes.
An ontology works the other way round. It already knows which things matter to which kind of decision, so it hands the agent the information that bears on the decision in front of it and leaves the rest alone. The agent reads less, and reads the right things.
The consequence for cost follows directly. If the agent makes a handful of calls instead of dozens, and reads a small, relevant slice instead of a sprawling one, token use stays low. I expect the saving to be large, but your own data should be the judge. Pick ten real questions your relationship managers ask, run them both ways, and count the tool calls and the tokens. That test is cheap, and it settles the argument for your own data.
07. Governance
Where governance lives
This is the part that gets less attention than it deserves.
A database relies on data governance. Somebody owns each table and column. Definitions sit in a catalogue. Rules about who may see what are written in policy documents and enforced in code around the edges. That works well when the reader is a person who can look things up and ask a colleague.
An agent doesn't read the catalogue before it runs a query. The governance exists, but it sits beside the data, not inside the path the agent takes.
In a graph, the ontology is the governance layer. It defines what each thing means. It defines how things may connect, so a holding can sit in a portfolio and a portfolio can belong to a group, and an invented link has nowhere to go. It holds the rules those things must follow. Because the agent reads through that layer, the governance reaches it together with the answer.
That is what I care about most in this work. Every great customer experience starts with a good decision, and a good decision from an agent depends on context it can trust and limits it can't step around. Putting the meaning and the rules in one place that the agent actually uses is a design choice, and I think it is the right one. It also leaves human judgement where it belongs: with the people who decide what an agent may know and do.
08. What stays
What this does not replace
The database stays. It is still the system of record, and it is still where the facts are created, stored and corrected. The ontology sits on top of it and gives those facts a shape an agent can use.
Building that layer is real work. Someone has to decide what the concepts are, agree the definitions, and keep them current as the business changes. A graph that nobody maintains will mislead an agent just as confidently as a table that nobody maintains.
09. Three questions
Questions to take back to your team
If you are putting an AI agent in front of a database today, three questions are worth an afternoon.
- What is the question your agent is asked most often, and how many tool calls does it take to answer it?
- What would a person who knows the client see at a glance that the agent's answer leaves out?
- Where do the meaning and the rules for your data live, and does the agent read them on the way to the answer?
Give the agent the map, not the warehouse.
