TL;DR
- An ontology is a shared, machine-readable model of your business: the things that exist (Customer, Order, Listing), how they relate, and the actions allowed on them, mapped onto your real systems.
- Agent + APIs is enough when the work lives inside one or two systems and the definitions are not disputed. Most SMB automations are in this bucket.
- The ontology layer pays off when questions cross several systems, several agents need the same definitions, or the agent writes back to systems where a mistake is expensive.
- Start with a minimum viable ontology of 5–10 objects around one use case. Do not model the whole company up front.
Hand the whole flow to the LLM and let it reason end to end
Ontology as the shared model, with deterministic state-machine guardrails
What an ontology actually is
Not a database and not a diagram. An ontology is a model of the business that sits between your systems and your AI, so the AI reasons about Leads and Listings instead of endpoints and table rows. It has four parts:
Lead, Listing, Showing, AgentThe nouns of the business, each with one canonical ID even if five systems store it differently.
Lead.budget, Listing.price, Listing.cityTyped attributes with one agreed meaning, e.g. “budget” is always USD, always the buyer's stated max.
Lead —viewed→ Listing, Lead —has→ ShowingRelationships stored explicitly, so the agent traverses them instead of guessing joins across APIs.
ScheduleShowing(lead, listing, time)Governed write operations with validation, permissions, and an audit trail, rather than raw POST endpoints.
Same question, two architectures
A real estate brokerage keeps leads in a CRM, listings in the MLS, browsing data in web analytics, and showings in a calendar. The broker asks:
Which of my leads viewed 3+ homes under $1.2M in Irvine last month but haven't had a showing in 14 days?
- 01Call CRM API → list leads (paginated)
- 02Call website analytics → page views per visitor
- 03Match visitors to leads by email or name (fuzzy)
- 04Call MLS API → listing price and city for each view
- 05Call calendar API → showings per lead
- 06Join everything inside the context window
- 01Query: Lead → viewed → Listing (price < 1.2M, city = Irvine)
- 02Filter: count ≥ 3, no linked Showing in 14 days
- 03Action: ScheduleFollowUp(lead), validated and logged
Both can work. The difference is where the integration work happens: on every single request (APIs), or once, ahead of time (ontology).
Where agent + APIs starts to break
None of these show up in a demo. They show up in month three, when more systems, users, and agents are connected.
“Active customer” means paid-in-90-days in billing and logged-in-in-30-days in the product DB. The agent picks one at runtime, differently each time.
The definition is written down once and every agent uses it.
The same person is a contact ID in the CRM, an email in Stripe, and a phone number in the calendar. The agent fuzzy-matches on every request.
Entities are resolved once at ingestion; the agent sees one Lead.
A question across 4 systems is 4+ tool calls plus a join. If each step is 95% reliable, the chain is ~81%, and it costs tokens and latency every time.
Cross-system questions become one traversal over pre-linked data.
The agent holds API keys with system-wide access. Row-level permissions and audit are re-implemented per integration, or skipped.
Permissions and audit live on objects and actions, so every agent and app inherits them.
The agent can call any endpoint it has a key for. Business rules (“never discount below margin”) live in a prompt.
Actions carry validation rules in code. The agent can only propose writes the business allows.
Agent #2 rebuilds the same integration glue as agent #1, with slightly different assumptions.
Build the model once; every new agent, dashboard, or app plugs into it.
Ontology vs. RAG: different layers, not rivals
Both give an AI access to business knowledge, so they get compared. But RAG decides which text the model reads; an ontology decides what the business's objects are. They answer different questions.
“How many of our Irvine listings are in HOAs that cap rentals?”
- 01Embed the question; retrieve the top-k chunks
- 02Chunks mention a few HOAs with rental caps
- 03Model counts what is in front of it
- 04Answer: “at least 3”, with no way to know what was missed
- 01Traverse: Listing → in → Property → governedBy → HOA
- 02Filter: HOA has a Clause where ruleType = rental_cap
- 03Return an exact count, with the list behind it
Aggregation and completeness questions are where similarity-based retrieval breaks. They need structure.
Most real systems use both: retrieval or long context to read documents, and LLM extraction to turn what was read into ontology objects (a clause, a limit, an obligation), so the next question is a query instead of another reading. Graph-based retrieval (GraphRAG) sits between the two. The Listing & Lease Compliance case study shows this pattern in practice, and “Why Everyone Built RAG, and Why Many Teams Are Moving On” covers where classic RAG still fits.
Do you need one? Check what applies
Most small businesses running one or two SaaS tools don't need an ontology yet, and shouldn't pay for one. Tick what's true for your use case:
Agent + APIs is enough
Connect the agent to your tools (APIs or MCP servers) and ship. Write your key definitions into a short glossary the agent reads, and revisit when you add systems.
What the extra layer costs
The cost of the ontology is mostly fixed and paid up front. The cost of not having one grows with every system and agent you add. The crossover is the point where it's worth it.
Start with a minimum viable ontology
Not a six-month modeling project. One question, the few objects it needs, shipped and measured.
- 01Pick one high-value question the business asks weekly and can't answer quickly.
- 02List only the objects and links that question needs, usually 5–10.
- 03Agree on definitions with the people who own the numbers and write them down.
- 04Resolve identities for those objects across sources; sync on a schedule.
- 05Expose objects and 1–3 governed actions to the agent as tools (MCP works well here).
- 06Ship, measure answer accuracy against a test set, then add the next use case.
Implementation options
Tables and views for core objects, one MCP server exposing object-level tools and validated actions.
Governed metrics and definitions on top of a warehouse. Strong for “what is our number” questions.
Best when the value is in multi-hop relationships: supply chains, fraud, research data.
Objects, links, actions, and permissions as a managed platform. Heavy, but complete.
Ontology and MCP are not either/or. MCP is how the agent connects; the ontology decides what it connects to. Exposing get_lead and schedule_showing as MCP tools beats exposing forty raw CRM endpoints.
More guides
Want this built into your workflow?
I help small and mid-size teams decide what to build, then build it, from the first eval set to production guardrails.
Talk through your use case