[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77646":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":29,"discoverSource":30},77646,"ktx","Kaelio\u002Fktx","Kaelio","ktx is an executable context layer for data and analytics agents 🐙 Allow Claude Code, Codex, or any other AI agent to query data accurately and with full context of your company","https:\u002F\u002Fdocs.kaelio.com\u002Fktx",null,"TypeScript",1078,57,2,14,0,130,214,1024,390,18.29,"Apache License 2.0",false,"main",[],"2026-06-12 02:03:44","\u003Ch1 align=\"center\">\n  \u003Cimg src=\"assets\u002Fktx-lockup.svg\" alt=\"ktx\" width=\"500\" \u002F>\n\u003C\u002Fh1>\n\n\u003Ch1 align=\"center\">\n  The context layer for data agents\n\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@kaelio\u002Fktx\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@kaelio\u002Fktx?style=flat-square&color=f97316\" alt=\"npm version\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002FKaelio\u002Fktx\">\u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002FKaelio\u002Fktx\u002Fgraph\u002Fbadge.svg?branch=main\" alt=\"Codecov\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FKaelio\u002Fktx\u002Factions\u002Fworkflows\u002Fci.yml?query=branch%3Amain\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002FKaelio\u002Fktx\u002Fci.yml?branch=main&label=tests&style=flat-square\" alt=\"Tests\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdocs.kaelio.com\u002Fktx\u002Fdocs\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-ktx-22c55e?style=flat-square\" alt=\"Documentation\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fjoin.slack.com\u002Ft\u002Fktxcommunity\u002Fshared_invite\u002Fzt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fslack-join%20community-4A154B?style=flat-square&logo=slack&logoColor=white\" alt=\"Join the ktx Slack community\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FKaelio\u002Fktx\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%202.0-blue?style=flat-square\" alt=\"License\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.ycombinator.com\u002Fcompanies?batch=P25\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FY%20Combinator-P25-orange?style=flat-square\" alt=\"Y Combinator P25\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n**ktx** is a self-improving context layer that teaches agents how to query your\nwarehouse accurately - from approved metric definitions, joinable columns, and\nbusiness knowledge it builds and maintains for you.\n\nWorks with PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and\nSQLite. Integrates with dbt, MetricFlow, LookML, Looker, Metabase, and Notion.\n\nRuns with your own LLM API keys or a **Claude\nPro\u002FMax subscription - no extra usage billing from** **ktx**.\n\n## Why ktx\n\nGeneral-purpose agents struggle on data tasks. They re-explore your warehouse\non every question, invent their own metric logic, and return numbers that\ndon't match approved definitions.\n\nTraditional semantic layers don't fix this. They demand constant manual\nupkeep and don't absorb the rest of your company's knowledge.\n\n**ktx** does both, automatically:\n\n- **Learns from company knowledge.** Ingests wiki content, organizes it,\n  removes duplicates, and flags contradictions for human review.\n- **Maps the data stack.** Samples tables, captures metadata and usage\n  patterns, detects joinable columns, and annotates sources so agents write\n  better queries.\n- **Builds a semantic layer.** Combines raw tables and high-level metrics\n  through a join graph that automatically resolves chasm and fan traps, so\n  agents fetch metrics declaratively instead of rewriting canonical SQL each\n  time.\n- **Serves agents at execution.** Exposes CLI and MCP tools with combined\n  full-text and semantic search across wiki and semantic-layer entities.\n\nAgents can run raw SQL when they need it, or compose semantic-layer queries\nwhen they want approved metrics with reliable joins.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs-site\u002Fpublic\u002Fimages\u002Fingestion-flow-transparent.svg\" alt=\"ktx ingestion flow from source systems through validation to wiki and semantic-layer outputs\" width=\"900\" \u002F>\n\u003C\u002Fp>\n\n## Agent Setup\n\nAsk an agent such as Claude Code, Codex, Cursor, or OpenCode to install and\nconfigure **ktx** from your project directory:\n\n```text\nFollow instructions from\nhttps:\u002F\u002Fdocs.kaelio.com\u002Fktx\u002Fdocs\u002Fagents-setup.md\nto install and configure ktx\n```\n\n## Quick Start\n\n```bash\nnpm install -g @kaelio\u002Fktx\nktx setup\nktx status\n```\n\n`ktx setup` creates or resumes a local **ktx** project, configures providers and\nconnections, builds context, and installs agent integration.\n\nExample `ktx status` output after setup:\n\n```text\nktx project: \u002Fhome\u002Fuser\u002Fanalytics\nProject ready: yes\nLLM ready: yes (claude-sonnet-4-6)\nEmbeddings ready: yes (text-embedding-3-small)\nDatabases configured: yes (warehouse)\nContext sources configured: yes (dbt_main)\nktx context built: yes\nAgent integration ready: yes (codex:project)\n```\n\n## Common Commands\n\n| Command | Purpose |\n|---------|---------|\n| `ktx setup` | Create, resume, or update a **ktx** project |\n| `ktx status` | Check project readiness |\n| `ktx connection` | List configured connections |\n| `ktx connection test` | Test every configured connection |\n| `ktx connection test \u003Cid>` | Test one connection |\n| `ktx ingest` | Build context for every configured connection |\n| `ktx ingest \u003Cid>` | Build context for one connection |\n| `ktx ingest --text \"...\"` | Capture free-form notes into memory |\n| `ktx ingest --file notes.md --connection-id \u003Cid>` | Capture a text file into memory |\n| `ktx sl` | List semantic sources |\n| `ktx sl \"revenue\"` | Search semantic sources |\n| `ktx sl validate \u003Csource> --connection-id \u003Cid>` | Validate a semantic source |\n| `ktx sl query --measure \u003Cmeasure> --format sql` | Compile semantic-layer SQL |\n| `ktx sql --connection \u003Cid> \"select 1\"` | Execute read-only SQL |\n| `ktx wiki` | List local wiki pages |\n| `ktx wiki \"revenue definition\"` | Search local wiki pages |\n| `ktx mcp` | Show MCP daemon status |\n| `ktx mcp start` | Start the local MCP server for agent clients |\n\nProject resolution defaults to `KTX_PROJECT_DIR`, then the nearest `ktx.yaml`,\nthen the current directory. Pass `--project-dir \u003Cpath>` when scripting.\n\n## Project Layout\n\n```text\nmy-project\u002F\n├── ktx.yaml                         # Project configuration\n├── semantic-layer\u002F\u003Cconnection-id>\u002F  # YAML semantic sources\n├── wiki\u002Fglobal\u002F                     # Shared business context\n├── wiki\u002Fuser\u002F\u003Cuser-id>\u002F             # User-scoped notes\n├── raw-sources\u002F\u003Cconnection-id>\u002F     # Ingest artifacts and reports\n└── .ktx\u002F                            # Local state and secrets, git-ignored\n```\n\nCommit `ktx.yaml`, `semantic-layer\u002F`, and `wiki\u002F`. Keep `.ktx\u002F` local.\n\n## Agent Usage\n\nInstall **ktx** integration for Claude Code, Claude Desktop, Codex, Cursor,\nOpenCode, and generic `.agents` clients:\n\n```bash\nktx setup --agents\n```\n\nPass `--target \u003Ctarget>` to install or repair one specific integration.\n\nA typical agent workflow combines wiki and semantic-layer search before\nquerying:\n\n```bash\nktx sl \"revenue\" --json\nktx wiki \"refund policy\" --json\nktx sl query --connection-id warehouse --measure orders.revenue --format sql\n```\n\nDuring setup, choose **Ask data questions with ktx MCP** for agent clients.\nChoose **Ask data questions + manage ktx with CLI commands** when an operator\nagent also needs pinned `ktx` admin commands.\n\nAfter setup, **ktx** prints **Required before using agents** with the exact\ncommands to run. If the output includes `ktx mcp start --project-dir ...`, run\nit before opening your agent. Claude Desktop uses its own launcher and prints\nseparate skill upload steps under `.ktx\u002Fagents\u002Fclaude\u002F`.\n\n## Workspace layout\n\n| Path | Purpose |\n|------|---------|\n| `packages\u002Fcli` | TypeScript CLI package and published npm package source |\n| `packages\u002Fcli\u002Fsrc\u002Fcontext` | Core context engine |\n| `packages\u002Fcli\u002Fsrc\u002Fllm` | LLM and embedding providers |\n| `packages\u002Fcli\u002Fsrc\u002Fconnectors` | Database scan connectors |\n| `python\u002Fktx-sl` | Semantic-layer query planning |\n| `python\u002Fktx-daemon` | Portable compute service |\n\n## Development\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fkaelio\u002Fktx.git\ncd ktx\npnpm install\nuv sync --all-groups\npnpm run build\npnpm run check\n```\n\nUse the development CLI locally:\n\n```bash\npnpm run setup:dev\npnpm run link:dev\nktx-dev --help\n```\n\n**ktx** is a pnpm + uv workspace:\n\n- TypeScript packages live in `packages\u002F*`\n- CLI source lives in `packages\u002Fcli`\n- Python runtime source lives in `python\u002Fktx-sl` and `python\u002Fktx-daemon`\n- Public docs live in `docs-site\u002Fcontent\u002Fdocs`\n\nUseful checks:\n\n```bash\npnpm run type-check\npnpm run test\npnpm run dead-code\nuv run pytest -q\n```\n\n## Docs\n\n- [Quickstart](docs-site\u002Fcontent\u002Fdocs\u002Fgetting-started\u002Fquickstart.mdx)\n- [CLI Reference](docs-site\u002Fcontent\u002Fdocs\u002Fcli-reference\u002Fktx.mdx)\n- [Building Context](docs-site\u002Fcontent\u002Fdocs\u002Fguides\u002Fbuilding-context.mdx)\n- [Community & Support](docs-site\u002Fcontent\u002Fdocs\u002Fcommunity\u002Fsupport.mdx)\n- [Contributing](docs-site\u002Fcontent\u002Fdocs\u002Fcommunity\u002Fcontributing.mdx)\n\n## Community\n\n- **[Slack](https:\u002F\u002Fjoin.slack.com\u002Ft\u002Fktxcommunity\u002Fshared_invite\u002Fzt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ)** — ask questions, share what you're building, and chat with maintainers and other users.\n- **[GitHub Issues](https:\u002F\u002Fgithub.com\u002FKaelio\u002Fktx\u002Fissues)** — report bugs and request features.\n- **[Contributing guide](docs-site\u002Fcontent\u002Fdocs\u002Fcommunity\u002Fcontributing.mdx)** — set up the repo, run tests, and open a PR.\n\nSee [Community & Support](docs-site\u002Fcontent\u002Fdocs\u002Fcommunity\u002Fsupport.mdx) for the\nfull guide on where to ask what.\n\n## License\n\n**ktx** is licensed under the Apache License, Version 2.0. See `LICENSE`.\n","ktx 是一个用于数据分析代理的上下文层，旨在提高数据查询的准确性。它通过学习公司的知识、映射数据栈、构建语义层以及在执行时为代理提供服务来实现这一目标。具体来说，ktx 能够从公司文档中提取信息并进行整理，自动发现可连接的数据列，并基于这些信息生成优化后的查询逻辑，从而避免了重复定义和不一致的问题。此外，该工具支持多种数据库类型（如 PostgreSQL, Snowflake 等）及数据平台（例如 dbt, Looker 等），并且可以使用用户自己的语言模型API密钥运行。适用于需要频繁访问企业级数据仓库，并希望确保所使用的指标与官方定义一致的企业或团队。","2026-06-11 03:55:41","CREATED_QUERY"]