semlayer

Your AI writes perfect SQL and returns the wrong number.

Your company pointed Claude or Copilot at the data warehouse, and your business users can finally ask their own questions. The answers come back in seconds, they look right, and more than half of them are wrong.

Nothing errors. Nothing warns anyone. The query is valid, it just answers a slightly different question than the one that was asked — because it does not know that cancelled orders never count as revenue, or which of your four order tables is the one finance uses.

That knowledge is real, and it is not written down anywhere a machine can read. It lives in the heads of the three engineers who built the warehouse.

What semlayer does

It works those rules out for itself, from your data. Point it at your warehouse and it reads every table, finds the relationships nobody declared, decodes what your status columns mean, and recovers the filters your summary tables silently apply. It writes all of it down in one open file that any AI agent can read.

Same AI, same 38 business questions, same warehouse: 42% answered correctly from the raw schema, 87% with the context semlayer inferred. The errors it fixes are the silent kind — raw-schema “total revenue” sums cancelled orders, reporting $16.3M where finance reports $14.6M.

Nobody hand-writes a model, and nobody maintains it. Re-run it on a schedule and the context stays in step with the schema. Your engineers add what only they know on top, and that is never overwritten.

Where it does not help: on a clean, well-documented warehouse the raw schema already wins — 67% correct without semlayer, 58% with it. That result ships in the repo next to the good one. If your warehouse is tidy, you do not need this.

How it works

It profiles every column, discovers the foreign keys nobody declared, decodes the status columns, and recovers business rules hiding in your aggregate tables — verified against your own data, with confidence, provenance, and a review queue on every claim. Statistics alone never auto-accept a foreign key, and a doc that contradicts your data goes to review rather than being believed. Then any AI agent consumes the result over MCP.

pip install semlayer
semlayer infer snowflake -o layer.yaml --context ./docs/
semlayer review layer.yaml           # accept/reject what it inferred
semlayer mcp layer.yaml              # serve it to Claude, Cursor, any agent

Snowflake, BigQuery and DuckDB. Skip the quarter of hand-writing dbt YAML.

GitHub → Read the benchmark