ktx-ai-data-agents-context-layer

Builds a semantic layer and wiki context so AI agents query data warehouses accurately.

7|2|Updated May 16, 2026
One-click install
npx skills add https://github.com/reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer-reason-machines
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ktx-ai-data-agents-context-layer
Source: https://github.com/reason-machines/mcp-skills/tree/main/skills/ktx-ai-data-agents-context-layer
Command: npx skills add https://github.com/reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @kaelio/ktx.

What problem does it solve? General-purpose AI agents struggle with data tasks because they re-explore the warehouse on every question and invent metric logic, producing inaccurate queries. ktx gives agents an executable context layer combining approved metric definitions, joinable columns, and business knowledge from your data stack. ## Core Features & Use Cases - Semantic Layer Construction: Ingests warehouse metadata, samples tables, detects joinable columns, and builds a join graph that resolves chasm and fan traps across PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. - Knowledge Ingestion: Pulls context from dbt, MetricFlow, LookML, Looker, Metabase, and Notion, organizing wiki content, removing duplicates, and flagging contradictions. - MCP Server for Agents: Exposes tools like ktx_search_semantic_layer, ktx_search_wiki, and ktx_query_warehouse so Claude Code, Codex, and Cursor can search metrics and run read-only SQL. - Use Case: An analytics team runs ktx setup and ktx ingest against their Snowflake warehouse, then asks their agent "query revenue by month" and receives SQL grounded in the approved MRR metric definition instead of guessed logic. ## Quick Start Ask your agent to run ktx setup in the project, verify readiness with ktx status, then start the MCP server with ktx mcp start so the agent can search metrics and query the warehouse.

Frequently Asked Questions about ktx-ai-data-agents-context-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect Claude Code to my data warehouse with ktx?▼

Run ktx setup in your project to configure the database connection and LLM provider, then run ktx ingest to build context and ktx mcp start to launch the MCP server. The agent detects the server and gains tools for searching metrics and running read-only queries.

What databases does ktx support for semantic layer ingestion?▼

ktx supports PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. It also ingests context from dbt, MetricFlow, LookML, Looker, Metabase, and Notion as knowledge sources.

How do I search for metric definitions with ktx?▼

Use ktx sl followed by a natural language query, such as ktx sl "monthly recurring revenue", to search the semantic layer. Use ktx wiki for business documentation and ktx search for full-text search with semantic ranking.

Why does ktx status show LLM ready: no?▼

This means the LLM provider API key is missing. Set the ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable, or rerun ktx setup to configure the provider in ktx.yaml.

Can ktx write to or modify my data warehouse?▼

No, ktx only executes read-only queries and never writes to your database. Best practice is to enforce this at the database level by using a read-only database user for the configured connection.

What should I commit to version control in a ktx project?▼

Commit ktx.yaml, the semantic-layer/ directory, and the wiki/ directory so context is shared across the team. Ignore the .ktx/ directory because it contains secrets and local state.