How kaelio/ktx works
ktx is a local context layer for data agents. Its main workflow starts with project setup and ingestion from warehouses, modeling tools, and knowledge sources; ktx builds and reconciles searchable wiki and semantic-layer context, which agents then access through CLI or MCP search and read-only SQL execution. The README documents these product stages and integrations. Source excerpts show selected runtime, ingest, search, and daemon behavior, but many adapters and serving components were not sampled, so their links are limited to documented relationships.
Main entry points: server.ts MCP server · adapters Source adapters · public-ingest.ts Ingest workflow · sl Semantic sources
Components 21
CLI and setup
- CLI runtime
packages/cli/src/cli-runtime.ts - Project config
packages/cli/src/context/project/project.ts - Ingest commands
packages/cli/src/commands/ingest-commands.ts
Context building
- Ingest workflow
packages/cli/src/public-ingest.ts - Context builder
packages/cli/src/context/ingest/ingest-bundle.runner.ts - Source adapters
packages/cli/src/context/ingest/adapters - Warehouse mapping
packages/cli/src/context/scan
Knowledge and metrics
- Wiki knowledge
packages/cli/src/context/ingest - Semantic sources
packages/cli/src/context/sl - Metric query engine
python/ktx-sl/semantic_layer/engine.py
Agent serving
- MCP server
packages/cli/src/context/mcp/server.ts - Context search
packages/cli/src/context/sl/sl-search.service.ts - Read-only SQL
packages/cli/src/context/connections/query-executor.ts - Warehouse connectors
packages/cli/src/connectors
Compute services
- Compute daemon
python/ktx-daemon/src/ktx_daemon/app.py - Schema introspection
python/ktx-daemon/src/ktx_daemon/database_introspection.py - Embedding compute
python/ktx-daemon/src/ktx_daemon/embeddings.py
Other components
- Engineer
- Data agent
- Warehouse
- Knowledge sources
Connections 21
- Engineer → CLI runtime: runs setup
README.md - CLI runtime → Project config: loads project
packages/cli/src/cli-runtime.ts - Engineer → Ingest commands: starts ingest
README.md - Ingest commands → Ingest workflow: dispatches
packages/cli/src/commands/ingest-commands.ts - Ingest workflow → Project config: loads config
packages/cli/src/public-ingest.ts - Ingest workflow → Context builder: builds context
- Context builder → Source adapters: ingests sources
packages/cli/src/context/ingest/ingest-bundle.runner.ts - Warehouse → Warehouse mapping: provides schema
README.md - Source adapters → Wiki knowledge: organizes knowledge
README.md - Source adapters → Semantic sources: builds metrics
README.md - Knowledge sources → Source adapters: supplies content
README.md - Warehouse mapping → Semantic sources: maps joins
README.md - Data agent → MCP server: queries context
README.md - MCP server → Context search: searches context
README.md - MCP server → Metric query engine: requests metrics
README.md - Metric query engine → Semantic sources: reads definitions
python/ktx-sl/semantic_layer/engine.py - MCP server → Read-only SQL: executes SQL
README.md - Read-only SQL → Warehouse connectors: dispatches queries
- Warehouse connectors → Warehouse: runs read-only SQL
README.md - Compute daemon → Schema introspection: routes introspection
python/ktx-daemon/src/ktx_daemon/app.py - Compute daemon → Embedding compute: routes embeddings
python/ktx-daemon/src/ktx_daemon/app.py