ktx-ai-data-context-layer

Configure ktx to build semantic layers and wiki context for data warehouse agents.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @kaelio/ktx, yaml.

What problem does it solve? AI agents often query data warehouses inaccurately because they lack business context, metric definitions, and knowledge of table relationships. This Skill teaches you to set up ktx, an executable context layer that ingests company knowledge, maps your data stack, and serves accurate context to agents via CLI and MCP tools. ## Core Features & Use Cases - Semantic Layer Construction: Define metrics and dimensions in YAML, with automatic join graph detection that resolves chasm and fan traps across PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. - Knowledge Ingestion: Ingest dbt manifests, Looker models, Metabase, and Notion content into a searchable wiki with deduplication and contradiction flagging. - Agent Integration via MCP: Expose search_semantic_layer, search_wiki, get_metric_definition, and get_join_paths tools to Claude Code, Codex, Cursor, and OpenCode. - Use Case: A data team connects ktx to their Snowflake warehouse and dbt project, runs ktx ingest, and then Claude Code can answer "What is our total revenue this quarter?" using governed metric definitions instead of guessing SQL. ## Quick Start Ask the agent to run ktx setup in your project directory, configure your warehouse connection and dbt source in ktx.yaml, then run ktx ingest to build the context layer.

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

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

FAQPage Schema
How do I set up ktx for my data warehouse?▼

Install the CLI with npm install -g @kaelio/ktx, then run ktx setup in your project directory. The interactive command configures LLM and embedding providers, database connections, context sources like dbt, builds initial context, and installs agent integration.

How to connect ktx to dbt models?▼

Add a dbt source in ktx.yaml with type dbt, your connection name, and paths to manifest.json and catalog.json from your target directory. Then run ktx ingest --source dbt_main to ingest the models into the semantic layer.

Does ktx support Snowflake and BigQuery?▼

Yes, ktx supports Snowflake and BigQuery alongside PostgreSQL, ClickHouse, MySQL, SQL Server, and SQLite. Configure each connection in ktx.yaml with the appropriate type, credentials via environment variables, and connection parameters.

How do I use ktx with Claude Code?▼

Run ktx setup from your project directory and the Claude Code integration installs automatically. After that, ask natural language questions like revenue queries, and Claude Code uses the ktx semantic layer through MCP tools to generate accurate SQL.

Why does ktx MCP server fail to start?▼

Check whether a server is already running with ktx mcp status, then stop existing processes with pkill -f "ktx mcp". Restart with ktx mcp start --verbose and inspect logs at ~/.ktx/logs/mcp.log for errors.

Why does ktx search return no results?▼

Search returns nothing when context has not been built or sources were not ingested. Run ktx ingest to rebuild the index, verify files exist under semantic-layer/ and wiki/, and retry with broader queries using the --verbose flag.