ktx: A Context Layer That Teaches Agents to Ask Your Warehouse the Right Questions
You know the drill. You hook up an LLM agent to your data warehouse, ask it a question, and it either returns a SQL query that's subtly wrong or just glazes over and says "I don't know." The problem isn't the model — it's that your warehouse has no context. No schema description, no documentation, no examples of what "good" looks like.
ktx is a self-improving context layer that fixes this. It's not another agent framework. It's a lightweight layer that sits between your agents and your warehouse, teaching them exactly how to query your data — with feedback loops so they get better over time.
What It Does
At its core, ktx adds a context layer to any agent that needs to talk to your warehouse. You define what "good" looks like: schemas, sample queries, acceptable SQL patterns, business logic. Then, when an agent sends a query, ktx automatically feeds the right context into the prompt.
But here's the kicker — it learns from mistakes. If an agent returns a bad query or a wrong answer, you can flag it (or it can detect low confidence), and ktx adjusts the context it provides next time. Over time, your agents get better at asking the right questions.
It's built on the MCP (Model Context Protocol) standard, so it works with any MCP-compatible agent.
Why It's Cool
- Self-improving – The more you use it (or the more your agents mess up), the smarter it gets. No manual tuning.
- Lightweight – It's not a giant framework. Just a context layer that plugs into your existing agent + warehouse setup.
- MCP-native – If your agent speaks MCP, ktx speaks back. You don't need to rewrite anything.
- Real-world focus – It's designed for the messy reality of data warehouses: inconsistent naming, old schemas, business abbreviations, and all the other things that make LLMs hallucinate.
Think of it as a tutor for your agents – it explains the data model, suggests common query patterns, and gently corrects them when they go off track.
How to Try It
Clone the repo:
git clone https://github.com/Kaelio/ktx-ai-data-agents-mcp-context-skills.gitFollow the README to set up the context layer (you provide schema definitions, sample queries, and optionally a feedback endpoint).
Point your existing MCP-compatible agent at ktx instead of directly at