ktx-context-layer-data-agents

Build and query a semantic context layer for AI data agents using ktx.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @kaelio/ktx.

What problem does it solve? AI data agents often generate inaccurate SQL because they lack business context about metrics, joins, and definitions. This Skill sets up ktx, an executable context layer that gives agents a single searchable surface of approved metric definitions, join graphs, and company wiki knowledge so they query warehouses accurately. ## Core Features & Use Cases - Semantic Layer Management: Define approved metrics, dimensions, and joins in YAML with automatic fan/chasm trap resolution, then search them via ktx sl. - Wiki Ingestion: Build a deduplicated wiki from dbt manifests, Looker LookML, Metabase exports, and Notion with contradiction detection. - MCP Server Integration: Expose context tools to Claude Code, Cursor, and other agents via ktx mcp start or the TypeScript API. - Use Case: Connect ktx to a Snowflake warehouse and a dbt manifest, run ktx ingest, then let your AI agent resolve questions like "net revenue last quarter" against governed metric definitions instead of inventing SQL. ## Quick Start Ask the agent to install ktx with npm, run ktx setup and ktx ingest in your project, then start the MCP server so the agent can search the semantic layer.

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

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

FAQPage Schema
How do I set up ktx for AI data agent queries?▼

Install ktx globally with npm install -g @kaelio/ktx, then run ktx setup to create ktx.yaml and configure providers. Run ktx ingest to build context from your sources and ktx mcp start to expose tools to agents.

What databases does ktx support as a semantic layer source?▼

ktx supports PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite as warehouse connections. Each connection is configured in ktx.yaml with credentials supplied through environment variables.

Can ktx ingest context from dbt and Notion?▼

Yes, ktx ingests dbt manifest.json files, Looker LookML, Metabase exports, and Notion databases as context sources. It deduplicates content and flags contradictions between sources during ingestion.

How do I connect ktx to Claude or Cursor via MCP?▼

Run ktx mcp start with an absolute --project-dir path, then add the ktx server to your client's MCP configuration JSON. Restart the agent client completely so the new MCP tools become available.

Why does ktx status show project ready: no?▼

This usually means a missing LLM API key, missing database password environment variable, or an invalid ktx.yaml. Run ktx config validate and export the required keys such as ANTHROPIC_API_KEY or WAREHOUSE_PASSWORD.

How do I fix ktx ingestion when no tables are found?▼

Verify the database, schema, or dataset values in ktx.yaml match your warehouse. For Snowflake check warehouse, database, schema, and role; for BigQuery check projectId and dataset; for Postgres the schema defaults to public.