ktx-ai-data-agents-context

Builds a semantic context layer so AI agents query data warehouses accurately via MCP.

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-reason-machines
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ktx-ai-data-agents-context
Source: https://github.com/reason-machines/mcp-skills/tree/main/skills/ktx-ai-data-agents-context
Command: npx skills add https://github.com/reason-machines/mcp-skills --skill ktx-ai-data-agents-context-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @kaelio/ktx.

What problem does it solve? AI data agents often generate incorrect SQL because they lack knowledge of your warehouse schema, metric definitions, and business rules. ktx solves this by combining approved metrics, joinable columns, wiki knowledge, and dbt/Looker metadata into one searchable context layer served to agents through MCP. ## Core Features & Use Cases - Automatic warehouse learning: Samples tables, detects joinable columns, and resolves fan/chasm traps across PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. - Context ingestion: Combines dbt, MetricFlow, LookML, Looker, Metabase, and Notion content into a semantic layer with contradiction detection. - MCP server for agents: Exposes CLI and Model Context Protocol tools so Claude Code, Codex, Cursor, and OpenCode can search metrics and wiki knowledge. - Use Case: A data team with a dbt + Snowflake project runs ktx setup and ktx ingest, then asks Claude Code "What is our total revenue metric defined as?" and receives an answer grounded in the approved semantic definition. ## Quick Start Install ktx globally with npm, run ktx setup in your analytics project to configure your LLM, database, and dbt context source, then run ktx ingest and start the MCP server with ktx mcp start before opening your agent.

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

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

FAQPage Schema
How do I set up ktx for a dbt and Snowflake project?▼

Run ktx setup inside your analytics directory, select your LLM and embeddings providers, add Snowflake as a database connection, and point the dbt context source at your dbt project with the prod target. Then run ktx ingest to build the context layer.

How do I connect ktx to Claude Code via MCP?▼

Run ktx mcp start in your project directory before opening Claude Code. If ktx status shows a message like "Run: ktx mcp start --project-dir ...", execute that command so the agent can discover the ktx MCP tools.

Which databases does ktx support for warehouse connections?▼

ktx supports PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. Connections are configured in ktx.yaml under the databases key, with credentials stored in .ktx/secrets.yaml or environment variables.

Why does ktx ingest fail with LLM provider not configured?▼

This error means no LLM credentials are available. Re-run ktx setup and choose reconfigure LLM provider, or set the ANTHROPIC_API_KEY environment variable. Verify the configuration afterward with ktx status.

Can ktx write to or modify my data warehouse?▼

No, ktx is read-only by design and never writes to your warehouse. It only samples tables, detects joinable columns, and builds a searchable semantic layer from your metadata and documentation.

Why does ktx wiki search return no results?▼

Wiki search returns empty when no markdown files exist in wiki/global or wiki/user directories, or when content has not been ingested. Add your markdown files, then run ktx ingest to index them before searching again.