Semantic layer and ontology for AI agents: the substrate that makes them reliable
An agent that talks directly to every database guesses the joins, confuses metrics and acts on wrong assumptions. An ontology-based semantic layer moves meaning out of the agent. Here is the architecture, and how QDNA deploys it on a sovereign serverless substrate, governed all the way down to the kernel.

The problem: many agents, many sources
As long as an organisation aligns a few agents with a few sources, each agent learns the schemas and rules of each source. The number of couplings grows as M times N. Each agent carries knowledge of the joins, the metric definitions and the access rights. The day a definition changes, it must be fixed in every agent.
Language models make the risk worse. They produce plausible text, not a correct answer over a structured domain. Without explicit context, an agent guesses. And when an agent guesses, it picks the wrong join, misreads a metric and acts on a false assumption. Forrester sums up the cause: data without meaning stays unusable for an autonomous system.
The semantic substrate: ontology plus knowledge graph
The answer is to insert a layer between agents and data. This layer holds the meaning. It is built on two blocks. The knowledge graph stores the facts as entities connected by relationships. The ontology holds the meaning: what a customer is, how it relates to an account, which constraints apply. The graph stores, the ontology explains.
The agent becomes thin. It reasons over concepts and leaves the joins, entity resolution and business rules to the substrate. Complexity returns from M times N to M plus N: each agent talks to the substrate, each source plugs into the substrate, and no one relearns anyone else's work. Governance and access control live in the same place, once, for every agent.

This architecture does not replace your data warehouse or your databases. It sits on top. The sources stay in place, but agents no longer touch them directly. The three-layer memory is modelled in the same graph: episodic memory for history, semantic for facts, procedural for tasks. A single traversal call makes all three available, with no external memory service. The Open Knowledge Format describes this content in a portable, versionable way.
How a request flows through the platform
A natural-language request arrives from the client. The agent interprets it, plans, but writes no raw SQL. It calls a governed tool through a gateway. The gateway applies policy, quota and identity, then forwards to the substrate. The ontology turns the intent into a governed query, in Cypher or SQL, against the knowledge graph. The graph reads the targeted source. The response flows back, governed and traceable: you know which concepts produced which result.

Three interfaces connect the graph to the agents. The MCP protocol exposes standardised tools the agent calls. Graph query languages, Cypher for property graphs and SPARQL for triple stores, serve structured queries. REST or GraphQL APIs cover the rest. The gateway acts as a single control point. Our LiteLLM page describes the gateway on the model side, and the semantic router page covers request routing.
Governing twice: at the meaning and at the kernel
The semantic layer governs at the logical level. It decides which concepts an agent sees and which rules apply. That control stays in application space. A compromised agent, or a model that goes off the rails, sometimes tries to open an outbound connection outside the intended boundary. Logical governance alone does not stop it at the right level.
The solution adds a second barrier at the kernel, with eBPF. Programs loaded into the kernel watch system calls and network flows per isolate. A policy blocks the action before it completes, without going through a user-space agent. The Tetragon project shows the way: filtering and blocking directly in the kernel, correlation between process and network flow, less than one percent overhead. The operating rule stays cautious: observe first in audit mode, tune the false positives, then turn on blocking.
The result combines two guarantees. The semantic substrate guarantees that the agent reasons over the right concepts. The eBPF foundation guarantees that no outbound flow leaves the isolate without authorisation. This dual governance, logical and physical, sets a reliable agent platform apart from a mere context layer.
A serverless and sovereign substrate
The knowledge graph does not require an expensive dedicated server. A durable object hosts an isolated SQLite database, one per tenant or one per agent. A query on one graph never sees another's data. Each agent runs in a lightweight isolate that scales on demand and drops to zero between tasks. Ten thousand agents active one percent of the time mobilise only about a hundred instances at any moment, where an always-on machine model would reserve ten thousand.
This economics matters for an agent workload, intermittent and massively parallel by nature. It deploys on your hardware, in your data centres or in managed data centres, with no dependency on an external service. Moving from a chatbot to an agentic platform rests on this foundation, and our enterprise RAG guide details document access through the same layer.
BI semantic layer, or ontology for agents?
The term semantic layer comes from analytics. A tool such as a metrics engine defines the indicators once, then serves them to every dashboard. It is the same decoupling principle. But an agent needs more than a metric definition. It needs the meaning, the relationships and the reasoning rules that the ontology carries.
| BI semantic layer | Ontology and knowledge graph for agents |
|---|---|
| Defines metrics and dimensions | Defines entities, relationships and rules |
| Serves consistent numbers to dashboards | Serves reasoning context to agents |
| SQL, REST, GraphQL interface | MCP, Cypher, SPARQL, API interface |
| Answers a measurement question | Guides a decision and an action |
The two complement each other. An ontology without metric governance leaves the agent unable to calculate correctly. A metrics layer without domain knowledge leaves it unable to reason. The substrate that connects the two is what QDNA installs and operates.
Frequently asked questions
What is a semantic layer for AI agents?
It is a layer that exposes the meaning of the domain, not the raw tables. An ontology defines the entities, relationships and rules; a knowledge graph connects them; agents query this model instead of writing joins. Context, business rules and access control live in this layer, once, for every agent.
What is the difference between an ontology and a knowledge graph?
The knowledge graph holds the facts: entities connected by relationships. The ontology holds the meaning: what a customer is, how it relates to an account, which constraints apply. The graph stores, the ontology explains. A solid agent deployment needs both, plus governance that decides what is accessible.
Why add eBPF to an agent platform?
The semantic layer governs at the logical level: which concepts, which rules. eBPF governs at the kernel level: which isolate may open which outbound connection, which system calls are allowed. An agent that steps outside the boundary is blocked in-kernel, before the action, with less than one percent overhead. Logical governance and physical enforcement complement each other.
Can this substrate be deployed as sovereign serverless?
Yes. A knowledge graph fits inside a durable object with its own SQLite database, isolated per tenant, served as a global API. Agents run in lightweight isolates that scale on demand and drop to zero. The whole system deploys on your hardware, inside your walls, with no dependency on an external managed service.
Build a governed agent platform
A conversation to scope your semantic substrate, the knowledge graph and the enforcement, on your site.
Book a callReferences
- Build Meaning Before Machines, Forrester
- Ontology and Knowledge Graph in the Age of AI and Agents, Enterprise Knowledge
- Tetragon, security observability and runtime enforcement (eBPF)
- Unlimited on-demand graph databases with Durable Objects, Boris Tane
- Building a Least-Privilege AI Agent Gateway with MCP, InfoQ