{source.name}
{source.detail}
{source.signal}
KTX builds the model
-
{ingestSteps.map((step, index) => (
Outputs KTX writes
import type { ReactNode } from "react";
type SourceInput = {
name: string;
sources: string[];
detail: string;
signal: string;
accent: string;
};
const sourceInputs = [
{
name: "Database structure",
sources: [
"Postgres",
"Snowflake",
"BigQuery",
"and many others",
],
detail: "tables, columns, types, constraints, row counts",
signal: "grounds definitions in live database structure",
accent: "border-fd-primary",
},
{
name: "BI and usage evidence",
sources: ["Metabase", "Looker"],
detail: "historic SQL, questions, dashboards, usage patterns",
signal: "extracts joins, filters, grain, and trusted examples",
accent: "border-orange-500",
},
{
name: "Semantic modeling",
sources: ["dbt", "MetricFlow", "LookML"],
detail: "models, metrics, dimensions, explores, joins",
signal: "maps existing modeling logic into semantic entities",
accent: "border-amber-500",
},
{
name: "Company documentation",
sources: ["Notion"],
detail: "Notion pages, policies, caveats",
signal: "links business language back to semantic references",
accent: "border-slate-500 dark:border-cyan-200",
},
] satisfies SourceInput[];
const ingestSteps = [
{
title: "extract evidence",
body: "Pull structured facts from schemas, SQL, BI metadata, and docs.",
},
{
title: "reconcile entities",
body: "Merge names, measures, joins, and caveats into one project model.",
},
{
title: "validate references",
body: "Check semantic fields and joins against database context before agents use them.",
},
];
const artifacts = [
{
path: "semantic-layer/*.yaml",
title: "Typed query model",
body: "sources, grain, joins, dimensions, measures, filters, segments",
},
{
path: "wiki/*.md",
title: "Business context",
body: "rules and caveats with sl_refs back to semantic-layer entities",
},
{
path: "raw-sources/",
title: "Evidence trail",
body: "scan artifacts, extracted metadata, relationship evidence",
},
{
path: ".ktx/",
title: "Local indexes",
body: "embeddings and search indexes, not the source of truth",
},
];
const runtimeSteps = [
{
title: "Search wiki",
body: "Find business rules, caveats, synonyms, and sl_refs.",
},
{
title: "Resolve semantic refs",
body: "Map measure and dimension names to approved entities.",
},
{
title: "Validate fields",
body: "Check source, columns, joins, grain, filters, and segments.",
},
{
title: "Build query plan",
body: "Create a semantic query plan before SQL is generated.",
},
{
title: "Compile dialect SQL",
body: "Generate warehouse-shaped SQL instead of copying examples.",
},
{
title: "Execute with bounds",
body: "Optionally run with bounded rows and return provenance.",
},
];
export function ProductMechanics() {
return (
KTX reads source evidence, writes local context files, and gives
agents semantic search, validation, SQL, and provenance.
{source.name}
{source.detail}
{source.signal}
KTX builds the model
Outputs KTX writes
This is the API surface agents should use: compact semantic intent,
not hand-written warehouse SQL.
source:{" "}
orders joined to customers as many_to_one
measure:{" "}
total_revenue = sum(amount) with refund filter
grain: segment
group-by with date predicate
result: dialect
SQL, bounded rows, and provenance
The output can be SQL-only or executed results with provenance, so
the agent can show where the answer came from.
How KTX works
{ingestSteps.map((step, index) => (
{runtimeSteps.map((step, index) => (
{eyebrow}
{body}
{path}
{title}
{body}
{children}
); } function SourceList({ sources, }: { sources: string[]; }) { return (Sources