ktx
A self-improving context layer that teaches Claude Code, Codex and similar agents to query a company's data warehouse accurately, using approved metric definitions instead of invented SQL.
ktx is a context layer for data and analytics agents, built because general-purpose agents tend to re-explore a warehouse on every question, invent their own metric logic, and return numbers that do not match a company's approved definitions. It learns from company knowledge by ingesting wiki content, removing duplicates and flagging contradictions for human review; maps the data stack by sampling tables, capturing metadata and usage patterns, and detecting joinable columns; and builds a semantic layer that combines raw tables and high-level metrics through a join graph that automatically resolves fan and chasm traps.
At execution time it serves agents through a CLI and an MCP server with combined full-text and semantic search across wiki and semantic-layer entities, and it is read-only by design. It runs with the user's own LLM API keys or an existing Claude subscription through Claude Code, or local Codex authentication, and adds no separate usage billing of its own. It is written in TypeScript.