frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Ktx – Open-source executable context layer for data agents

https://github.com/Kaelio/ktx
17•lucamrtl•3h ago
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 decisions

To 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 classic semantic layer. That solves the executable part, but they’re such a pain to build and maintain since they were made for legacy BI tools. Plus as a standalone tool, they lack all the useful context from unstructured data sources like internal docs.

So we built ktx and split it into 2 parts:

1. Business context goes in Markdown wiki pages that are auto-ingested and auto-populated

2. Queryable definitions go into YAML files that define tables, row grain, joins, measures, dimensions, filters, and filter groups

That way, when an agent needs a metric, it asks ktx for a measure, dimensions, filters, and filter groups instead of writing the whole query itself. ktx’s planner chooses the join path, uses grain and relationship metadata, catches issues like join fanout and chasm joins, and compiles the warehouse SQL, while utilizing the extra unstructured knowledge it has access to.

ktx is Apache 2.0. It can ingest from most warehouses (BigQuery, Snowflake, Postgres & others), modeling tools (dbt, MetricFlow, LookML), BI tools (Looker, Metabase), doc tools like Notion, and corrections from user interactions.

Install manually:

npm install -g @kaelio/ktx

ktx setup

Or give this prompt to your agent:

Run npx skills add Kaelio/ktx --skill ktx and use ktx skill to install and configure ktx

We’d especially like feedback from people who’ve tried using Claude Code, Codex, or building custom agents on analytics warehouses. Where did they fail? And what did you try to make the answers more reliable?

Comments

tarun_anand•46m ago
How does this compare with Wren 2.0, OpenVikings etc
andreybavt•23m ago
Hey, ktx maintainer here! Great question, we actually have quite a bit in common with Wren, they're in the same category. The main difference is that with Wren you author the semantic model (write MDL) and it executes SQL through its own Rust engine (similar to Cube as well). ktx instead builds the context for you - ingesting definitions already in dbt, Looker, Metabase, and Notion, auto-detecting joins and fan/chasm traps, flagging contradictions. It also builds both : the SL and wiki that accumulates and maintains free-form tribal knowledge (that’s also interlinked with ktx SL)
lucamrtl•19m ago
Thanks for the question! OpenVikings is context/memory infrastructure for agents. ktx is analytics context for data agents specifically. So they're in different categories

The way we think about the space: there's a "semantic layer" side (Cube, dbt MetricFlow, Wren's engine) that compiles correct SQL but is hand-authored. And a "company brain" side (OpenViking, Glean, wikis) that indexes prose but can't query data warehouses safely. ktx is built to be both halves at once - a YAML semantic layer and a searchable wiki of business definitions, cross-linked (each wiki page references the metrics it explains) and auto-maintained

Show HN: Continue? Y/N: A 60-second game about AI agent permission fatigue

https://llmgame.scalex.dev
127•Wirbelwind•5h ago•67 comments

Show HN: Ktx – Open-source executable context layer for data agents

https://github.com/Kaelio/ktx
18•lucamrtl•3h ago•3 comments

Show HN: Hallucinate – Massively Multiplayer Online Rave

https://hallucinate.site
364•stagas•14h ago•156 comments

Show HN: Open-Source AI Racing Harness

https://www.elodin.systems/post/elodin-ai-grand-prix-race-sim-harness
48•danAtElodin•22h ago•5 comments

Show HN: TapToyPia

https://memalign.github.io/m/taptoypia/index.html
8•memalign•4d ago•1 comments

Show HN: AI Skill to port PostgreSQL extensions to MySQL

https://github.com/villagesql/villagesql-skills
2•deesix•3h ago•0 comments

Show HN: Multiplayer, a debugging agent to run locally next to your coding agent

https://www.multiplayer.app/
5•tomjohnson3•4h ago•1 comments

Show HN: Beacon CLI for self-hosted monitoring, remote access and deployments

https://github.com/Bajusz15/beacon
5•matebajusz•4h ago•1 comments

Show HN: Open-source Workspace (mail,docs,spreadsheet,drive) web/iOS

https://tinycld.org/
102•nathanstitt•1d ago•38 comments

Show HN: I made an emergency page for my family

https://help.delduca.org
79•delduca•1d ago•102 comments

Show HN: LiteParse v2, now in Rust 100x faster

https://github.com/run-llama/liteparse/
10•pierre•6h ago•0 comments

Show HN: Posthorn, self-hosted mail gateway

https://github.com/craigmccaskill/posthorn
79•craigmccaskill•1d ago•60 comments

Show HN: Electrical Grid Mapping Launchpad

https://MapYourGrid.org/map-it/
6•andreashd11•8h ago•2 comments

Show HN: AT4K Launcher - Apple TV inspired Launcher for Android TVs

https://at4klauncher.com
6•avadhesh18•9h ago•2 comments

Show HN: Reassign – a 24-hour dial for planning your day

https://reassign.app
7•smuk3c•9h ago•22 comments

Show HN: LaunchPact – get upvotes for your ProductHunt launch

https://www.launchpact.io
6•devtanna•10h ago•2 comments

Show HN: A website that tracks every stock trade Congress makes

https://congress.kadoa.com/
59•hubraumhugo•2d ago•20 comments

Show HN: Teleport-env – <500ms stateful rollbacks for AI agents via CRIU

https://github.com/JaiCode08/teleport-env
7•Jainish08•16h ago•0 comments

Show HN: OpenBrief – Local-first video downloader/summarizer

https://github.com/tantara/openbrief
91•tantara•2d ago•17 comments

Show HN: Audiomass – a free, open-source multitrack audio editor for the web

https://audiomass.co/?multitrack=1
547•pantelisk•4d ago•120 comments

Show HN: Filemat – an open-source web-based file manager

https://github.com/bingud/filemat
17•bingud•1d ago•12 comments

Show HN: Sweetpad – VS Code extension for building iOS/Swift apps

https://github.com/sweetpad-dev/sweetpad
7•hyzyla•21h ago•0 comments

Show HN: Geomatic – A command-driven geometry studio enabled with autodiff

https://www.tinyvolt.com/geomatic
74•nivter•3d ago•17 comments

Show HN: An update to our long-turn FreeCiv experience

https://freeciv.andrewmcgrath.info/
5•verelo•18h ago•0 comments

Show HN: Hodor – a 701KB native macOS prompt launcher for AI tools

https://hodor.design
9•woodydesign•1d ago•2 comments

Show HN: Rapel – chunked resumable downloads in unstable networks

https://github.com/redraw/rapel
19•autorun•2d ago•9 comments

Show HN: Fungible – A local personal finance app in the terminal

https://github.com/tomfunk/fungible
28•tomfunk•2d ago•13 comments

Show HN: Cross-agent messaging and shared memory over the local filesystem

https://oacp.dev
13•haoranchg•2d ago•7 comments

Show HN: Local CPU model for fact-checking, summarizing, explaining text

https://github.com/kouhxp/fftext
6•mrkn1•21h ago•0 comments

Show HN: Game Boy pixel pipeline explorer

https://pixelpipeline.xyz
13•blueblazin•1d ago•6 comments