Ktx – Open-source executable context layer for data agents

Hi HN, we’re open-sourcing ktx. It’s an executable context layer that makes agents reliable on your data stack.We built it after going through the experience of building production-grade data agents for dozens of companies. If you’ve also tried building them, or simply tried using Claude Code or Codex on your data warehouse, you’ll know that accuracy is the #1 issue. Agents are great at generating valid SQL, but it’s not always correct SQL.To cite a few examples of “agents gone wrong”:- Stale column + hidden business rule: when preparing a board report, a finance analyst asks Claude Code for “ARR by customer segment”, it derives ARR from multiple tables (subscriptions, plans, accounts), then groups by accounts.industry. But CC doesn’t know that this industry column was deprecated a few months prior, or that past board reports excluded paused subscriptions from the ARR calculation- Join fanout: a data analyst at a retailer uses their company’s internal agent to prep a product revenue deck for a QBR. The agent joins orders to order_items, then sums orders.total_amount_cents grouped by order_items.product_id. The SQL runs fine, but each order’s revenue is repeated once per line item, which most people will miss if most orders only have 1 item- Missing attribution logic: a marketing analyst asks Codex “Which campaigns drove the most revenue?” Codex joins marketing_touches to users to orders and groups by utm_campaign. But since each order can have multiple touches before purchase, the same order can be credited to first touch, last touch, every touch, or every campaign the user clicked before buying. If the agent chooses the method that doesn’t match the team’s attribution logic, they’ll make suboptimal decisionsTo solve this at first we gave the agent more context through skills + a wiki-style knowledge base. That gives it some useful extra context but still relies on it writing the SQL without incorrect assumptions.The next solution we explored was implementing a clas

Hacker NewsToolAISource
0Sign in to voteCopy link

FL score

72

out of 100

Verdict

VALIDATE

high confidence

Competition

No competitor data yet

Trend

No signal yet

An executable context layer that makes AI data agents reliable by encoding business logic, data lineage, and validation rules directly into the agent's decision-making process.

The pain

Data agents (Claude Code, Codex) generate syntactically valid SQL that produces incorrect results due to: stale schemas, hidden business rules, join fanouts, and misaligned attribution logic. This causes analytics teams to make decisions on bad data, undermining trust in AI-assisted analysis.

The gap

Current solutions (prompt engineering, knowledge bases, skills) provide context but don't enforce correctness. Agents still make assumptions and generate plausible-but-wrong queries. There's no systematic way to encode organizational data semantics into agent behavior.

Build angle

Position ktx as the 'type system for data agents', a declarative layer where teams encode: column deprecation rules, join cardinality constraints, business logic (attribution models, exclusion rules), and data lineage. Agents query this layer before executing, making errors detectable and preventable.

Strengths

  • Solves a real, acute pain point with measurable impact (accuracy in production data agents)
  • Founders have deep domain expertise (built this for dozens of companies)
  • Open-source positioning builds community and trust in a skeptical market
  • Addresses a growing market (data agents are becoming standard tooling)
  • Extensible architecture (can integrate with multiple agent frameworks and data stacks)
  • Clear competitive moat (encoding organizational semantics is defensible)

Risks

  • Adoption friction: requires teams to explicitly encode business logic (overhead vs. perceived benefit)
  • Market timing: data agents still early; may not be critical infrastructure yet for most companies
  • Competitive threat: major cloud providers (Databricks, Snowflake, dbt) could build similar features natively
  • Incomplete pitch: description cuts off mid-sentence; unclear what the actual 'class' solution is
  • Monetization unclear: open-source model works for infrastructure, but needs clear path to revenue
  • Integration complexity: must work seamlessly across heterogeneous data stacks to be valuable

Questions about this idea?

FlyBot reads the scoring and gives you a second opinion on “Ktx – Open-source executable context layer for data agents”.

Open FlyBot