SLayer: a semantic layer that stops agents guessing SQL
SLayer Text to SQL fails quietly. The model guesses a join, invents a revenue definition, and returns a number that looks right. SLayer , from MotleyAI, stops that guesswork by holding one definition of each metric and letting agents query it instead of writing SQL. Define revenue once, then ask for sum of revenue, average revenue, or revenue shifted a year back, and SLayer compiles the correct…
SLayer is a semantic layer created by MotleyAI that prevents agents from guessing SQL queries. The model may guess a join, invent a revenue definition, and return a number that appears correct. SLayer addresses this issue by maintaining a single definition for each metric, allowing agents to query it directly rather than writing SQL code.
To use SLayer, define revenue once and then request the sum, average, or revenue from a previous year. SLayer can be accessed via MCP, REST, CLI, Python, Flight SQL, or a Postgres facade interface, and it supports integration with dbt, Cube, and Ossie configurations. The current version, 1.8.2, was released on November 9, 2026, and the project has garnered 341 stars on GitHub under the MIT license.
SLayer provides a small, focused solution: define metrics once, and every subsequent agent query will be based on that same definition. The repository can be found at https://github.com/MotleyAI/slayer. The author of the article is seeking feedback from readers on how they would initially utilize SLayer.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.