Show HN: Ktx – データエージェント用のオープンソース実行可能コンテキストレイヤー
## Japanese Translation:
KTX は、AI エージェントが承認済みのメトリック定義、結合可能なカラム、および組み込みのビジネス知識を活用してデータウェアハウスを正確にクエリできるよう教導する自己向上型のコンテキストレイヤーです。Notion や dbt などのソースから企業の知識を自動的に学習し、データスタックをマッピングしてセマンティック層を構築、実行時にエージェントへ提供することで、手動のメンテナンスや標準 LLM サブスクリプションを超える追加の使用量課金を不要にします。汎用的なエージェントがデータタスクで苦戦するのと対照的に、KTX はウィキコンテンツを取り込んでコンテキストを整備し、重複を除去し、矛盾箇所をレビューのためにフラッグします。メタデータと使用パターンをキャプチャし、結合可能なカラムを検出するとともに、シャスムトラップやファントラップなどの複雑なスキーマ問題を自動的に解決し、宣言的なメトリック取得を実現します。CLI ツールおよび MCP ツールの両方を暴露するため、ウィキコンテンツとセマンティック層エンティティを対象とした全文検索とセマンティック検索を組み合わせた機能を備えています。KTX は、エージェント(例:Claude Code、Cursor)が承認済みの定義でデータウェアハウスをクエリしたり、正則な SQL を再利用してゼロから新しいクエリを発明する必要がないことを望むユーザーに強く推奨されます。インストールは `npm install -g @kaelio/ktx` で行われ、その後に `ktx setup` で構成し、`ktx status` でステータスを確認します。プロジェクト構成には `ktx.yaml`(コンフィグ)、`semantic-layer/`(YAML ソース)、`wiki/`(コンテキスト)、`.ktx/`(ローカル状態、git 無視)が含まれます。ホストサービスは必要なく、ローカルの MCP デモンは `ktx mcp start` でオンデマンドで起動します。PostgreSQL、Snowflake、BigQuery、ClickHouse、MySQL、SQL Server、SQLite の主要なデータベースおよび dbt、MetricFlow、LookML、Looker、Metabase、Notion などのスタックと互換性があります。ローカルで読み取り専用データベース接続を介して動作するため、データウェアハウスへの書き込みは行わず、Anthropic API、Google Vertex AI、AI Gateway、そしてローカルの Claude Code セッションなどの AI プロバイダーをサポートします。
## Text to translate:
KTX is a self-improving context layer that teaches AI agents to query data warehouses accurately using approved metric definitions, joinable columns, and built-in business knowledge. It automatically learns company knowledge from sources like Notion and dbt, maps your data stack, builds a semantic layer, and serves agents at execution—eliminating the need for manual upkeep or extra usage billing beyond standard LLM subscriptions (works with your own LLM API keys or Claude Pro/Max). Unlike general-purpose agents that struggle with data tasks, KTX ingests wiki content to organize context, removes duplicates, and flags contradictions for review. It captures metadata and usage patterns, detects joinable columns, and resolves complex schema issues such as chasm traps and fan traps automatically, enabling declarative metric fetching. Exposing both CLI and MCP tools, it offers combined full-text and semantic search across wiki content and semantic-layer entities. KTX is highly recommended for users wanting agents (e.g., Claude Code, Cursor) to query warehouses with approved definitions or reuse canonical SQL instead of inventing new queries from scratch. Installation is done via `npm install -g @kaelio/ktx`, followed by configuration with `ktx setup` and status checks using `ktx status`. The project layout includes `ktx.yaml` for config, `semantic-layer/` for YAML sources, `wiki/` for context, and `.ktx/` for local state (git-ignored). No hosted service is required; the local MCP daemon runs on demand via `ktx mcp start`. It works with major databases including PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite, and integrates with stacks like dbt, MetricFlow, LookML, Looker, Metabase, and Notion. Running locally with read-only database connections, KTX never writes to the warehouse and supports AI providers such as Anthropic API, Google Vertex AI, AI Gateway, and local Claude Code sessions.