--- title: Introduction description: KTX is an open-source, self-improving context layer for data agents. --- import { ProductMechanics } from "@/components/product-mechanics";

Make analytics context usable by agents

{'KTX is an open-source context layer for database agents. It turns warehouse metadata, BI models, query history, docs, and approved metric definitions into reviewable files agents can search and execute.'}

## Why KTX helps KTX gives agents a shared context workspace before they write SQL, answer a question, or update analytics definitions. - **Context as code.** KTX writes wiki pages and semantic-layer definitions as git-based files you can review, diff, and merge. - **Self-improving ingest.** KTX reads warehouses, BI tools, modeling code, query history, and notes, then reconciles new evidence with accepted context. - **Executable semantics.** Agents can use approved measures, joins, filters, dimensions, and segments instead of rebuilding canonical SQL from scratch. - **Agent-native access.** CLI and MCP tools let agents search context, compile semantic queries, run read-only SQL, and propose updates. KTX complements existing semantic layers by pairing metric definitions with the surrounding business knowledge, caveats, provenance, and review workflow agents need for data work. ## How KTX works KTX has two connected sides: it builds and maintains the context layer, then serves that context to agents at runtime. | Side | What KTX does | |------|---------------| | **Ingest and auto-maintain knowledge** | Reads your data stack and company knowledge, reconciles new evidence with accepted context, and keeps changes to `semantic-layer/` plus `wiki/` as version-controlled diffs automatically. | | **Serve agents at runtime** | Helps agents find the right wiki pages and semantic-layer entities, then compile or execute semantic queries through CLI and MCP tools. | ## Use it for Use KTX when agents need more than raw database access. Agents can search wiki context, find semantic-layer entities, compile trusted semantic queries, run read-only SQL, and use the same tools through MCP. - Generate SQL from approved metrics, joins, filters, and dimensions. - Explain metric provenance with wiki context and source evidence. - Repair context through reviewable YAML and Markdown diffs. - Work alongside dbt, MetricFlow, LookML, Looker, Metabase, Notion, and supported databases. ## Start here Choose the route that matches what you want to do next. The quickstart is the best first step for users; contributor setup lives in the community docs. Install KTX, run setup, build context, and connect an agent. Understand why agents need more than schema access and raw SQL. Refresh context from databases, BI tools, query history, and documents. Edit semantic-layer YAML and wiki Markdown safely. Complete flag and subcommand reference for every KTX command. Machine-readable docs and agent-facing setup notes.