# 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

Repository: https://github.com/Kaelio/ktx
Canonical: https://ross.abutalabs.com/products/ktx
Homepage: https://docs.kaelio.com/ktx
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: agents, analytics, analytics-engineering, context-layer, data-engineering, semantic-layer, business-intelligence, data-analysis, agent, ai-agent, ai-agents, claude-code, codex, llm, mcp, memory, agent-skills, skills, claude-skills, claude
Last push: 2026-07-19T12:56:57+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 91, longevity 8
- inputs: {"age_days": 115, "days_push": 45, "days_rel": 61, "gap_med": 2.0, "n_releases_24m": 19}
- flags: young
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1562, forks 100 (observed 2026-08-28T04:05:03.959871+00:00)

## What it is
ktx is an open-source, self-improving context layer for data and analytics agents, distributed as an npm CLI. It ingests warehouse metadata, BI tool definitions, query history, and docs into reviewable YAML/Markdown files, then serves that context to AI agents via CLI and MCP tools for semantic querying and read-only SQL execution.

## Use cases
- let Claude Code or Codex query my data warehouse accurately with business context
- give AI agents approved metric definitions and safe joins before they write SQL
- build a semantic layer as code that agents can search and execute
- stop agents from writing plausible but wrong analytics SQL
- federate read-only SQL queries across postgres, mysql, sqlite, and duckdb
- maintain a wiki of business knowledge that agents can retrieve at query time
- review agent-generated analytics context as git diffs

## When to choose
- your team uses AI coding agents to answer data questions against a warehouse
- you want metric definitions, joins, and business rules version-controlled and reviewable
- you need cross-database federation without ETL
- you want an MCP server exposing semantic queries and read-only SQL to agents

## When to avoid
- you need a hosted BI dashboard for non-technical users
- your stack relies only on warehouses not supported by the federation engine (e.g., Snowflake, BigQuery) for cross-database joins
- you want a fully managed semantic layer with a web UI rather than files on disk

## Facets
- artifact type: cli-tool
- maturity: active
- function: mcp, rag, search-engine, cli, developer-tools, data-science
- domain: analytics, artificial-intelligence, databases
- platform: cli, cross-platform
- tags: semantic-layer, context-layer, data-agents, analytics-engineering, claude-code, mcp-server, duckdb, context-as-code, business-intelligence, data-engineering, ai-agents, nodejs

## Member repositories
- Kaelio/ktx (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:03.959871+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:00:16.979400+00:00, confidence not recorded.
  - readme: https://github.com/Kaelio/ktx (fetched 2026-08-28T04:05:03.959871+00:00, sha 0cfe2afdcc8a)
  - homepage: https://docs.kaelio.com/ktx (fetched 2026-08-29T11:29:27.045531+00:00, sha a61cbcf9896f)
  - site_page: https://docs.kaelio.com/ktx/docs/getting-started/quickstart (fetched 2026-08-29T11:29:27.054757+00:00, sha e561d72a1659)
  - site_page: https://docs.kaelio.com/ktx/docs/concepts/the-context-layer (fetched 2026-08-29T11:29:27.056831+00:00, sha 7d2cd287b098)
  - site_page: https://docs.kaelio.com/ktx/docs/concepts/semantic-layer-internals (fetched 2026-08-29T11:29:27.058858+00:00, sha c4c3b0d3a46e)
  - site_page: https://docs.kaelio.com/ktx/docs/concepts/cross-database-federation (fetched 2026-08-29T11:29:27.060982+00:00, sha ad4d5d66b4b6)
  - site_page: https://docs.kaelio.com/ktx/docs/concepts/wiki-retrieval (fetched 2026-08-29T11:29:27.062780+00:00, sha dfda2edbda17)
  - site_page: https://docs.kaelio.com/ktx/docs/guides/building-context (fetched 2026-08-29T11:29:27.064961+00:00, sha 07710cbe32a3)
  - site_page: https://docs.kaelio.com/ktx/docs/guides/writing-context (fetched 2026-08-29T11:29:27.066819+00:00, sha 5d4a727d896c)
  - site_page: https://docs.kaelio.com/ktx/docs/guides/reviewing-context (fetched 2026-08-29T11:29:27.069102+00:00, sha ce7138b1b694)
- Data as of 2026-08-30T08:39:29.467469+00:00.
