SLayer: An Open-Source Semantic Layer for AI Agents That Learns from Queries

SLayer is an open-source semantic layer designed for AI agents to query databases, manage data models, and improve over time through natural-language memories. It sits between your database and agents (or internal tools), providing a structured DSL for measures, dimensions, and filters—avoiding the mess of raw SQL generated by LLMs.
Key Features from the Source
- Auto-creation of models from database schema introspection for a warm start.
- Runtime model editing: agents can edit columns/measures or create new models on the fly from SQL or other models.
- Natural-language memories: save and retrieve memories linked to models, columns, or queries to form a knowledge base.
- Embeddability: runs in-process as a Python module or serverless via CLI; no server required.
- Schema drift detection and handling – agents can adapt to changing table structures.
- Expressive DSL supports multi-stage queries, custom aggregations, time shifts, and combining metrics from multiple models.
- Multiple interfaces: MCP (stdio and SSE), REST API, CLI, and Python client for dataframes.
- No caching or pre-aggregation engine yet – noted as a limitation; on roadmap.
Quickstart Examples
Install via uv:
uv tool install motley-slayer
slayer
Instant demo with bundled Jaffle Shop DuckDB:
uvx --from 'motley-slayer[all]' slayer serve --demo
Connect to Claude Code via stdio MCP (serverless):
claude mcp add slayer -- uvx --from motley-slayer slayer mcp --demo
Query via REST API:
curl -X POST http://localhost:5143/query \
-H "Content-Type: application/json" \
-d '{"source_model": "orders", "measures": ["*:count"], "dimensions": ["status"]}'
List models:
curl http://localhost:5143/models
Python client usage:
from slayer.client.slayer_client import Slay
Who It's For
Developers building AI data analyst chatbots, agentic apps, or any tool where agents need to explore databases iteratively and learn from past queries.
Docs: motley-slayer.readthedocs.io
📖 Read the full source: HN AI Agents
👀 See Also

Agent Memory Protocol (AMP): Open Spec for Interoperable AI Agent Memory on Top of MCP
AMP defines a standard interface for persistent memory in MCP-compatible agents with six core verbs: encode, recall, forget, consolidate, pin, and stats. Includes compliance test suite and reference implementation.

Spectr: An MCP That Writes App Specs from Screen Recordings for Pixel-Perfect Claude Clones
Spectr is an MCP server, CLI, and Claude Code skill that takes an .mp4/.mov screen recording of an iOS app and generates a 7-section spec.md with hex codes, font weights, spacing, transitions, and nav graph — eliminating the 30-minute manual spec writing per screen.

HN SOTA: Tracking Coding Model Popularity via Hacker News Comments
HN SOTA is a daily updated pipeline that scrapes Hacker News comments, uses Gemini to identify coding models from the OpenRouter list, and logs sentiment per mention into a public Google Sheet. The top 10 models by mentions over a 10-day trailing window are displayed.

Event Horizon VS Code Extension Adds File Locking and Plan Coordination for Multiple AI Agents
Event Horizon, a VS Code extension originally created for visualizing Claude Code, now includes file locking and plan coordination features to prevent multiple AI agents from overwriting each other's work on the same codebase. The tool supports Claude Code, OpenCode, and Copilot with one-click setup.