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
$ npx -y skills add Kaelio/ktx --agent claude-code
FAQ
ktx is a Claude Code plugin with 17 hand-picked skills for data work, indexed on Flowy. Install it with the command on its page. It includes analytics, dbt_ingest, gdrive_synthesize. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Repo: Kaelio/ktx
ktx is a self-improving context layer that teaches agents how to query your warehouse accurately - from approved metric definitions, joinable columns, and business knowledge it builds and maintains for you.
[!NOTE] Run ktx with your own LLM API keys or a local agent sign-in โ a Claude Pro/Max subscription through Claude Code, or your local Codex authentication. No extra usage billing from ktx.
General-purpose agents struggle on data tasks. They re-explore your warehouse on every question, invent their own metric logic, and return numbers that don't match approved definitions.
Traditional semantic layers don't fix this. They demand constant manual upkeep and don't absorb the rest of your company's knowledge.
ktx does both, automatically:
| General-purpose agent | Traditional semantic layer | ktx | |
|---|---|---|---|
| Builds warehouse context automatically | โ | โ | โ |
| Detects joinable columns + resolves fan/chasm traps | โ | Manual | โ |
| Approved, reusable metric definitions | โ | โ | โ |
| Absorbs wiki / Notion / team knowledge | โ | โ | โ |
| Flags contradictions across sources | โ | โ | โ |
| Ships CLI + MCP for agent execution | Partial | โ | โ |
| Read-only by design | n/a | n/a | โ |
Use ktx if you:
Skip ktx if you:
psql or a notebook will doWorks with PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, SQLite, DuckDB, Amazon Athena, and MongoDB. Integrates with dbt, MetricFlow, LookML, Looker, Metabase, Sigma, Notion, and Google Drive.
npm install -g @kaelio/ktx
ktx setup
ktx status
ktx setup creates or resumes a local ktx project, configures providers
and connections, builds context, and installs agent integration.
Example ktx status after setup:
ktx project: /home/user/analytics
Project ready: yes
LLM ready: yes (claude-sonnet-4-6)
Embeddings ready: yes (text-embedding-3-small)
Databases configured: yes (warehouse)
Context sources configured: yes (dbt_main)
ktx context built: yes
Agent integration ready: yes (codex:project)
[!TIP] Already using an agent? Ask Claude Code, Codex, Cursor, or OpenCode from your project directory:
Run npx skills add Kaelio/ktx --skill ktx and use the ktx skill to install and configure ktx in this project.
[!IMPORTANT] If
ktx statusprintsktx mcp start --project-dir ..., run it before opening your agent client.
Re-run the global install with the @latest tag:
npm install -g @kaelio/ktx@latest
| Command | Purpose |
|---|---|
ktx setup | Create, resume, or update a ktx project |
ktx status | Check project readiness |
ktx ingest | Build context for every configured connection |
ktx sl "revenue" | Search semantic sources |
ktx wiki "refund policy" | Search local wiki pages |
ktx mcp start | Start the MCP server for agent clients |
See the CLI Reference for every command, flag, and option.
my-project/
โโโ ktx.yaml # Project configuration
โโโ semantic-layer/<connection-id>/ # YAML semantic sources
โโโ wiki/global/ # Shared business context
โโโ wiki/user/<user-id>/ # User-scoped notes
โโโ raw-sources/<connection-id>/ # Ingest artifacts and reports
โโโ .ktx/ # Local state and secrets, git-ignored
Commit ktx.yaml, semantic-layer/, and wiki/. Keep .ktx/ local.
Project resolution defaults to KTX_PROJECT_DIR, then the nearest ktx.yaml,
then the current directory. Pass --project-dir <path> when scripting.
ktx mcp start when an agent client needs it.git clone https://github.com/kaelio/ktx.git
cd ktx
pnpm install
uv sync --all-groups
pnpm run build
pnpm run check
ktx is a pnpm + uv workspace:
| Path | Purpose |
|---|---|
packages/cli | TypeScript CLI and published npm package source |
packages/cli/src/context | Core context engine |
packages/cli/src/llm | LLM and embedding providers |
packages/cli/src/connectors | Database scan connectors |
python/ktx-sl | Semantic-layer query planning |
python/ktx-daemon | Portable compute service |
Local development CLI:
pnpm run setup:dev
pnpm run link:dev
ktx-dev --help
Useful checks:
pnpm run type-check
pnpm run test
pnpm run dead-code
uv run pytest -q
ktx collects privacy-conscious usage telemetry to understand installs and
improve setup, command reliability, and data-agent workflows. Catalog telemetry
events do not record file paths, hostnames, SQL, schema names, table names,
column names, error messages, raw environment values, or argv. Error reports use
PostHog Error Tracking and can include stack frames and raw error messages,
which may contain local file paths or the local username in those paths.
ktx redacts secrets, credentials, database URLs, auth headers, argv, raw
environment values, SQL text, row data, and user-typed prompt or MCP argument
text from the explicit $exception payload. See
Telemetry for the event
catalog and opt-out options.
ktx is licensed under the Apache License, Version 2.0. See LICENSE.
.github/
ISSUE_TEMPLATE/
bug_report.yml
config.yml
feature_request.yml
workflows/
ci.yml
release.yml
triage-issues.yml
.gitignore
.pre-commit-config.yaml
.releaserc.cjs
AGENTS.md
assets/
ktx-lockup.svg
ktx-mascot-dark.svg
ktx-mascot.svg
launch-video-thumb.png
star-history.svg
biome.json
CLAUDE.md
codecov.yml
conductor.json
CONTRIBUTING.md
docs/
docs-site/
.gitignore
app/
(home)/
layout.tsx
page.tsx
api/
search/
route.ts
diagram-studio/
page.tsx
docs/
[[...slug]]/
page.tsx
layout.tsx
global.css
layout.config.tsx
layout.tsx
llms-full.txt/
route.ts
llms.mdx/
docs/
[[...slug]]/
route.ts
llms.txt/
route.ts
components/
code-block.tsx
context-review-loop.tsx
copy-button.tsx
diagram-studio/
flows.ts
mascot.tsx
nodes.tsx
studio.tsx
docs-page-actions.tsx
flow-canvas.tsx
git-icon.tsx
github-icon.tsx
github-stars.tsx
logo.tsx
product-mechanics.tsx
product-runtime.tsx
scroll-reveal.tsx
semantic-layer-flow.tsx
slack-icon.tsx
terminal-preview.tsx
theme-toggle.tsx
content/
docs/
cli-reference/
ktx-admin.mdx
ktx-completion.mdx
ktx-connection.mdx
ktx-ingest.mdx
ktx-mcp.mdx
ktx-setup.mdx
ktx-sl.mdx
ktx-sql.mdx
ktx-status.mdx
ktx-wiki.mdx
ktx.mdx
meta.json
community/
ai-resources.mdx
contributing.mdx
meta.json
support.mdx
telemetry.mdx
concepts/
cross-database-federation.mdx
meta.json
semantic-layer-internals.mdx
the-context-layer.mdx
wiki-retrieval.mdx
configuration/
ktx-yaml.mdx
meta.json
getting-started/
introduction.mdx
meta.json
quickstart.mdx
guides/
building-context.mdx
llm-configuration.mdx
meta.json
reviewing-context.mdx
serving-agents.mdx
writing-context.mdx
integrations/
agent-clients.mdx
context-sources.mdx
meta.json
primary-sources.mdx
meta.json
lib/
docs-markdown.ts
llm-docs.ts
source.ts
next-env.d.ts
next.config.mjs
package.json
postcss.config.mjs
proxy.ts
public/
brand/
ktx-mascot-dark.svg
ktx-mascot.svg
icons/
dbt.svg
metabase.svg
notion.svg
postgresql.svg
images/
ingestion-flow.png
mcp-runtime-flow.png
source.config.ts
tests/
docs-index-route.test.mjs
docs-search-behavior.test.mjs
product-mechanics-content.test.mjs
product-runtime-content.test.mjs
tsconfig.json
code-design.md
release.md
terminology.md
examples/
local-warehouse/
ktx.yaml
README.md
semantic-layer/
warehouse/
orders.yaml
source/
orders/
orders.json
wiki/
global/
revenue.md
mongodb/
docker-compose.yml
init/
seed.js
README.md
scripts/
introspect-smoke.mjs
smoke.sh
orbit-relationship-verification/
ktx.yaml
README.md
package-artifacts/
README.md
postgres-historic/
docker-compose.yml
init/
001-schema.sql
README.md
scripts/
generate-workload.sh
smoke.sh
README.md
GEMINI.md
knip.json
LICENSE
package.json
packages/
cli/
assets/
demo/
orbit/
demo.db
links/
provenance.json
manifest.json
raw-sources/
bi/
account_retention.view.lkml
arr_daily.view.lkml
customer_health.view.lkml
procurement_activity.view.lkml
retention_exec_q1.dashboard.lookml
revenue_daily.view.lkml
revenue_exec.dashboard.lookml
dbt/
dbt_project.yml
models/
marts/
mart_arr_daily.sql
mart_customer_health.sql
mart_revenue_daily.sql
schema.yml
sources.yml
notion/
activation-policy-decision-record.md
analyst-onboarding.md
arr-and-contract-reporting-notes.md
customer-health-playbook.md
retention-and-nrr-definition-notes.md
revenue-reporting-policy.md
sales-ops-segmentation-guide.md
support-escalation-runbook.md
warehouse/
accounts.csv
arr_movements.csv
contracts.csv
invoices.csv
plans.csv
purchase_requests.csv
support_tickets.csv
users.csv
replay.memory-flow.v1.json
reports/
seeded-demo-report.json
semantic-layer/
.gitkeep
dbt-main/
int_activation_policy_windows.yaml
int_active_contract_arr.yaml
int_customer_health_signals.yaml
int_parent_account_arr_movements.yaml
int_procurement_qualifying_actions.yaml
int_revenue_components.yaml
mart_account_activity.yaml
mart_account_segments.yaml
mart_arr_daily.yaml
mart_customer_health.yaml
mart_nrr_quarterly.yaml
mart_procurement_activity.yaml
mart_retention_movement_breakout.yaml
mart_revenue_daily.yaml
stg_account_hierarchy.yaml
stg_account_owners.yaml
stg_accounts.yaml
stg_activation_events.yaml
stg_approval_events.yaml
stg_arr_movements.yaml
stg_contract_discount_terms.yaml
stg_contracts.yaml
stg_invoice_line_items.yaml
stg_invoices.yaml
stg_plan_segment_mapping.yaml
stg_plans.yaml
stg_purchase_orders.yaml
stg_purchase_requests.yaml
stg_refunds.yaml
stg_sessions.yaml
stg_subscriptions.yaml
stg_supplier_onboarding_events.yaml
stg_suppliers.yaml
stg_support_tickets.yaml
stg_users.yaml
postgres-warehouse/
_schema/
orbit_analytics.yaml
orbit_raw.yaml
large_contract_requesters.yaml
mart_account_activity.yaml
mart_account_segments.yaml
mart_arr_daily.yaml
mart_customer_health.yaml
mart_nrr_quarterly.yaml
mart_procurement_activity.yaml
mart_retention_movement_breakout.yaml
mart_revenue_daily.yaml
wiki/
global/
.gitkeep
customer-communication-policy.md
new-hire-onboarding-policy.md
orbit-activation-kpi-glossary.md
orbit-activation-policy-change-jan-2026.md
orbit-arr-contract-first-definition.md
orbit-company-overview.md
orbit-customer-health-risk-definition.md
orbit-customer-stakeholder-needs.md
orbit-customers-source.md
orbit-dbt-exposures.md
orbit-dbt-project-overview.md
orbit-how-we-work.md
orbit-known-product-gaps.md
orbit-mart-account-activity.md
orbit-mart-account-segments.md
orbit-mart-arr-daily.md
orbit-mart-nrr-quarterly.md
orbit-mart-procurement-activity.md
orbit-mart-retention-movement-breakout.md
orbit-mart-revenue-daily.md
orbit-metabase-sql-library-patterns.md
orbit-nrr-discount-expiration-treatment.md
orbit-plan-segment-normalization.md
orbit-procurement-qualifying-actions.md
orbit-product-design-principles.md
orbit-product-review-checklist.md
orbit-revenue-gross-to-net-reconciliation.md
sales-ops-cs-handoff-process.md
package.json
scripts/
build-demo-assets.mjs
copy-runtime-assets.mjs
src/
admin-reindex.ts
admin.ts
bin.ts
clack.ts
claude-code-prompt-caching.ts
cli-program.ts
cli-runtime.ts
command-schemas.ts
command-tree.ts
commands/
completion-commands.ts
connection-commands.ts
connection-selection.ts
ingest-commands.ts
knowledge-commands.ts
mcp-commands.ts
runtime-commands.ts
setup-commands.ts
sl-commands.ts
sql-commands.ts
status-commands.ts
community-cta.ts
completion/
complete-engine.ts
completion-scripts.ts
dynamic-candidates.ts
connection-drivers.ts
connection-recovery.ts
connection.ts
connectors/
athena/
connector.ts
dialect.ts
live-database-introspection.ts
bigquery/
connector.ts
dialect.ts
live-database-introspection.ts
clickhouse/
connector.ts
dialect.ts
live-database-introspection.ts
duckdb/
connector.ts
dialect.ts
federated-attach.ts
federated-executor.ts
live-database-introspection.ts
mongodb/
connector.ts
dialect.ts
live-database-introspection.ts
schema-inference.ts
mysql/
connector.ts
dialect.ts
live-database-introspection.ts
postgres/
connector.ts
dialect.ts
historic-sql-query-client.ts
live-database-introspection.ts
shared/
duckdb-json-safe.ts
string-reference.ts
snowflake/
connector.ts
dialect.ts
historic-sql-query-client.ts
identifiers.ts
live-database-introspection.ts
sdk-logger.ts
sqlite/
connector.ts
dialect.ts
... 1599 moreยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic