Kaelio/ktx
ktx is an executable context layer for data and analytics agents 🐙 Allow Claude Code, Codex, or other AI agents to query analytical databases accurately and with full context of your company
What it solves
General-purpose AI agents often struggle with data tasks because they lack specific business context. They frequently reinvent metric logic, ignore approved definitions, and struggle to navigate complex database schemas on every new prompt. Traditional semantic layers require high manual effort to maintain and cannot absorb unstructured knowledge from wikis or documentation.
How it works
ktx acts as a self-improving context layer that sits between an AI agent and a SQL warehouse. It automatically ingests data from various sources—including database metadata, BI tools (like Looker or Metabase), modeling code (dbt), and company wikis (Notion, Google Drive)—to build a local knowledge base of approved metrics and joinable columns. It then exposes this context via a CLI and Model Context Protocol (MCP) tools, allowing agents to search for approved metrics and execute read-only SQL queries based on canonical definitions rather than guessing.
Who it’s for
Data professionals and developers who use AI agents (such as Claude Code, Cursor, or Codex) to query their SQL warehouses and want to ensure the agents use approved business logic and canonical SQL.
Highlights
- Automated Context Building: Automatically maps the data stack, detects joinable columns, and resolves fan/chasm traps.
- Multi-source Ingestion: Combines raw table introspection with knowledge from dbt, MetricFlow, LookML, and team wikis.
- Conflict Detection: Flags contradictions across different knowledge sources for human review.
- Local-First Privacy: Runs locally; no schema or query results are sent to a hosted service.
- Broad Compatibility: Supports a wide range of warehouses (PostgreSQL, Snowflake, BigQuery, etc.) and LLM backends (Anthropic, Google Vertex AI, etc.).