Business ontology, knowledge graphs and agentic AI: what I learned building 15 open-source projects, most of which run in a browser tab
OntoCompute running Qwen2.5-7B in the browser. The left column applies the business rules as English prose; the right column compiles them into OWL axioms and runs a reasoner. Same model, same facts, same questions.
Every agent demo looks smart until you ask it something only your business knows.
"Which products are blocked from release?" "Who owns this service?" "Does this policy apply to that customer segment?" A language model can write a convincing answer to all three. It cannot tell you whether that answer is true for your organisation, because the meaning of "blocked", "owns" and "applies" lives nowhere it can read. It lives in people's heads, in spreadsheets and in tables nobody documented.
That is what a business ontology is for. It writes down the nouns of a business (classes), the verbs that connect them (relationships), the facts (individuals), and, most importantly, the rules that turn old facts into new ones. Give an agent an ontology and it stops guessing what your words mean.
Over the past year I have built a series of open-source projects around this one idea, from Protégé plugins to browser-only apps that run a small model on your GPU. This article ties them together into one picture: how to capture a business ontology, connect it to graph databases, retrieve from it with GraphRAG, reason over it deterministically, and finally act on it with agents. Every project below is on GitHub, and most have a live demo you can open right now.
The five layers of an ontology-backed agent
Here is the mental model I ended up with after building all of this:
| Layer | Question it answers | What fails without it | Projects |
|---|---|---|---|
| 1. Capture | What are the things in this business, and how do they relate? | The agent invents its own vocabulary | GraphBaby, OntoLive, VidyaAstra Protégé plugin |
| 2. Connect | Where do the facts live, and how do I query them? | The ontology is a diagram nobody uses | Neo4j–Protégé plugin, Agentic Knowledge Graph (Kuzu), VidyaAstra |
| 3. Retrieve | Which facts does this question need? | Flat vector search misses multi-hop answers | GraphRAG for Java, Lucene RAG, SAGE, OpenTube Graph |
| 4. Reason | What follows from those facts under our rules? | The model applies rules halfway, differently each time | OntoCompute, Agentic Business Rules Engine |
| 5. Act and govern | What should happen, and is it allowed? | Agents act on stale or unchecked knowledge | GraphRAG Governance, GraphAgent |
Most "GraphRAG" discussions stop at layer 3. Most failures I measured happen at layer 4.
Layer 1: Capture the ontology (without a Java install)
The oldest objection to ontologies is that building one is slow and needs specialist tools. Language models change that, as long as you don't trust them blindly.
GraphBaby: from text, PDFs or a database to an ontology, in the browser
Live demo: vishalmysore.github.io/graphbaby · Code: github.com/vishalmysore/graphbaby
GraphBaby is an AI-assisted ontology editor that runs entirely client-side. A small model (via WebLLM on WebGPU) extracts classes, relationships and individuals from text or a PDF through a three-step wizard: Classes → Relationships → Individuals. You approve each step, and every extracted individual carries the source excerpt that backs it, so provenance is visible before anything enters the graph.
The feature I'd point a business audience to first is Database → Graph. Most business knowledge already sits in relational tables. GraphBaby loads a .sqlite file or runs SQL with sql.js and maps it deterministically, with no model involved: tables become classes, columns become data properties, foreign keys become object properties, rows become individuals.
A small film database mapped into an ontology. Film, Actor, Director and Role became classes; the foreign keys became the film, actor and director relationships.
GraphBaby also implements ideas from the MAGMA multi-graph agentic memory paper (ACL 2026): every relationship is tagged with a lane, semantic, temporal, causal or entity, and chat questions are routed along the matching lane instead of one flat similarity search. Ask "why?" and it follows causal edges:
Export goes to JSON, OWL/XML, SQL or CSV, so the ontology can travel back into the systems it came from.
OntoLive: watch a model write an ontology, and catch it when it lies
Live demo: vishalmysore.github.io/ontolive · Code: github.com/vishalmysore/ontolive
OntoLive is an OWL viewer that needs only a browser tab: drop in an .owl or .ttl file and browse the class hierarchy as a live diagram. Its second mode is the one that matters for agents. A small model reads a paragraph and writes an ontology one line at a time, and the diagram grows with every token. Guardrails check each partial answer and turn a class red the moment the model puts it in a subclass cycle, makes it its own parent, or invents a near-duplicate.
The paragraph is a deliberate trap ("a manager is really just a team lead"). Qwen2.5-1.5B writes Manager ISA Manager; the guardrail flags it before it ever reaches a graph.
This is the pattern I'd recommend for any business ontology pipeline: let the model draft, let structure check. OWL gives you the checks for free.
VidyaAstra for Protégé: describe the change, let the OWL API apply it
Code: github.com/vishalmysore/vidyaastra-protege-plugin
For teams already using Protégé, the VidyaAstra plugin adds three AI modes inside the editor: ask questions about the ontology in plain English, generate a new ontology from a description, and modify an existing one by describing the change ("add a Supplier class with a supplies relationship to Product"). The edits are applied through the OWL API, so the result is a real, valid ontology rather than text pasted into a file. It also adds an interactive graph view with several layouts.
Layer 2: Connect the ontology to where the facts live
An ontology describes the shape of knowledge. The facts themselves usually live in a graph database. The gap between the two is where most projects stall.
Neo4j–Protégé plugin: one workspace for ontology and graph
Code: github.com/vishalmysore/neo4j-protege-plugin
This plugin connects Protégé to a Neo4j database (including Neo4j Aura) and syncs in both directions: import graph data as OWL entities, or export a Protégé ontology into Neo4j. It also translates English questions into Cypher with an LLM and asks you to confirm the generated query before running it, a small human-in-the-loop step that matters a lot once agents start writing queries against real data.
Agentic Knowledge Graph with Kuzu: a graph that lives inside the agent
Code: github.com/vishalmysore/agenticknowledgegraph
Not every agent needs a graph server. Kuzu is an embeddable graph database, so the knowledge graph can sit inside the agent process, on a laptop or at the edge. The project walks through five domains with ten progressively harder Cypher queries each, and wires the graph into agents through the Tools4AI framework so graph operations become callable actions.
VidyaAstra: knowledge graphs you can browse
Live demos: Mahabharata · Ramayana · Meghdoot · Code: github.com/vishalmysore/VidyaAstra
VidyaAstra is my toolkit for building large knowledge graphs and publishing them as interactive pages. The epics are a deliberate stress test: the Mahabharata graph has 64 main characters and thousands of events, with alliances, rivalries and timelines that make most business domains look tidy. If a modelling approach survives that, it will survive an org chart. The repository also compares graph engines (Neo4j, Oracle Graph, RushDB, Kuzu and others) side by side.
Layer 3: Retrieve with the structure, not around it
Classic RAG chops documents into chunks and finds the ones whose embeddings are closest to the question. That works for "what does the policy say?" and fails for "which teams are affected if this service goes down?", because the answer is spread across several hops.
GraphRAG for Java and Lucene RAG: retrieval that respects OWL
Code: github.com/vishalmysore/graphrag · github.com/vishalmysore/lucene-protege-plugin
Two Protégé plugins, two storage choices. GraphRAG for Java indexes Neo4j graph data and ontology structure into an in-memory vector store and answers questions from both. The Lucene plugin stores vectors on disk with Lucene's native KNN fields and, more interestingly, adds OWL-aware chunking: ten strategies, six of which split an ontology along its own structure (by class, by namespace, by property, including the "orphan" axioms that belong to no class) rather than by character count.
How you chunk an ontology decides what the model can see. Splitting by namespace or class keeps related axioms together.
SAGE: structure-aware graph expansion
Code: github.com/vishalmysore/sagejava
SAGE operationalises the 2026 paper Structure Aware Graph Expansion for Retrieval of Heterogeneous Data (arXiv:2602.16964). Retrieval happens in two stages: pick seed nodes by similarity, then expand along graph edges to pull in neighbours that a flat search would never rank highly. The similarity function is pluggable (zero-dependency Jaccard or dense embeddings), graph operations are exposed as Tools4AI actions, and results export to JSON-LD with Schema.org for interoperability.
OpenTube Graph: GraphRAG you can try in ten seconds
Live demo: vishalmysore.github.io/OpenTube · Code: github.com/vishalmysore/OpenTube
OpenTube rebuilds Andrej Karpathy's HackerTube (the YouTube videos people recommend in Hacker News comments) in the open, with measured accuracy and cost, and adds a knowledge graph linking videos, topics, threads and commenters. The "Ask the graph" page runs SAGE-style expansion entirely in the browser: MiniLM embeds your question, the closest videos become seeds, and the graph pulls in neighbours through shared threads, shared commenters and similarity edges before WebLLM writes a cited answer.
The filtering pipeline is itself a small agentic cascade: Laya, a typed-decision model, makes the cheap yes/no call, and only uncertain cases go to Qwen2.5-1.5B.
Layer 4: Reason with code, not prose
This is the layer most enterprise "ontology + LLM" stacks quietly skip, and it is where my measurements were most striking.
OntoCompute: rules as code, not prose
Live demo: vishalmysore.github.io/ontoCompute · Code: github.com/vishalmysore/ontoCompute
A business rule produces new facts from old ones: "if A depends on B and B depends on C, A depends on C", or "a package is release-blocked if it is exposed to an advisory that is critical and open". Many current stacks write these rules as English sentences in the prompt and ask the model to apply them.
OntoCompute (inspired by Miodrag Cekikj's measurement of an enterprise ontology product in AI Advances) asks the same twelve questions two ways in a browser tab:
- Prose: the rules go into the prompt as English. The model applies them.
-
Compiled: the rules are OWL axioms (
owl:TransitiveProperty,owl:propertyChainAxiom) and a Datalog-style join. A few hundred lines of TypeScript reasoner apply them; the model only translates the question into a one-line query.
With Qwen2.5-7B, five runs per question:
| Prose | Compiled | Reasoner only | |
|---|---|---|---|
| Right answers | 32 of 60 (53%) | 60 of 60 (100%) | 12 of 12 |
| Same answer every time | 6 of 12 questions | 12 of 12 questions | always |
| Chain questions | 40% | 100% | 100% |
| Join questions | 47% | 100% | 100% |
Two findings matter for anyone building agents on a business ontology:
- A bigger model barely helped prose mode (50% → 53% from 3B to 7B) but took compiled mode from 65% to 100%. Applying English rules is the hard part, and it stays hard. Turning a question into a query is the easy part.
- Consistent is not the same as correct. On "which packages are release-blocked?", the 7B model gave the same wrong list in all five runs. Testing an assistant once, or even five times, would not reveal the problem.
Compiled mode also returns a proof for every answer, down to the stated facts, and treats "the ontology doesn't model this" as a typed result (NOT_IN_SCHEMA maintainer) rather than an error. That one design choice lets an agent route the question to documents instead of failing or hallucinating.
Agentic Business Rules Engine: English in, typed rules out
Code: github.com/vishalmysore/agenticrulesengine
The same principle, in Java. Business users write rules in plain English; an LLM turns them into typed Java objects; and evaluation is ordinary, deterministic, debuggable Java. The model is used once, at authoring time, not at decision time. You get the accessibility of natural language and the predictability of code, with audit trails and validation on the way in.
Layer 5: Act and govern
Once an agent can find the right facts and apply the right rules, two questions remain: what should it do, and is it allowed to?
GraphRAG Governance: compare regulations as graphs
Live demo: vishalmysore.github.io/graphraggovernance · Code: github.com/vishalmysore/graphraggovernance
Governance frameworks are ontologies written as prose. This project turns each one (the EU AI Act and Singapore's Model AI Governance Framework in the sample) into a JSON-LD knowledge graph, gives every concept a canonical_id so "Human Oversight" can match "Human Oversight of AI", and classifies every concept as a Match, Missing, Extension or Conflict (same concept, different obligation, such as mandatory versus voluntary). It is a template for any "policy A versus policy B" question an agent might face: map both into the same ontology first, then compare.
GraphAgent: a living causal graph behind the UI
Code: github.com/vishalmysore/graphagent
GraphAgent models a business as a causal graph of metrics, decisions, services, teams and external events, linked by influences, depends_on, owns and caused_by edges. When a user clicks a node (or several), the agent explains it from the graph: what is driving it and what is connected to it. It speaks the A2A and A2UI protocols, so the graph and its explanations can be rendered by any compatible agent client.
Seven design rules for business-ontology AI
What I would tell anyone starting this work, distilled from the projects above:
- Start from the data you already have. Tables, foreign keys and existing taxonomies map to an ontology deterministically. Use the model for the gaps, not the bulk.
- Let the model draft; let structure check. Cycles, self-subclassing and near-duplicates are cheap to detect on every token.
- Keep provenance on every fact. If an individual can't point at the sentence or row it came from, it shouldn't be in the graph.
- Chunk and retrieve along the ontology's own structure. Class, namespace and relationship boundaries beat character counts, and graph expansion beats flat similarity for multi-hop questions.
-
Compile your rules. OWL has had
TransitivePropertysince 2004 and property chains since 2009. A reasoner applies them to every fact, every time, in milliseconds. - Make "not modeled" a result, not an exception. An agent that knows what its ontology doesn't cover can route instead of guess.
- Measure determinism, not just accuracy. Ask the same question several times. A stable wrong answer is the most dangerous kind.
Every project in one place
| Project | What it does | Live demo | Code |
|---|---|---|---|
| OntoCompute | Rules as OWL axioms vs rules as prose, measured in the browser | Open | GitHub |
| OntoLive | Browser OWL viewer; an LLM writes an ontology token by token with guardrails | Open | GitHub |
| GraphBaby | AI ontology editor: text, PDF or database → knowledge graph, MAGMA-style lanes | Open | GitHub |
| OpenTube Graph | Measured HackerTube rebuild with in-browser GraphRAG | Open | GitHub |
| GraphRAG Governance | AI regulations as aligned knowledge graphs: match, missing, extension, conflict | Open | GitHub |
| VidyaAstra | Large interactive knowledge graphs and graph-engine comparisons | Open | GitHub |
| NL2SQL Benchmark | How NL-to-SQL accuracy degrades as schemas get harder (the semantic-layer problem) | Open | GitHub |
| VidyaAstra Protégé plugin | Create, modify and query ontologies in plain English inside Protégé | — | GitHub |
| Neo4j–Protégé plugin | Two-way sync between Protégé and Neo4j; English → Cypher with confirmation | — | GitHub |
| GraphRAG for Java | RAG over Neo4j graphs and ontology structure, inside Protégé | — | GitHub |
| Lucene RAG plugin | Disk-based KNN RAG with ten OWL-aware chunking strategies | — | GitHub |
| SAGE (Java) | Structure-aware graph expansion for retrieval, with JSON-LD export | — | GitHub |
| Agentic Knowledge Graph | Embedded Kuzu graphs wired into agents with Tools4AI | — | GitHub |
| Agentic Business Rules Engine | English rules → typed Java objects → deterministic evaluation | — | GitHub |
| GraphAgent | Living causal business graph with A2A / A2UI explanations | — | GitHub |
Closing thought
The industry spent two years teaching models to read documents. The next step is teaching agents to respect a model of the business: its vocabulary, its relationships and its rules. That model already has a name and a 20-year-old standard behind it. The difference now is that you can build one, query it and reason over it in a single browser tab, with a small model doing the drafting and a reasoner doing the deciding.
Open any of the live demos above, break them, and tell me what you find. Everything is open source, and issues and pull requests are welcome.
All code is at github.com/vishalmysore. More writing at medium.com/@visrow.
#ontology #knowledgegraph #graphrag #agenticai #aiagents #owl #semanticweb #webgpu #opensource









Top comments (0)