2026-05-11 00:45:43 -07:00
---
title: Quickstart
2026-05-20 17:33:38 +02:00
description: Install ktx, run setup, and connect your coding agent.
2026-05-11 00:45:43 -07:00
---
2026-05-19 15:22:17 +02:00
import { CopyButton } from "@/components/copy-button";
2026-05-18 19:22:19 +02:00
This guide takes a local analytics project from empty to agent-ready. You'll
install the CLI, run one guided setup command, and hand the context to a
coding assistant.
docs: consolidate AI Resources into a single page (#274)
* docs: consolidate AI Resources into a single page
The AI Resources section was four pages (agent-quickstart, markdown-access,
agent-instructions, prompt-recipes) that repeated the same docs-consumption
guidance. Collapse them into one page at /docs/ai-resources covering markdown
endpoints, retrieval order, the task router, agent instructions, prompts, and
guardrails.
Also fix a stale claim: the page actions are a single "Copy as Markdown"
button, not the documented "Copy MD / View MD / Copy MDX" trio.
Update the cross-references in README, the introduction cards, the quickstart,
and the llms.txt entry points to the consolidated page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(docs-site): redirect retired AI Resources slugs, preserving .md route
Redirect the retired per-page slugs (/docs/ai-resources/*) to the consolidated
page. Because Next evaluates redirects before the .md rewrite, a single
catch-all would 308 a cached per-page Markdown URL to the HTML page and break
the agent Markdown contract. Match the .md variant first and keep its suffix so
it lands on /docs/ai-resources.md.
Extend the routing test to assert both the HTML and .md redirects, and that
following the .md URL end to end serves text/markdown.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: move AI Resources under the Community & Resources section
As a single page, AI Resources rendered as an orphaned, unbolded link wedged
between the top-level multi-page sections instead of as a section of its own.
Move it under Community (renamed "Community & Resources") so it renders as a
normal child link, consistent with how the single-page Configuration section
already works.
Redirect the former top-level URL and the retired per-page slugs (HTML and .md,
the .md variants first so cached Markdown URLs keep their suffix) to the new
home, relabel the llms.txt group to match, and repoint the README, introduction,
quickstart, and llms.txt cross-links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 21:28:56 -07:00
If you're a coding assistant choosing a docs route, start with
[AI Resources](/docs/community/ai-resources) instead.
2026-05-18 19:22:19 +02:00
<div
2026-05-21 16:04:58 +02:00
className="not-prose my-8 overflow-hidden rounded-2xl border"
2026-05-18 19:22:19 +02:00
style={{
2026-05-21 16:04:58 +02:00
borderColor: 'color-mix(in oklch, #ff8a4d 32%, transparent)',
background:
'linear-gradient(135deg, color-mix(in oklch, #ff8a4d 10%, transparent) 0%, color-mix(in oklch, #ff8a4d 3%, transparent) 100%)',
2026-05-18 19:22:19 +02:00
}}
>
2026-05-21 16:04:58 +02:00
<div className="flex flex-col gap-6 p-5 sm:p-7 md:flex-row md:items-center md:gap-10">
<div className="min-w-0 flex-1">
<div
className="text-[11px] font-black uppercase tracking-[0.16em]"
style={{ color: '#ff8a4d' }}
>
Need a warehouse to play with?
</div>
<div className="mt-2.5 text-base leading-relaxed text-fd-foreground">
Try **ktx** against a real data stack - Postgres, dbt, Metabase, and Notion
2026-05-29 15:02:57 +02:00
pre-loaded with the Orbit demo corpus. Hit **copy agent setup** on the page
for a one-shot prompt that has an agent install the full four-source demo,
or grab the raw credentials to paste into `ktx setup` yourself.
2026-05-21 16:04:58 +02:00
</div>
<a
2026-06-01 16:44:41 +02:00
href="https://www.kaelio.com/start"
2026-05-21 16:04:58 +02:00
className="group mt-5 inline-flex items-center gap-2 rounded-full px-4 py-2.5 text-sm font-semibold text-white no-underline shadow-[inset_0_1px_0_rgba(255,255,255,0.35),0_2px_4px_rgba(255,138,77,0.2),0_10px_24px_-8px_rgba(255,138,77,0.55)] transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.4),0_3px_6px_rgba(255,138,77,0.28),0_16px_30px_-8px_rgba(255,138,77,0.65)]"
style={{
background: 'linear-gradient(180deg, #ff9d63 0%, #f97316 100%)',
}}
>
2026-06-01 16:44:41 +02:00
Get demo credentials at www.kaelio.com/start
2026-05-21 16:04:58 +02:00
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2.4"
strokeLinecap="round"
strokeLinejoin="round"
className="transition-transform duration-200 group-hover:translate-x-0.5"
aria-hidden="true"
>
<line x1="5" y1="12" x2="19" y2="12" />
<polyline points="12 5 19 12 12 19" />
</svg>
</a>
</div>
<div
className="relative grid h-[152px] w-[152px] shrink-0 grid-cols-2 grid-rows-2 gap-2.5 self-center md:h-[168px] md:w-[168px]"
aria-hidden="true"
>
{[
{ src: '/ktx/icons/postgresql.svg', tint: '#e9eef5', rotate: -7, name: 'Postgres' },
{ src: '/ktx/icons/metabase.svg', tint: '#e8f1fc', rotate: 6, name: 'Metabase' },
{ src: '/ktx/icons/dbt.svg', tint: '#fde6dc', rotate: -4, name: 'dbt' },
{ src: '/ktx/icons/notion.svg', tint: '#f0eee8', rotate: 8, name: 'Notion' },
].map((sticker) => (
<div
key={sticker.name}
className="flex items-center justify-center rounded-2xl border border-fd-border bg-fd-card shadow-[0_2px_4px_rgba(20,18,12,0.04),0_14px_28px_-12px_rgba(20,18,12,0.22)]"
style={{ transform: `rotate(${sticker.rotate}deg)` }}
>
<span
className="flex h-full w-full items-center justify-center rounded-2xl"
style={{ background: sticker.tint }}
>
<img
src={sticker.src}
alt=""
width="38"
height="38"
style={{ objectFit: 'contain' }}
/>
</span>
</div>
))}
</div>
2026-05-18 19:22:19 +02:00
</div>
</div>
2026-05-19 15:22:17 +02:00
<div
className="not-prose my-6 rounded-lg border p-4"
style={{
borderColor: 'color-mix(in oklch, var(--color-fd-primary) 35%, transparent)',
background: 'color-mix(in oklch, var(--color-fd-primary) 8%, transparent)',
}}
>
2026-05-28 16:05:19 +02:00
<div className="flex flex-wrap items-center gap-x-3 gap-y-2">
<div className="text-sm font-semibold text-fd-foreground">
Or, ask an AI agent to install and configure **ktx** for you.
</div>
<div className="group relative ml-auto inline-flex">
<button
type="button"
aria-describedby="agent-setup-overlay"
className="inline-flex cursor-help items-center gap-1.5 rounded-full border border-fd-border bg-fd-background/70 px-2.5 py-1 text-xs font-medium text-fd-muted-foreground transition-colors hover:border-fd-primary/40 hover:text-fd-foreground focus:outline-none focus-visible:border-fd-primary/40 focus-visible:text-fd-foreground"
>
<svg
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2.4"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<circle cx="12" cy="12" r="10" />
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
<line x1="12" y1="17" x2="12.01" y2="17" />
</svg>
What does it do?
</button>
<div
id="agent-setup-overlay"
role="tooltip"
className="invisible absolute right-0 top-full z-20 translate-y-0.5 pt-2 opacity-0 transition-all duration-150 group-hover:visible group-hover:translate-y-0 group-hover:opacity-100 group-focus-within:visible group-focus-within:translate-y-0 group-focus-within:opacity-100"
>
<div className="w-[min(24rem,calc(100vw-2rem))] rounded-lg border border-fd-border bg-fd-popover p-3 text-sm leading-6 text-fd-popover-foreground shadow-xl">
<div className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">
The agent will
</div>
<ol className="mt-2 space-y-1.5 pl-0">
{[
<>Check prerequisites on your machine</>,
<>Ask only for credentials and connection choices</>,
<>Run <code className="whitespace-nowrap">ktx setup</code> in your project</>,
<>Verify each connection it configured</>,
<>Report what was installed and what is ready</>,
].map((item, index) => (
<li key={index} className="flex gap-2.5">
<span
className="mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[11px] font-bold tabular-nums"
style={{
background: 'color-mix(in oklch, var(--color-fd-primary) 18%, transparent)',
color: 'var(--color-fd-primary)',
}}
>
{index + 1}
</span>
<span className="leading-6">{item}</span>
</li>
))}
</ol>
<div className="mt-3 border-t border-fd-border pt-2 text-xs text-fd-muted-foreground">
Works with any AI coding agent.
</div>
</div>
</div>
</div>
2026-05-19 15:22:17 +02:00
</div>
<div className="mt-3 max-w-full overflow-hidden rounded-md border bg-fd-background">
<div className="flex items-center justify-between gap-2 border-b px-3 py-2">
<span className="text-xs font-semibold uppercase tracking-wide text-fd-muted-foreground">
Prompt
</span>
<CopyButton
2026-05-28 12:28:10 +02:00
text={[
2026-06-02 00:14:43 +02:00
'Run npx skills add Kaelio/ktx --skill ktx and use the ktx skill',
2026-05-28 15:30:51 +02:00
'to install and configure ktx',
2026-05-28 12:28:10 +02:00
].join(' ')}
2026-05-19 15:22:17 +02:00
className="-my-1"
/>
</div>
2026-05-28 15:30:51 +02:00
<div className="p-3 font-mono text-[13.5px] leading-6 text-fd-foreground">
2026-06-02 00:14:43 +02:00
Run {'`npx skills add Kaelio/ktx --skill ktx`'} and use the ktx skill to install and configure ktx
2026-05-19 15:22:17 +02:00
</div>
</div>
</div>
2026-05-11 16:42:08 -07:00
2026-05-14 18:09:26 -04:00
## Install the CLI
2026-05-11 16:42:08 -07:00
2026-05-18 19:22:19 +02:00
Install the published package globally:
2026-05-11 00:45:43 -07:00
```bash
2026-05-11 23:32:10 -07:00
npm install -g @kaelio/ktx
2026-05-11 00:45:43 -07:00
```
2026-06-08 17:10:36 -07:00
To upgrade an existing install later, re-run with the `@latest` tag:
```bash
npm install -g @kaelio/ktx@latest
```
2026-05-20 17:33:38 +02:00
**ktx** is open source. If you'd like to hack on it or run from a local checkout,
2026-05-18 19:22:19 +02:00
the source lives at [github.com/kaelio/ktx](https://github.com/kaelio/ktx) -
see [Contributing](/docs/community/contributing) to get set up.
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
## Run setup
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
From your project directory, run:
2026-05-11 00:45:43 -07:00
2026-05-14 18:09:26 -04:00
```bash
2026-05-18 19:22:19 +02:00
ktx setup
2026-05-16 12:06:34 +02:00
```
2026-05-20 17:33:38 +02:00
The wizard walks you through everything **ktx** needs in one pass:
2026-05-18 19:22:19 +02:00
1. **Project** - creates or resumes `ktx.yaml` in the current directory.
2. **LLM** - picks a Claude backend. The default uses your local Claude Code
session, so no API key is required. You can also use an Anthropic API key
or Vertex AI.
3. **Embeddings** - picks an embeddings backend. Choose OpenAI for hosted
embeddings or `sentence-transformers` to run locally without an API key.
4. **Database** - adds at least one primary connection. Supported drivers:
feat: Add duckdb connector (#308)
* refactor(duckdb): extract shared json-safe bigint helper
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(duckdb): add and register the duckdb primary connector
Add KtxDuckDbDialect, KtxDuckDbScanConnector (local file-backed, read-only,
never-create, main-schema introspection via information_schema and
duckdb_constraints() for foreign keys), and register the duckdb driver across
the dialect factory, driver registry, connection-type enum, warehouse descriptor,
config schema, scan normalization, connection test drivers, and status display.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(duckdb): route live-database ingest through the DuckDB connector
Add the DuckDB live-database introspection bridge and dispatch duckdb
connections to it in local-adapters, matching the SQLite path. Repoint the
config-rejection test off duckdb (now a valid driver) onto the no-driver case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(duckdb): add duckdb to the setup database flow
Offer DuckDB in the interactive checklist and via ktx setup --database duckdb,
with a file-path prompt and duckdb-local default connection id, parallel to SQLite.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(duckdb): attach native duckdb files in federation
Native .duckdb members ATTACH with (READ_ONLY) and no TYPE/INSTALL/LOAD, since
the duckdb format needs no extension. attachTypeForDriver returns null for the
native case; buildAttachStatements builds load statements from non-null types
only and emits a conditional ATTACH clause.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs(duckdb): document the duckdb primary-source connector
Add a DuckDB section to the primary-sources integration page (config, read-only
never-create behavior, main-schema scope, federation) and update the
supported-driver assertion in dialects.test.ts to include duckdb.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(duckdb): use single-namespace display shape for main-only refs
DuckDB v1 introspects the main schema and sets db=null on every table, so its
display refs are single-namespace like SQLite. The ansi shape emitted a 1-part
table display it then refused to parse, breaking column-level display resolution.
Switch the dialect to the sqlite display shape and add a round-trip test plus a
composite-foreign-key test that were missing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(duckdb): resolve connector dialect via getDialectForDriver
Route the connector's dialect through the shared factory like every other
connector, now that duckdb is registered. Single construction path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(duckdb): skip schema picker for single-file duckdb setup
DuckDB is a single-file, single-namespace ('main') database like SQLite,
but the setup scope step only skipped the schema picker for sqlite. DuckDB
fell into the multi-schema path with an empty schema list, rendering a
broken picker ("No matches found" for main). Extend the file-based-driver
early-return to cover duckdb so it ingests every table directly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(duckdb): reuse shared config helper and derive scope skip
Route duckdb path resolution through the shared resolveStringReference
helper instead of a local third copy of env:/file: handling. Derive the
setup scope-picker skip from SCOPE_DISCOVERY_SPECS membership rather than
a hardcoded sqlite/duckdb driver list.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(duckdb): use a genuinely unknown driver in the rejection test
The merged "rejects unknown drivers" test used `driver: duckdb` as its
unknown-driver stand-in, which stopped being unknown once this branch
added the duckdb connector. Switch to `nonsense` so it again exercises
the unsupported-driver config error.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(duckdb): cover dialect, connector, and live-introspection branches
Codecov flagged uncovered branches as dead code; all are real connector,
dialect, and live-ingest behavior. Add unit tests instead of removing them.
- dialect: precedence ladder, sample/clause builders, profiling expressions
- connector: url/env config forms, error throws, never-create guard,
cardinality cap branches, table-scope empty/non-empty paths
- live-introspection: full-schema and table-scope extraction
Functions 100%, lines ~99% across the duckdb connector dir.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: add DuckDB to supported-driver references
The DuckDB connector PR documented the connector itself but left the
scattered supported-driver enumerations stale. Add duckdb to the
federation concept page (participation table, activation, table naming,
limitations), the ktx setup CLI reference, the ktx.yaml warehouse-driver
table, the primary-sources field reference, and the quickstart driver
list (which also restores the missing ClickHouse entry).
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Andrey Avtomonov <andreybavt@gmail.com>
2026-07-01 19:06:02 +07:00
PostgreSQL, Snowflake, BigQuery, MySQL, ClickHouse, SQL Server, SQLite, and
DuckDB.
2026-05-18 19:22:19 +02:00
5. **Context sources** - optionally adds dbt, MetricFlow, LookML, Looker,
Metabase, or Notion. You can skip and add them later.
2026-06-03 01:00:21 +02:00
6. **Build** - offers to run the first ingest so semantic sources and wiki
pages are ready for agents. If you skip it, build later with `ktx ingest`.
2026-05-18 19:22:19 +02:00
7. **Agent integration** - installs project-local rules for Claude Code,
Codex, Cursor, OpenCode, or universal `.agents`.
2026-05-20 17:33:38 +02:00
If you choose local `sentence-transformers` embeddings, **ktx** uses the managed
2026-05-18 19:22:19 +02:00
Python runtime. To prepare it before setup, run:
2026-05-11 00:45:43 -07:00
```bash
2026-05-20 01:36:54 +02:00
ktx admin runtime install --feature local-embeddings --yes
ktx admin runtime start --feature local-embeddings
2026-05-11 00:45:43 -07:00
```
2026-05-18 19:22:19 +02:00
During the database step, setup tests the saved connection and builds initial
schema context:
2026-05-11 00:45:43 -07:00
2026-05-14 18:09:26 -04:00
```text
Testing warehouse
2026-05-14 01:43:06 +02:00
Connection test passed
2026-05-14 18:09:26 -04:00
Building schema context for warehouse
2026-05-29 17:41:04 +02:00
Running database scan
2026-05-11 00:45:43 -07:00
```
2026-05-20 17:33:38 +02:00
If setup exits early, rerun `ktx setup` in the same directory. **ktx** keeps
2026-05-18 19:22:19 +02:00
progress under `.ktx/setup/` and resumes from the remaining work.
2026-05-11 00:45:43 -07:00
2026-05-20 17:33:38 +02:00
> **Note:** Running bare `ktx` in an interactive terminal outside a **ktx**
2026-05-18 19:22:19 +02:00
> project opens the same wizard. Inside a project, it opens a menu for
> resuming setup, connecting an agent, checking status, or exploring a
> pre-built demo project.
2026-05-11 00:45:43 -07:00
2026-06-03 01:00:21 +02:00
When the wizard finishes, it states where you stand and the single next action:
- **Context built** - **ktx** confirms it is ready for agents and points you to
open your coding agent and ask a data question.
- **Build skipped** - **ktx** tells you setup is complete and that the only step
left is to build context with `ktx ingest`.
Re-running `ktx setup` on an already-configured project goes straight to the
remaining step - building context or connecting an agent - instead of
re-asking every question. Once everything is ready, it confirms you are set
rather than reopening the configuration menu.
2026-05-18 19:22:19 +02:00
## Verify
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
When setup finishes, check readiness:
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
```bash
ktx status
```
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
```text
2026-05-20 17:33:38 +02:00
ktx project: /home/user/analytics
2026-05-18 19:22:19 +02:00
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)
2026-05-20 17:33:38 +02:00
ktx context built: yes
2026-05-18 19:22:19 +02:00
Agent integration ready: yes (codex:project)
```
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
For a structured check inside scripts, use `ktx status --json`.
2026-05-11 00:45:43 -07:00
2026-06-03 01:00:21 +02:00
If you skipped the build, `ktx context built` shows `no`. Build it with
`ktx ingest` - there is no need to re-run `ktx setup`.
2026-05-29 17:41:04 +02:00
When setup finishes building context, its final context check looks like:
2026-05-11 00:45:43 -07:00
2026-05-14 18:09:26 -04:00
```text
2026-05-20 17:33:38 +02:00
ktx context is ready for agents.
2026-05-11 00:45:43 -07:00
2026-05-14 01:43:06 +02:00
Databases:
2026-05-29 17:41:04 +02:00
warehouse: database context complete
2026-05-11 00:45:43 -07:00
Context sources:
2026-05-14 18:09:26 -04:00
dbt_main: memory update complete
2026-05-11 00:45:43 -07:00
```
2026-06-03 13:08:46 +02:00
Before the build starts, **ktx** runs a live test for every connection the
build depends on. A context build can take several minutes, so if any required
connection is unreachable or misconfigured the build is blocked up front and
**ktx** names the failing connection by id and connector type:
```text
2026-06-11 13:49:45 +02:00
ktx cannot build context: a required connection failed its live test.
2026-06-03 13:08:46 +02:00
Failed connections:
warehouse (postgres)
2026-06-11 13:49:45 +02:00
Each connection must be reachable before ktx builds context.
2026-06-03 13:08:46 +02:00
Run `ktx connection test <id>` to see the error, fix the connection, then retry.
```
Run `ktx connection test <connection-id>` to see the underlying error, fix the
connection, then continue. In interactive setup you can retry without
restarting; with `--no-input` the build exits non-zero and names the failing
connection so scripts can stop early.
2026-05-18 19:22:19 +02:00
## Connect a coding agent
2026-05-11 00:45:43 -07:00
2026-05-18 19:22:19 +02:00
The setup wizard installs project-local agent rules in the last step. To
install or change targets later:
2026-05-11 00:45:43 -07:00
2026-05-14 18:09:26 -04:00
```bash
2026-05-18 19:22:19 +02:00
ktx setup --agents
2026-05-14 18:09:26 -04:00
```
2026-05-18 19:22:19 +02:00
Claude Code and Codex also support global installs with `--global`. Agent
2026-05-20 17:33:38 +02:00
rules point at the **ktx** CLI path that created them, so agents don't need a
2026-05-18 19:22:19 +02:00
separate `ktx` binary on `PATH`. If the CLI path changes, rerun
`ktx setup --agents`.
2026-05-11 23:32:10 -07:00
2026-05-18 19:22:19 +02:00
## What setup writes
2026-05-11 16:42:08 -07:00
2026-05-20 17:33:38 +02:00
**ktx** writes plain files so people and agents can review changes in git.
2026-06-10 14:12:25 +02:00
**ktx** initializes a git repository at the project directory and writes context
changes there. If the project directory is nested inside another repository,
**ktx** still keeps its own repo and does not commit to the parent repo.
Because **ktx** owns that repository, it will not adopt one it did not create. If
you point setup at a directory that is already a git repository's root - such as
an existing application checkout - **ktx** stops and asks you to pick a dedicated
directory instead. In the setup wizard choose the **New subfolder** option (for
example `ktx-project`), or pass a fresh `--project-dir` when running setup
non-interactively.
2026-05-11 16:42:08 -07:00
2026-05-14 18:09:26 -04:00
| Path | Purpose |
|------|---------|
2026-05-18 19:22:19 +02:00
| `ktx.yaml` | Project configuration |
| `.ktx/secrets/*` | Local secret files referenced from `ktx.yaml` - do not commit |
2026-05-20 17:33:38 +02:00
| `semantic-layer/<connection-id>/*.yaml` | Semantic sources for SQL compilation |
2026-05-14 18:09:26 -04:00
| `wiki/global/*.md` | Shared business context and metric definitions |
2026-05-18 19:22:19 +02:00
| `.claude/skills/ktx/`, `.agents/skills/ktx/`, `.cursor/rules/ktx.mdc`, `.opencode/commands/ktx.md` | Installed agent rules |
2026-05-14 18:09:26 -04:00
2026-05-18 19:22:19 +02:00
## Scripted setup
2026-05-14 18:09:26 -04:00
2026-05-18 19:22:19 +02:00
For repeatable fixtures and automation, skip prompts with flags:
2026-05-14 18:09:26 -04:00
```bash
ktx setup \
--project-dir ./analytics \
--no-input \
2026-05-19 19:23:35 +02:00
--yes \
2026-05-14 18:09:26 -04:00
--skip-llm \
--skip-embeddings \
--database postgres \
2026-05-19 19:23:35 +02:00
--database-connection-id warehouse \
2026-05-14 18:09:26 -04:00
--database-url env:DATABASE_URL \
--database-schema public
```
Then build context:
```bash
2026-05-29 17:41:04 +02:00
ktx ingest warehouse
2026-05-14 18:09:26 -04:00
```
See [ktx setup](/docs/cli-reference/ktx-setup) for the full automation flag
surface.
2026-05-18 19:22:19 +02:00
## Common issues
2026-05-11 16:42:08 -07:00
2026-05-18 19:22:19 +02:00
| Symptom | Fix |
|---------|-----|
| `ktx: command not found` | Reinstall `@kaelio/ktx` and open a new shell |
| Setup resumes the wrong project | Pass `--project-dir <path>` |
| LLM or embeddings health check fails | Rerun setup and pick a different credential, model, or backend |
2026-06-03 13:08:46 +02:00
| Database test fails | Use the setup recovery menu to retry or re-enter details; if it still fails, verify the same connection with the database's native client |
| Context build blocked: a connection failed its live test | Run `ktx connection test <connection-id>` to see the error, fix the connection, then retry the build |
2026-05-18 19:22:19 +02:00
| Agent integration is incomplete | Run `ktx setup --agents --target <target>` |
2026-05-11 16:42:08 -07:00
2026-05-11 00:45:43 -07:00
## Next steps
2026-05-18 19:22:19 +02:00
- Refresh context with [Building Context](/docs/guides/building-context).
- Edit semantic sources and wiki pages with
[Writing Context](/docs/guides/writing-context).
2026-05-14 18:09:26 -04:00
- Connect more tools with [Agent Clients](/docs/integrations/agent-clients).
2026-05-18 19:22:19 +02:00
- Read [The Context Layer](/docs/concepts/the-context-layer) to understand
the architecture.