ktx/python/ktx-daemon
semantic-release-bot 1ec29e82f7 chore(release): 0.14.0 [skip ci]
## [0.14.0](https://github.com/Kaelio/ktx/compare/v0.13.1...v0.14.0) (2026-06-30)

### Features

* **connectors:** add MongoDB connector ([#305](https://github.com/Kaelio/ktx/issues/305)) ([#310](https://github.com/Kaelio/ktx/issues/310)) ([2afab61](2afab61417))
* **docs:** add system theme option to theme toggle ([#324](https://github.com/Kaelio/ktx/issues/324)) ([4f08418](4f084186f1))
* ktx batch — scan resilience, analytics SQL craft, connector hardening ([#312](https://github.com/Kaelio/ktx/issues/312)) ([f65a5b0](f65a5b0e2e)), closes [#1](https://github.com/Kaelio/ktx/issues/1)

### Bug Fixes

* **gdrive:** validate folder access, run config test, harden Drive API ([#321](https://github.com/Kaelio/ktx/issues/321)) ([ca231df](ca231df5fe))

### Documentation

* improve CLI flags table readability ([#323](https://github.com/Kaelio/ktx/issues/323)) ([50afcae](50afcae9f4))

### Other Changes

* refresh star history chart [skip ci] ([46df7f3](46df7f3b24))
* refresh star history chart [skip ci] ([b0dca62](b0dca62c0e))
* refresh star history chart [skip ci] ([967a413](967a413a06))
* refresh star history chart [skip ci] ([89f2543](89f25435d5))
* refresh star history chart [skip ci] ([73e4c8b](73e4c8b270))
* refresh star history chart [skip ci] ([77c38e9](77c38e9ea2))
* refresh star history chart [skip ci] ([f61ea76](f61ea76007))
* refresh star history chart [skip ci] ([a155c0b](a155c0b844))
* remove private benchmark specs ([1c5d16a](1c5d16abc3))
2026-06-30 13:11:53 +00:00
..
src/ktx_daemon feat: ktx batch — scan resilience, analytics SQL craft, connector hardening (#312) 2026-06-29 16:35:57 +00:00
tests feat: ktx batch — scan resilience, analytics SQL craft, connector hardening (#312) 2026-06-29 16:35:57 +00:00
pyproject.toml chore(release): 0.14.0 [skip ci] 2026-06-30 13:11:53 +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.