Metrics SQL: A SQL-based semantic layer for humans and agents
2 days ago
- #Semantic Layer
- #Metrics
- #SQL
- Rill introduces Metrics SQL as a SQL-based semantic layer for humans and AI agents, leveraging SQL's universality to avoid custom languages.
- Metrics SQL ensures a deterministic source of truth, with metrics defined once to prevent drift across tools, and supports universal access with security policies.
- The layer is composed of measures (aggregate expressions) and dimensions (attributes for slicing), defined in YAML with embedded SQL for flexibility.
- It transpiles Metrics SQL queries to native OLAP SQL, handling inferred GROUP BY, computed dimensions, and parameterized arguments for safety.
- Rill provides multiple access methods: CLI, HTTP API, and AI agents via Model Context Protocol (MCP), with built-in AI chat for natural language queries.
- Current limitations include no JOINs across metrics views, no SELECT *, and mandatory HAVING for measure filters, with future plans for native database integration.