v0.4.0 released · Apache 2.0

AI agents that get the number right, and prove it.

Cosmos Semantic is an open-source semantic layer with an ontology at its core. Define metrics, business rules and concepts once. Agents ask for a governed metric over MCP instead of guessing SQL, and every answer carries its evidence.

Open the live demo

No install needed for the demo: read-only console, synthetic data.

The console, 45 seconds, no sound.

"Revenue" has three definitions. "Active customer" means 60 days to one team and 90 to another.

An agent that writes SQL straight over raw tables returns numbers that look right and that nobody can explain. Cosmos Semantic puts the business definitions between the agent and the data.

How it works

Define once. Serve everywhere. Prove every answer.

  1. 1

    Define

    Metrics, dimensions and business rules in YAML with the dbt Semantic Layer vocabulary, a bilingual SKOS glossary, owners and tests. Or import them from dbt, Power BI, Cube and Apache Ossie.

  2. 2

    Serve

    A native MCP server for AI agents and a REST API for apps. Agents find the concept, ask for the metric and get deterministic SQL. Personal data never reaches them.

  3. 3

    Prove

    Every answer carries the expanded formula, the rules applied, the row filters, the reference date and hashes. cosmos replay tells whether a number changed, and why.

Features

Built for the questions agents get wrong.

Multi-database

One model, the same number on eight databases, checked by the test suite on every change.

Ontology

A bilingual business glossary (SKOS), versioned business rules with owners and tests, and a knowledge graph of teams, systems and processes.

Built for AI agents

A native MCP server, listed in the official MCP registry. Agents ask for governed metrics, and requests for personal data are refused and logged.

Verifiable numbers

Evidence on every answer and replay of any audited query: tell whether a number changed and why.

Reconciliation

Compare a governed metric with the legacy SQL a team already uses, and get the likely cause of each divergence.

Open, no lock-in

Apache 2.0 and its own engine. Import from dbt, Power BI, Cube and Apache Ossie; export to dbt, Cube, Ossie and SKOS.

Multi-database

Same question, same number.

Dialects differ in integer division, rounding, booleans, week numbering and "today". The engine handles them, and an equivalence suite runs the same reference queries on every database in CI.

  • Databricks
  • Snowflake
  • Oracle
  • SQL Server
  • PostgreSQL
  • MySQL
  • MariaDB
  • DuckDB

See it

From pip install to the same number on six databases.

A 90-second narrated walkthrough with captions. Every command output in it is real.

The live demo console

Read-only, synthetic data. Metric health, audited answers, business processes as graphs, the catalog in business words, and the query explorer.

Open full screen
wiliamrosa.github.io/cosmos-semantic-platform

Quickstart

A governed metric with its evidence in about a minute.

On a local DuckDB file, no server and no account. Add the extras for the databases you use: postgres, sqlserver, mysql, oracle, databricks, snowflake, and server for REST and MCP.

$ pip install "cosmos-semantic[duckdb,testdata]"
$ cosmos init demo && cd demo
$ cosmos demo-data
$ cosmos query revenue average_order_value --by orders.status --evidence
$ cosmos explain rule:active_customer

News

From the Cosmos Semantic page on LinkedIn.

Follow on LinkedIn
The console under the headline Verifiable numbers for AI agents

Meet Cosmos Semantic

An open-source semantic layer that makes AI agents get the number right, and prove it.

Read on LinkedIn →
A business process as a graph, colored by health

Can you prove your AI agent's number is right?

Nine slides: the problem, define, serve and prove, the eight databases, reconciliation and the ontology.

Open the slides (PDF) →
Narrated walkthrough, from pip install to six databases

pip install to six databases in 90 seconds

Five real databases in Docker plus DuckDB, the same question and the same number.

Watch it here →

More: the launch article on dev.to · em português · changelog

Contact

Talk to us.

A pilot on your databases, a partnership, a talk for your team, or the number your agent got wrong.

Or write to administrator@cosmosdata.ai.

Bugs and feature requests are best as GitHub issues, where everyone can follow them.

We use your details only to answer you. Nothing is stored on this site.

Open source, and open for contributions.

Star the repository, try a good first issue, or bring the number your agent got wrong.