this is the right problem, valid sql and the wrong number is what kills every data agent. but retrieving the definitions and then still letting the model write the sql leaves the joins up to the model.
in deeporg the agent never writes sql, it writes graphql against your databases as one graph, the relationships and join paths live in the compiler and it turns that into a single query with the access rules already applied
https://x.com/techNmak/status/2126340380950229228
@techNmakA banger from NVIDIA! 🔥
They've open-sourced a system that gives AI agents something traditional database schemas don't => an understanding of what the company's data actually means.
It's called Auto Ontology, and the GitHub repo has already crossed 15,000 stars.
Think about asking an AI agent, "What was our revenue last quarter?"
Your database might contain hundreds of tables, multiple revenue definitions, complicated joins, and columns whose names reveal almost nothing about their meaning.
An LLM can generate perfectly valid SQL and still calculate the wrong number.
NVIDIA's approach is pretty interesting.
Auto Ontology automatically builds a semantic knowledge graph from enterprise database metadata, connecting:
→ Business concepts to actual tables and columns
→ Relationships and valid join paths
→ Metrics to reusable SQL calculations
→ Definitions, synonyms, and data lineage
→ Human-reviewed definitions that agents can reuse
When an agent receives a question, it retrieves the relevant business context before generating SQL.
It can also return the query and execution steps alongside the answer, allowing developers to inspect where the result came from.
The ontology is exposed through MCP, CLI, and API, so different AI agents can work with the same shared definitions.
Completely open source under Apache-2.0.
Here's the GitHub Repo: https://github.com/NVIDIA/auto-ontology