Konstruct reads your data stack, works out what every number means and how it is calculated, and proves it against your data.
Then it puts that knowledge in front of the people reviewing changes and the AI agents writing them.
Open source. Runs on your machine. One command.
Get started · Live demo · Documentation · GitHub Action · Paper · Manifesto
Your business numbers live in many places, and they change quietly. Revenue can be a metric in dbt's semantic layer, a column in a finance mart and a filter in a staging model, all at once. A pull request that moves one of them is reviewed as SQL: the reviewer sees a constant go from 5.0 to 8.0, and nobody spots that a fee and a net sale price change with it.
AI agents make it harder. Coding agents answer from the schema, which names the columns and hides the definitions behind them. In a VB Pulse survey of 101 enterprises in June 2026, 57% had traced a confident but wrong answer from an AI agent to missing or inconsistent business context in the previous six months (VentureBeat, 2026).
Konstruct closes the gap. It builds one map of your business from the code you already have: every table, column, formula and business term, traced down to its source. It tests that map against your data. And it puts the answers where decisions are made: on each pull request, inside each coding agent, and in a page anyone can browse.
Drawn in Excalidraw with icons from the Excalidraw libraries. Edit it by opening docs/images/architecture.excalidraw in Excalidraw.
|
Every dbt pull request gets a comment that opens with the business numbers it changes and how, the dashboards that read them, and what the change does to today's figures. Formatting and renamed CTEs are ignored, and the check fails when a change would break something people rely on.
|
Konstruct writes a brief of your approved business terms, with the SQL, required filters and columns to avoid, and installs it for Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI and Windsurf. With the brief, two Claude models answered 80 of 80 conversations on 40 business questions correctly; with the schema alone, 17 of 80 were confidently wrong.
|
|
A query that drops a required filter, counts rows twice through a join, reads a retired column or leaves a value in cents is caught with its fix. A Claude Code hook runs the same gate after every edit an agent makes.
|
See how any column is calculated, all the way down:
|
|
When two teams compute the same number two ways, Konstruct shows exactly what differs and in which file, then runs both on the same rows to show how far apart they are.
|
Konstruct reruns each model with one input column changed at a time and records what moves. On dbt Labs' jaffle-shop, all 87 claimed column edges are confirmed, and nothing changed that the graph did not predict.
|
|
Mark a column as sensitive and Konstruct follows it through the lineage, hashes included. The gate blocks a change that moves it somewhere unapproved, and the erasure map lists every relation holding one person's rows.
|
See when a formula changed, in which commit, and whether its definition was approved afterwards. Release notes describe each change in SQL and plain English, and teams that read another team's data can lock the meanings they depend on.
|
Review any public dbt pull request on GitHub by its URL, with no clone, no configuration and no warehouse:
$ konstruct review https://github.com/KacperChojnacki1337/cs2-market-data-platform/pull/85
Konstruct: Fee amount pln and net sell price pln: its formula has 8.0 where it had 5.0
That pull request raises the Skinport sale fee from 5% to 8% in fct_realized_pnl. The review fetches only the dbt project's files, and the macros of the dbt packages it names, and runs nothing from the repository. Reviews of Public Pull Requests shows more, and Konstruct on Public dbt Projects shows what it finds in six public dbt projects, from dbt Labs' jaffle-shop to the California Integrated Travel Project's data warehouse.
Konstruct is not on PyPI yet; install it from GitHub with uv:
uv tool install git+https://github.com/kodexlabsio/konstructInstalling from GitHub compiles Konstruct, so it needs a Rust toolchain (1.95 or newer); each release also has wheels for Linux, macOS and Windows that do not. Konstruct runs on x86_64, aarch64, riscv64, ppc64le, s390x (IBM z13 or later) and loongarch64.
Then, in a repository with dbt models, SQL, DAGs or a warehouse:
konstruct trust # once you have reviewed the project: lets Konstruct run dbt in it
konstruct build # writes konstruct-out/ and ends with the findings worth a look
konstruct install --target . --agent all # gives every coding agent the project's business definitions
konstruct open # the interactive graph in a browserNo configuration is needed: Konstruct finds dbt projects, Airflow and Dagster files, SQL, definitions and the warehouse each dbt profile points at. From an empty directory to the first findings takes about six seconds on the bundled example, most of it dbt compiling the project (performance). On that example the first build ends like this:
Findings
conflict orders.amount is 'Order amount' in definitions.yml, and finance_orders.order_value, named like it, computes it another way: finance_orders.order_value counts only the rows where stg_orders.status NOT IN ('returned', 'return_pending'); compare them on the data: `konstruct verify --conflicts`
reach a change to raw_payments.amount reaches 1 exposure (customer_dashboard), 9 columns and 5 relations; see everything downstream: `konstruct impact raw_payments.amount`
read stg_payments.amount is read directly by 7 columns, more than any other column; see what reads it: `konstruct impact stg_payments.amount --depth 1`
next graph.html draws the graph and its column lineage; open it: `konstruct open`
$ konstruct verify --conflicts
Order amount
finance_orders.order_value vs orders.amount
finance_orders.order_value and orders.amount differ: 6 rows of order_id only in orders.amount; totals 1,585 and 1,672, 87 apart (5.5% of the first)
- filter only in finance_orders.order_value: WHERE NOT stg_orders.status IN ('returned', 'return_pending')
Each agent then reads the project's definitions in every conversation (the brief). One entry of the bundled example's BRIEF.md:
### Order amount
- approved; Priya Shah (Head of Finance); 2026-10-30
- also: order value, order total
- means: Total of all payments recorded against an order, in Australian dollars.
- sql: none; the definition does not say how the values of the column it is held in combine across rows (a sum, an average or a ratio): compute it as the definition says
- grain: one row per order; unit: currency AUD
- held in: `orders.amount`
- not: `finance_orders.order_value` (finance_orders.order_value counts only the rows where stg_orders.status NOT IN ('returned', 'return_pending'))Each build also writes graph.html, an offline site with a page for every model, column and business term, its formula and its lineage (live demo):
Lineage tools usually assert their lineage. Konstruct measures it, and every number here is a test that runs on every commit.
| Lineage checked against the data (seed 1729) | Claimed column edges | Confirmed | Unexplained |
|---|---|---|---|
The bundled jaffle_shop example |
40 | 40 | 0 |
| dbt Labs' jaffle-shop, at a pinned commit | 87 | 87 | 0 |
| The example on Postgres | 35 | 35 | 0 |
| Generated queries on generated data (25 on every commit, 300 in a full run) | 0 |
| Generated dbt project | Column edges | Cold build | Update, one model edited | Query |
|---|---|---|---|---|
| 500 models | 12,940 | 5.4 s | 1.1 s | 0.4 ms |
| 2,000 models | 51,940 | 20.7 s | 5.9 s | 1.3 ms |
Composed formulas are evaluated on the data and must match the final model row for row; the static Airflow and Dagster parsers are compared with Airflow's and Dagster's own graphs; and OpenLineage exports are validated against the specification. Performance and verification give the details.
| Transformation | dbt (manifest, catalog, or rendered without dbt), standalone SQL files, the SQL in PySpark jobs, warehouse views, and the Parquet, CSV and JSON files queries read by path |
| Orchestration | Airflow (DAGs, TaskGroups, TaskFlow, assets, Cosmos) and Dagster (assets, op jobs, schedules, sensors), parsed without running them |
| Warehouses | DuckDB, Postgres, Snowflake, BigQuery, Databricks, Trino, and Iceberg through any PyIceberg catalogue |
| Dashboards | dbt exposures, Looker views field by field from LookML, and Power BI semantic models from TMDL |
| Ingestion | The tables two dozen loaders land (Fivetran, Airbyte, dlt, Singer, Meltano, Stitch, Debezium, Datastream, Openflow, Estuary, Segment, Snowplow and more), and lineage from the source systems they read |
| Meaning | Business terms in definitions.yml, dbt's semantic layer (MetricFlow), Apache Ossie models, SKOS and OWL vocabularies, 274 ontology packs for the systems teams land (Stripe, Shopify, Salesforce, HubSpot, Zendesk, Jira, Google Ads and hundreds more), and column usage from Snowflake, BigQuery and Databricks query history |
| Out | OpenLineage, Apache Ossie, OWL, Snowflake semantic views, Databricks metric views, ODCS 3.2 data contracts, Mermaid, Graphviz DOT and CSV |
Inputs and how lineage works covers each one.
- MIT licensed. Use it, study it, change it and share it.
- Runs on your machine. No server, no account, no telemetry. It makes no requests beyond the warehouses you configure and the repositories and dbt packages you ask it to fetch.
- Never runs your orchestration code. DAG files are read as syntax trees and dbt Jinja is rendered in a sandbox.
konstruct verify, the only command that runs a model's SQL, never commits anything to the warehouse. - Your knowledge stays in plain files. The graph, report, ontology and brief are JSON, YAML and Markdown in
konstruct-out/, readable without Konstruct.
The manifesto sets out these commitments and how to check each one, and SECURITY.md lists what Konstruct executes, reads and writes.
Konstruct builds on the best open-source work in data: sqlglot parses and transpiles every major SQL dialect, dbt defines how modern transformation is written, DuckDB runs verification on your laptop, OpenLineage is the open standard it writes, and Apache Ossie (incubating) the one it reads and writes. What Konstruct adds is one ontology across all of them, from the table Fivetran landed to the Power BI measure on the dashboard, with the lineage beneath it verified on the data.
The full list, with a link to the guide for each. Try the live demo: the viewer for the jaffle_shop example, rebuilt from main with the documentation.
konstruct ontology: the entities and their keys, the measures with their composed formulas, and the relationships between entities, with cardinality where a key is tested, checked against rules that--strictturns into a failing build (the ontology).konstruct entity,konstruct metricandkonstruct relate: one entity with its properties, relationships and metrics; every metric with its formula, grain, filters, owner and status, fromdefinitions.yml, dbt's semantic layer, Looker and Power BI, and those Konstruct proposes from aggregate and measure columns where nothing defines one, marked inferred and never approved; and how two entities join, with the SQL. Every entity, metric and relationship says whether it is verified against the warehouse, declared or only inferred (entities, metrics and relationships).konstruct define: the approved business definition of a term fromdefinitions.yml, with its owner, status, grain, required filters and bound columns (business definitions).- 274 ontology packs for the source systems teams land, from Stripe, Shopify, Salesforce, HubSpot and GA4 to Zendesk, Jira and Google Ads, bound automatically when their tables are in the warehouse (ontology packs).
- SKOS and OWL vocabularies read as terms, with a concept hierarchy.
- Apache Ossie semantic models read as an input and written as an export, with each metric's lineage and trust added (Ossie).
konstruct search --meaning: find a column by what it is, not only what it is called: "revenue" findsnet_sales_amtthrough abbreviations, synonyms, its formula and its lineage, computed locally from the graph.- Column usage from Snowflake, BigQuery and Databricks query history, so the columns people read stand out (usage).
konstruct verify: lineage checked against the data by perturbation, on DuckDB, Postgres and samples of Snowflake, BigQuery, Databricks and Trino, and on DuckDB and Postgres the ontology's keys and relationships checked over whole tables, read only (verify).konstruct verify --mutate: mutation testing for dbt tests: small changes to each model's SQL are run against its data and unit tests, read only, with a score per model and column and a suggested test for each change the tests miss (mutation testing).konstruct verify --why: the source rows behind one value, such as one customer's lifetime value, each with its share, and the related rows a filter or join left out, with the reason (the rows behind a value).konstruct verify --conflicts: each measure conflictkonstruct conflictsfinds, run on the same rows, read only: by a key both share, the rows whose values differ and those only one side has, both totals and the rows that differ most, or that the two agree on the data; a dbt seed the warehouse lacks is read from its CSV file (conflicts on the data).konstruct verify --effect: what each formula change does on today's data: the changed model's SQL before and after each commit, run read-only on the same rows, so a moved number is split into a definition change and a data change (the effect on today's data).konstruct conflicts: the same measure computed in different ways, and exactly what differs, in one sentence. By default it lists the pairs likely to be two definitions of one number (the same name, values made of the same columns, and a filter or a condition only one side has in front of an aggregate, or a value column one side adds); check each, as most pairs that look alike differ on purpose. The other pairs are counted by kind, and--alllists them. The findings a build ends with name a conflict only when the project'sdefinitions.ymlbinds the two columns to one term, or binds one of them and the other, bound to no term of its own, is named like the term or one of its synonyms and is a likely measure conflict with it. Formulas are compared by what they compute, not how they are written, and two that differ come with values at which they give different results (conflicts).konstruct sensitivityandkonstruct erasure: personal or other sensitive data, marked indefinitions.yml, an ontology pack or warehouse tags and masking policies, followed through the column lineage, hashes included, until a sanitiser you name or an aggregate over groups the SQL proves hold enough distinct keys stops it; the gate fails a change that moves it into a model or exposure not marked to hold it, and the erasure map lists every relation holding one person's rows, hashed keys included (sensitive data).konstruct verify --laws: the totals the lineage says the data must keep (a mart's revenue equals its source's under the same filters and unit conversion, a model that maps rows one to one keeps the row count, and which measures may be summed), proposed from each model's SQL only where its joins are proven safe and checked per day, read only; the gate fails a change that breaks one (data laws).
konstruct diff: what a branch does to each column, ignoring formatting and renamed CTEs, and thedbt build --selectthat rebuilds exactly what it changes (reviewing changes).konstruct review: the pull request comment the GitHub Action posts, led by meaning: each business number the project declares (a business term, a semantic-layer metric, a number a dashboard reads) whose composed formula, rows or definition the change alters, ranked by consequence, then the numbers Konstruct proposes from the SQL that may change, the likeliest first, five listed and the rest by model, in plain English and SQL, with its approved definition and whether the change departs from it, the dashboards that read it, and, withkonstruct verify --effect --base REF, what it does on the data (the project's own seeds or a DuckDB sample, when the Action'seffectasks for it): the rows and keys that change, the total before and after, and an example row. One line, or no comment, when nothing changes meaning; past about 10 KB, the rest is in the job summary.konstruct gate: the check a coding agent passes before it proposes a change, and CI before it merges. It fails on a removed column something still reads, an approved definition whose meaning changed, a new column that computes a business idea differently from an existing one, a data law the change breaks, a column a consuming repository pins in its lockfile, and sensitive data moved into a model or exposure not marked to hold it.konstruct export odcsandkonstruct contract(check): ODCS 3.2 data contracts from the ontology, with a verified statement only where Konstruct holds a dbt test or akonstruct verifyresult and names it, and every other fact carrying its grade;contract checktests the columns, types, keys, relationships and measures a hand-written contract claims against the graph, and exits 1 when one is contradicted (data contracts).konstruct lock: a lockfile for meaning. A project that reads another team's data pins each upstream column's formula composed to source, row conditions, sources, type and business terms inkonstruct.lock, andkonstruct lock --checkfails when one comes to mean something else, with what changed, who changed it and the command to accept it; reformatting and renamed CTEs are not changes (pinning what you read).- A GitHub Action that comments on each pull request, annotates breaking changes and fails the check when a removed column is still read.
konstruct history: when a column's formula changed, in which commit, and whether its definition was approved after the change.konstruct release-notes: a change log of formulas, filters and business terms since a tag or date, each change in SQL and plain English with its commit, what it affects downstream and whether its terms were approved after it, as text, Markdown or JSON (release notes).konstruct timeline: how the business's meaning changed, commit by commit: the entities, relationships, properties and metrics each commit added, removed, renamed or changed, a metric's formula and required filters, how far each is trusted and who approved it, in plain English, with a release note for each metric change;konstruct verify --effect --timelineadds what each formula change does on today's data (timeline).konstruct trust: a repository's own warehouse connections and paths outside it are used, and its dbt project run, only after you review and trust it, and again after each change to those settings, so building an unreviewed checkout runs none of its code and sends no environment variable to a host it chose (trust).
- Coding agents:
konstruct installwrites Konstruct's skills for the agents--agentnames (Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI and Windsurf), with instructions or rules in each agent's own format (a managed section ofAGENTS.md,GEMINI.mdorcopilot-instructions.md, or a Cursor or Windsurf rule), and with--mcpregisters the MCP server in each agent's configuration (coding agents). In a repository it also gives every agent a brief of the project's business terms, each with the SQL that computes it where the definition says how, its required filters, grain and the columns not to use, from the lastkonstruct build, refreshed by installing again (the brief). With the brief, two Claude models answered 80 of 80 conversations on 40 business questions correctly, against 17 of 80 confidently wrong with the warehouse schema alone (method).konstruct mcpruns the MCP server, whose tools areimpact,trace,path,search,describe,query,explain,history,define,conflicts,ontology,entity,metric,relate,compile_metric,sensitivity,erasure,diff,gate,check_sql,conform,check_history,release_notes,timeline,mutation_test,why,definition_effect,receipt,laws,lock_checkandcontract_check, with seven prompts for the workflows and eight resources: the report, the ontology, the business definitions brief, a summary of the graph, and the views in which hosts that support the MCP Apps extension draw the results ofimpact,explain,gateandconformin the conversation, offline and as text only, beside the same text result (views. Every tool declares the four MCP tool annotations, and every result marks the repository's text as data to report, not instructions to follow. konstruct compile-metric: a metric asked for by entities and properties (lifetime value --by customer.first_name --by month), compiled to SQL without running it, joined only along relationships the project shows many-to-one, onto keys a test, a primary key orkonstruct verifyshows unique, with the required filters of its definition and every fact it rests on with its confidence; a query whose joins would repeat rows is refused, naming the link (compiling metric queries).konstruct check-sql: the SQL an agent writes, checked against the project before it runs, without running it: a measure that leaves out a filter its approved definition requires or computes it differently, a measure named for a term that reads only other terms' columns, a result still in cents of a column the project reads in whole units, a retired column, a join that repeats the rows a sum or count adds up, and names the project does not have, each with its fix and the corrected SQL.--historyfinds the same mistakes in the queries people already run in Snowflake, BigQuery and Databricks (checking SQL).konstruct conform: the semantic layers deployed on data platforms, checked against what the code computes. It reads Snowflake semantic views (CREATE SEMANTIC VIEWfiles, and the YAML Snowflake returns), Databricks metric views and Apache Ossie models, composes each metric through the graph from its table's relation and compares it with the approved definitions and the other implementations of the same concept, with a witness when they differ, and checks keys, relationships and columns against the code's tests and joins. No reference SQL is written and no warehouse query runs. Checking Semantic Layerskonstruct receipts: a receipt for an answer, recording the formulas, row conditions, sources, business terms and verification state of the columns it rests on and the build it came from, andkonstruct receipts check, which lists the answers whose basis has changed since, with the commit that changed it (answer receipts).- Eight skills:
konstructfor questions, and workflows for a safe change, reviewing a data change, reconciling two numbers, writing a correct query, defining terms, onboarding to a repository and exporting to a semantic layer. - A Claude Code plugin (
/plugin marketplace add kodexlabsio/konstruct, then/plugin install konstruct@konstruct) with the skills, the/konstruct:impact,/konstruct:review,/konstruct:gate,/konstruct:explainand/konstruct:definecommands, a data-reviewer subagent and the MCP server. konstruct hook: a PostToolUse hook that runs the gate after an agent edits SQL or dbt YAML and gives it the findings, building from files alone without dbt or a warehouse.
konstruct impactandkonstruct trace: everything downstream or upstream of a table or column, through dbt models, SQL files, warehouse views, Airflow and Dagster tasks, PySpark jobs, loaders and dashboards, with the transform at each step.konstruct path: how two tables or columns are connected.konstruct explain: a column's formula composed through every model upstream, down to source columns, with the joins and filters on the way;--englishwords it, its conditions, grain and terms in plain English by a fixed grammar, so the sentence says only what the SQL says (in plain English).konstruct build --update: an incremental rebuild that reanalyses only what changed.konstruct search,konstruct describe,konstruct listandkonstruct query: find anything in the graph by name, inspect one node, list a kind, or ask in plain words.- One graph across repositories that share a warehouse, and across warehouses.
- The command line:
konstruct init,konstruct build,konstruct status,konstruct openand every command above, the commands that answer a question with--jsonoutput for scripts (every command), versioned so that scripts keep working from one release to the next (compatibility). - Python:
konstruct.Project, with typed results for every question. - A browser:
graph.html, one offline documentation site with a page for every model, column, task and business term (its SQL, tests and formulas), a lineage graph that takes dbt selectors down to columns, a map of the whole project at once, search, and an overview of coverage and conflicts, in 14 languages and checked against WCAG 2.2 AA with axe-core;REPORT.mdandontology.ymlsit beside it for reading in a repository. - A local server:
konstruct serveserves the viewer with live reload and a read-only, versioned JSON API with an OpenAPI document (the HTTP API). - Other tools:
konstruct exportwrites OpenLineage events, Mermaid, Graphviz DOT, CSV and Apache Ossie, and the ontology as OWL in Turtle, a Snowflake semantic view, Databricks metric views and ODCS 3.2 data contracts, each saying what it leaves out (exporting). - Plugins: installed Python packages add inputs, export formats, gate checks, ontology packs and MCP tools through entry points, each run only when a project enables it in
konstruct.toml;konstruct pluginslists them (writing a plugin).
The full documentation is at kodexlabsio.github.io/konstruct:
- Guide: inputs and how lineage works, the viewer, explain, verify, reviewing changes, business definitions, the ontology, Apache Ossie models, conflicts, usage, coding agents
- Reference: commands, Python API, MCP server, configuration, outputs, limitations
- Project: development, contributing, security, changelog
- Paper: Konstruct: Column-Level Lineage Checked Against the Data, the design, the verification method and its soundness, and the evaluation, with every measurement of Konstruct regenerated from the code
- Manifesto: truth in data, what Konstruct believes and the commitments it makes to its users
Bug reports with a small failing case are the most useful contribution; CONTRIBUTING.md explains how to report one or propose a change. SECURITY.md covers reporting a vulnerability and what Konstruct executes, reads and writes: it never imports DAG code, renders dbt Jinja in a sandbox, makes no requests beyond the warehouses you configure and the repositories and dbt packages you ask it to fetch, and collects no telemetry.
MIT. See LICENSE. The generated ontology packs are made from connector schemas under the Apache-2.0 and MIT licences, which SOURCES.json lists repository by repository, and the viewer embeds the Manrope and JetBrains Mono fonts under the SIL Open Font License, so the package's licence expression is MIT AND Apache-2.0 AND OFL-1.1. The jaffle_shop example keeps its own Apache-2.0 licence. The licence texts are in licenses/, each named for what it covers: konstruct.txt (Konstruct, the root LICENSE), ontology-packs-apache-2.0.txt and ontology-packs.txt (the generated packs' sources under Apache-2.0, and each other source's licence with its copyright notice), manrope.txt and jetbrains-mono.txt (the fonts), and odcs-schema-apache-2.0.txt (the licence of the ODCS JSON Schema the tests validate against). The architecture diagram uses icons from the Excalidraw libraries, published under the MIT licence.

