Favicon of ktx

ktx

Open-source context layer that gives AI agents approved metrics and business knowledge, with local files, MCP access and read-only database queries.

Screenshot of ktx website

ktx gives data agents a shared set of approved metrics and business context before they query a warehouse. It's for analytics teams whose agents otherwise keep rediscovering schemas or producing numbers with inconsistent definitions. The context lives in a local project as Markdown and YAML files that teams can review and version in Git.

It builds that context from database metadata, query history, BI definitions and company documents. Ingestion reconciles new evidence with accepted definitions, flags contradictions for human review and produces reviewable changes. Alongside metric logic, the wiki holds business terminology, caveats and source evidence that help agents explain where an answer came from.

Agents such as Claude Code, Codex and Cursor access the context through MCP or a CLI. They can search the wiki and metric definitions, compile approved measures and joins into SQL, and query connected databases. Database access is read-only. Its semantic layer also handles join patterns that can otherwise inflate or miscount results.

Connections include PostgreSQL, Snowflake, BigQuery, DuckDB and MongoDB. ktx also draws context from dbt, MetricFlow, Looker, Metabase, Notion and Google Drive, so teams can reuse definitions spread across their existing data stack.

ktx is open source under Apache 2.0. It uses your own LLM API keys or existing Claude Code or Codex authentication; local context files don't mean model processing runs offline. It collects usage telemetry, with opt-out controls, and error reports can include local paths.

Similar to ktx