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

SOPHIA Meta-Agent for AI Agent Maintenance
SOPHIA is a meta-agent designed as a Chief Learning Officer that observes, diagnoses, researches, and proposes improvements to other AI agents in production ecosystems. The system was designed through 7 iterations using 4 frontier models with human approval required for all deployments.

GPT-5.5 Codex vs Claude Opus 4.7: Real-world coding agent benchmarks
A developer pitted GPT-5.5 Codex against Claude Opus 4.7 on two real tasks: a PR triage bot and a real-time code review UI. Claude shipped cleaner with zero errors; Codex was 18% cheaper but needed a patch pass.

Engram: Open-source memory layer for Claude Code and MCP clients
Engram is an open-source memory layer that works as an MCP server with any client like Claude Code, Cursor, or Windsurf. It stores unlimited memories with semantic vector search, achieves 80% accuracy on LOCOMO benchmark, and uses about 800 tokens per query versus 5K+ for file-based approaches.

ClawControl v1.7.1 fixes daily usage issues in OpenClaw client
ClawControl v1.7.1 is an open source client for OpenClaw available on Windows, Mac, Linux, iOS, and Android. This release focuses on fixing 'why is it doing that?' issues encountered during daily OpenClaw usage.