skulldc

NVIDIA Auto Ontology builds a certified semantic layer for text-to-SQL agents

Auto Ontology drafts an ontology from database metadata, has people certify it, and lets agents answer data questions with the SQL and steps attached.

What it is

Auto Ontology is an open library from NVIDIA, released under the Apache-2.0 license, that builds a context layer for agents answering questions over enterprise data. The README frames the problem around reliability: “a revenue metric answered faster is worth nothing if the number is wrong.” The library builds that layer from enterprise metadata, reconciles definitions across systems, and exposes it to any agent harness through MCP, CLI, and API. The repository was created on 2026-04-27 and is written mainly in Python. The maintainers state that the project is currently not accepting external contributions.

Generate, certify, answer

According to the README, Auto Ontology works in three stages: it generates an ontology, people certify it, and the agent answers questions from it. The ontology holds three kinds of definition: terms (business concepts such as Customer or Invoice Line, mapped to the columns that hold them), SQL attributes (reviewed SQL expressions under a term, such as a margin or a rolling total), and relationships (how tables join, including bridge tables).

The ingestion service drafts the ontology. It extracts schemas, profiles columns and samples values, extracts terms table by table, infers joins, and suggests SQL attributes from query history. Everything is stored in Postgres, with embeddings in pgvector for retrieval. In the README’s example, one compilation of Wide World Importers, Microsoft’s sample sales database, produced 31 terms.

People then test the draft with real questions, refine terms and SQL attributes in the UI or through the API, and certify them once they are correct. At question time the agent classifies the intent, retrieves candidate terms, columns and SQL attributes by embedding search, writes SQL, checks the filter values and the query against the database, repairing the SQL when a check fails, and returns the answer with its SQL and the steps it took. When the candidates cannot support a query, the agent reports that the question cannot be answered from this data.

Stack and models

The stack is a Next.js web UI with Better Auth, a FastAPI backend that uses LangChain for the text-to-SQL agent, a FastAPI ingestion service, a FastMCP server, and PostgreSQL 17 with pgvector. HashiCorp Vault is optional for storing connection credentials. Deployment is via a Helm chart for Kubernetes or Docker Compose for a local stack.

Inference goes through NVIDIA NIM endpoints, either hosted or self-hosted. The defaults in .env.example are nvidia/nemotron-3.5-lightning-30b-a3b as the LLM, nvidia/nemotron-3-embed-1b for embeddings and nvidia/llama-nemotron-rerank-vl-1b-v2 for reranking. Each model role is configured by a triplet of endpoint, API key and model variables, and any field left unset falls back to the matching DEFAULT_MODELS_* value.

The README includes a security note worth reading before any deployment: keep ports 3001 and 3002 on a private network. FastAPI trusts the user identity the frontend forwards in the x-auto-ontology-user-id header, and the ingestion service’s endpoints have no authentication of their own.

Use from an agent

The MCP server gives any MCP client read-only tools over the ontology, and every call runs with the signed-in user’s permissions. The tools include check_readiness, search_terms, check_answerable and ask_question. The README runs the server against a deployment with:

AUTO_ONTOLOGY_API_URL=http://localhost:3000 \
 uvx --from "git+https://github.com/NVIDIA/auto-ontology.git#subdirectory=mcp" auto-ontology-mcp

Auto Ontology can also import and export model definitions as Ossie YAML. Apache Ossie is described in the README as the open standard for exchanging semantic models.


Source: NVIDIA/auto-ontology on GitHub