What is Auto Ontology?
Auto Ontology is an open-source library from NVIDIA that builds a context layer for agents that query enterprise data. It generates an ontology from database metadata, connects existing ontologies and semantic models, and reconciles metric and entity definitions that disagree across systems. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed Apache-2.0.
Overview
Auto Ontology is an open-source library from NVIDIA that builds a context layer for agents that query enterprise data. It generates an ontology from database metadata, connects existing ontologies and semantic models, and reconciles metric and entity definitions that disagree across systems. Agents use that layer to learn where data lives, what it means and how to use it. The goal is reliable agentic analytics: a quickly answered revenue question is worth nothing if the number is wrong. Generated queries are checked against certified definitions and lineage, and every answer carries its provenance.
The project is a full stack rather than a single package. A Next.js web UI handles chat, analysis, the data catalog, analytics and settings, plus authentication and role-based access through Better Auth. A FastAPI backend built on LangChain runs the chat and natural-language-to-SQL flow, the catalog and the datasource APIs. An ingestion worker ingests tabular data and writes embeddings, and Postgres with pgvector stores the app metadata, the catalog and ontology, and the vectors. HashiCorp Vault can optionally hold connection credentials. Source databases can be Databricks, Postgres, Snowflake or DuckDB.

Inference goes through NVIDIA NIM endpoints, either the hosted NVIDIA API catalog or self-hosted NIMs. The template defaults to Nemotron 3 Nano 30B-A3B for reasoning, Nemotron 3 Embed 1B for embeddings and Llama Nemotron Rerank VL 1B v2 for reranking. Each role (reasoning, non-reasoning, embedding, rerank) is set by an endpoint, API key and model triplet that falls back to shared defaults. The project is Apache-2.0 licensed and does not accept external contributions.
What it does
- Generates enterprise ontologies from database metadata, connects existing ontologies and semantic models, and reconciles inconsistent definitions across systems
- Natural-language querying: questions become SQL that runs against connected Databricks, Postgres, Snowflake or DuckDB sources
- Validates generated queries against certified definitions and lineage and returns provenance with every answer
- Serves the context layer to agent harnesses through an MCP server, a CLI and an authenticated REST API with streaming, multi-turn chat completions
- Better Auth login with SSO, RBAC and per-user API tokens, with optional HashiCorp Vault for connection credentials
- Docker Compose for a local stack or a Helm chart for Kubernetes, with ready-made agent skills for setup, management and querying
Getting started
The README's local path is Docker Compose. You need Docker with Compose v2, an NVIDIA API key (nvapi-…) from build.nvidia.com for NIM inference, and connection details for the database you want to query. Kubernetes deployments use the Helm chart described in DEPLOYMENT.md.
Clone the repository
Clone the project and move into it.
git clone https://github.com/NVIDIA/auto-ontology.git auto_ontology && cd auto_ontologyCreate the environment file
Copy the template and fill in the Postgres credentials, DEFAULT_MODELS_API_KEY and CONNECTION_STRINGS. AUTH_SECRET and APP_URL are required: without them every page fails with a Better Auth "default secret" error.
cp .env.example .env
# edit .envBuild and start the stack
This builds the backend and frontend images and brings up Postgres and pgAdmin. A one-shot migration job syncs the database schema, then the backend, ingestion service and frontend start.
docker compose up -d --buildOpen the UI and connect data
Open http://localhost:3000. The backend API listens on :3001 and pgAdmin on :5050. Connections added in the UI are stored in plaintext in Postgres unless Vault is configured. CONNECTION_STRINGS is only a fallback, used when no UI connections exist.
Query from a script with an API token
In the user menu, open API Tokens and create a token. It is shown only once. Send it as x-api-key on any /api call. POST /api/chat/completions streams step, result or error events followed by [DONE]. Pass a conversation_id UUID to continue a thread.
import os
import requests
session = requests.Session()
session.headers["x-api-key"] = os.environ["AUTO_ONTOLOGY_API_TOKEN"]
terms = session.get("https://auto_ontology.example.com/api/terms").json()
answer = session.post(
"https://auto_ontology.example.com/api/chat/completions",
json={"question": "How many orders shipped last week?"},
).json()Connect an agent over MCP
The MCP server is an HTTP client of the public API and holds no credentials of its own. Users sign in through Auto Ontology's own login, and each call runs with that user's permissions. Run it against your deployment, then point Cursor, Claude Desktop or another MCP client at the server's /mcp endpoint.
AUTO_ONTOLOGY_API_URL=http://localhost:3000 \
uvx --from "git+https://github.com/NVIDIA/auto-ontology.git#subdirectory=mcp" auto-ontology-mcp
# client config
{
"mcpServers": {
"auto-ontology": { "url": "https://auto-ontology-mcp.example/mcp" }
}
}Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give an analytics agent trusted business definitions of metrics such as "active customer" before it writes SQL
- Reconcile conflicting metric definitions across Databricks, Snowflake and Postgres into one governed semantic catalog
- Expose warehouse data to Cursor, Claude Desktop or an internal agent through MCP while keeping each user's role-based permissions
- Run self-hosted natural-language querying over enterprise databases on NVIDIA NIM models, hosted or on-prem
How Auto Ontology compares
Auto Ontology alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Dify | ★ 162k | An open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code. |
| graphify | ★ 155k | Turns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store. |
| RAGFlow | ★ 95k | A RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer. |
| Context7 | ★ 65.7k | Context7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server. |
| Pathway | ★ 61.9k | A Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes. |
| LightRAG | ★ 41k | A graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates. |
| PageIndex | ★ 40.8k | PageIndex turns long PDFs into a table-of-contents tree and uses LLM reasoning to retrieve relevant sections, with no vector database and no chunking. |
| Auto Ontology | ★ 18.1k | NVIDIA's ontology context layer for agent text-to-SQL |
