ktx/python/ktx-daemon
semantic-release-bot d62dc46a86 chore(release): 0.13.0 [skip ci]
## [0.13.0](https://github.com/Kaelio/ktx/compare/v0.12.0...v0.13.0) (2026-06-19)

### Features

* **cli:** let ktx setup --agents choose an install directory ([#298](https://github.com/Kaelio/ktx/issues/298)) ([4e61020](4e61020089))
* **duckdb:** cross-database federation via derived DuckDB connection ([#295](https://github.com/Kaelio/ktx/issues/295)) ([6c815ef](6c815ef529))

### Bug Fixes

* classify mcp query failures ([#302](https://github.com/Kaelio/ktx/issues/302)) ([7e29543](7e29543398))
* **cli:** make connection-not-configured errors actionable and expected ([#301](https://github.com/Kaelio/ktx/issues/301)) ([8a50601](8a50601582))
* **cli:** stop framing Claude Code session limits as auth failures (KLO-734) ([#300](https://github.com/Kaelio/ktx/issues/300)) ([b81391c](b81391cd9f))
* **git:** disable gpg signing for ktx's own commits ([#299](https://github.com/Kaelio/ktx/issues/299)) ([9587049](9587049283))
* **sl:** parse user filter expressions as predicates, not projections ([#307](https://github.com/Kaelio/ktx/issues/307)) ([fb50c11](fb50c11d16))

### Tests

* **cli:** persist warehouse connection in sl query tests ([#303](https://github.com/Kaelio/ktx/issues/303)) ([fde9f98](fde9f9862d)), closes [#301](https://github.com/Kaelio/ktx/issues/301)

### Other Changes

* refresh star history chart [skip ci] ([4dae8c3](4dae8c34dd))
* refresh star history chart [skip ci] ([01ccc73](01ccc73e40))
* refresh star history chart [skip ci] ([e8bfb3d](e8bfb3d301))
* refresh star history chart [skip ci] ([e4e7b40](e4e7b40c23))
* refresh star history chart [skip ci] ([e817736](e817736b91))
* refresh star history chart [skip ci] ([674b58b](674b58b3ed))
* refresh star history chart [skip ci] ([ed44f46](ed44f46f2a))
2026-06-19 08:49:46 +00:00
..
src/ktx_daemon fix: classify mcp query failures (#302) 2026-06-15 12:48:24 +00:00
tests feat(telemetry): collect PostHog $exception error reports in CLI and daemon (#262) 2026-06-05 19:36:21 +02:00
pyproject.toml chore(release): 0.13.0 [skip ci] 2026-06-19 08:49:46 +00:00
README.md refactor: enforce ktx naming and AGENTS.md compliance sweep (#289) 2026-06-11 13:49:45 +02:00

ktx-daemon

ktx-daemon is the portable Python compute package for ktx.

It supports portable compute in two modes:

  • One-shot commands, used by default by the @kaelio/ktx CLI.
  • An explicit HTTP server for long-running local MCP sessions.

One-shot semantic query

printf '%s\n' '{"sources":[],"query":{"measures":[],"dimensions":[]},"dialect":"postgres"}' \
  | ktx-daemon semantic-query

One-shot source generation

Generate semantic-layer sources from schema scan data:

printf '%s\n' '{"tables":[{"name":"orders","db":"public","columns":[{"name":"id","type":"integer","primary_key":true}]}],"links":[],"dialect":"postgres"}' \
  | ktx-daemon semantic-generate-sources

One-shot database introspection

Introspect a Postgres database schema:

printf '%s\n' '{"connection_id":"warehouse","driver":"postgres","url":"postgresql://readonly@example.test/warehouse","schemas":["public"]}' \
  | ktx-daemon database-introspect

One-shot LookML parsing

Parse LookML projects into resolved, KSL-ready structures:

printf '%s\n' '{"files":[{"path":"views/orders.view.lkml","content":"view: orders { sql_table_name: public.orders ;; measure: order_count { type: count } }"}],"dialect":"postgres"}' \
  | ktx-daemon lookml-parse

One-shot embeddings

Compute text embeddings locally:

printf '%s\n' '{"text":"hello"}' \
  | ktx-daemon embedding-compute

Compute text embeddings locally in bulk:

printf '%s\n' '{"texts":["hello","world"]}' \
  | ktx-daemon embedding-compute-bulk

One-shot code execution

Execute Python code with the current in-process boundary:

printf '%s\n' '{"code":"result = 1 + 2"}' \
  | ktx-daemon code-execute

HTTP compute server

Start the HTTP compute server with code execution disabled:

ktx-daemon serve-http --host 127.0.0.1 --port 8765

Enable HTTP code execution explicitly:

ktx-daemon serve-http --host 127.0.0.1 --port 8765 --enable-code-execution

Available HTTP endpoints:

  • GET /health
  • POST /database/introspect
  • POST /embeddings/compute
  • POST /embeddings/compute-bulk
  • POST /lookml/parse
  • POST /semantic-layer/generate-sources
  • POST /semantic-layer/query
  • POST /semantic-layer/validate
  • POST /code/execute when --enable-code-execution is passed

The HTTP server exposes Postgres database introspection, LookML parsing, local embedding compute, and semantic-layer compute for source generation, query compilation, and validation. Code execution is off by default. When enabled, it runs Python exec in the daemon process with the same in-process boundary as the one-shot code-execute command and does not provide OS-level sandboxing.

HTTP code execution uses the standalone ktx boundary. It does not forward caller authorization headers to a host app and does not connect scratchpad or visualization helpers to host application APIs.