SLayer is an embeddable, expressive semantic layer created and maintained by the Motley team, enabling AI-powered data analytics on top of your warehouse. It gives agents a governed, shared surface through which they access your data and metrics and deliver reliable answers. SLayer handles database connectivity (read-only), SQL translation, common data transformations, and row-level security, so LLMs and humans don't have to. It can be used as a standalone tool or imported as a Python library and embedded into any Python app — for powering analytical MCP servers or APIs, or simply querying databases semantically. Unlike traditional BI semantic layers where every metric and aggregation must be predefined, SLayer lets you define a column such as revenue once and query it using expressions like revenue:sum, revenue:avg, revenue:sum / *:count, or time_shift(revenue:sum, -1, 'year'), with multi-stage queries also supported. SLayer focuses on the common agentic search → inspect → query flow, offering a search tool for efficient discovery and a memory store for linking relevant business context. Agents, apps, and humans can talk to SLayer via MCP, REST API, CLI, Python client, Flight SQL, or a Postgres-based SQL API, and it provides importers for dbt, Cube, and Ossie configs.
Use cases
Let AI agents run governed analytical queries on your warehouse
Power analytical MCP servers or APIs with a semantic layer
Query databases semantically instead of writing SQL by hand
Embed a semantic layer inside a Python application
Import dbt, Cube, or Ossie configs and reuse existing metric definitions