Kaelio/ktx is a context layer that helps AI agents query analytical databases using company knowledge, approved metrics, table metadata, and relationships between columns. Data teams use it to make warehouse queries more accurate and consistent with their organization's definitions. Its catalogue add-ons teach agents how to use ktx and its data-querying interfaces.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kaelio/ktx/historic_sql_table_digestnpx skills add Kaelio/ktx --skill historic_sql_table_digestgit clone --depth 1 https://github.com/Kaelio/ktxWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kaelio/ktx/historic_sql_table_digest)<a href="https://agentmods.dev/skills/kaelio/ktx/historic_sql_table_digest"><img src="https://agentmods.dev/badge/skills/kaelio/ktx/historic_sql_table_digest.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00025 | $0.00917 |
| Opus 5 | $0.00013 | $0.00458 |
| Sonnet 5 | $0.00005 | $0.00183 |
| Haiku 4.5 | $0.00003 | $0.00092 |
Grade A, and why
historic_sql_table_digest scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Historic SQL Table Digest
Use this skill when the WorkUnit raw file is one tables/<schema>.<name>.json file from the historic-sql adapter.
Required Workflow
- Read the WorkUnit notes first.
- Call
read_raw_filefor the singletables/<schema>.<name>.jsonraw file. - Read
manifest.jsononly if the table JSON omits the dialect or the WorkUnit notes are unclear. - Produce one concise usage narrative for this table from the staged table JSON.
- Call
emit_historic_sql_evidenceexactly once withkind: "table_usage". - Stop after the evidence tool succeeds.
Identifier Verification Protocol
Before writing a wiki page or SL source on any topic:
discover_data({query: "<topic>"})- see what wikis, SL sources, and raw tables already exist. Prefer updating existing pages over creating new ones.
Before emitting any schema.table or schema.table.column into a wiki body,
SL source, tables: frontmatter, sl_refs, or emit_unmapped_fallback:
entity_details({connectionId, targets: [{display: "<identifier>"}]})- confirm the identifier resolves; inspect native types, FK/PK, and sampleValues.- For literal values from the source, such as status codes or plan tiers,
check whether they appear in
entity_detailssampleValues for the relevant column. If sampleValues is short or the sample may have missed real values, run asql_executionprobe with the same warehouse connection id:sql_execution({connectionId, sql: "SELECT DISTINCT <col> FROM <ref> LIMIT 50"}). - If the candidate identifier still does not resolve, do one of:
- Use
sql_execution({connectionId, sql: "SELECT 1 FROM <ref> LIMIT 0"}). If it errors, the identifier is fictional. - Wrap the identifier in
[unverified - from <rawPath>]in the wiki body, citing the exact raw path that mentioned it. - When recording
emit_unmapped_fallbackwithno_physical_table, include the failing probe error inclarification.
- Use
- Never copy
<schema>.<table>placeholder strings from these instructions into output.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 89 lines · 25 tokens per session scan A c09aaa9de986
historic_sql_table_digest is a skill published in the GitHub repository Kaelio/ktx (1,571 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 917 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
retail-govern
Run the Seshat BI governance checker and interpret its findings. Use when someone asks to check, validate, or gate Power BI / DAX / TMDL / PBIR / SQL work in the Seshat BI repo, when seshat check reports a rule violation, or when you need to know what a rule id (D8, C2, S2, G1, …) means and where to fix it.…
source-mapping
Drive a raw retail source table through the source-mapping gate before any silver SQL exists. Use when someone asks to map, model, profile, or onboard a new bronze table toward Power BI in the Seshat BI repo -- profile the source, decide grain/PK, fill the five mapping artifacts into mappings/ /, and stop at the gate.…
pbip-xray
Audit a committed PBIP semantic model as text (unused fields, relationship risks, measure-graph findings) and explain a TMDL change in business terms for PR review. Read-only: it parses committed TMDL/PBIR and git history, opens no database, never launches Power BI, and edits nothing.
capabilities
Show the read-only capability inventory for this kit -- each capability by lifecycle state, authority, requirements and provenance. Use when someone asks what the kit can do or what works without a database. Writes nothing and emits no score.
cross-table-lineage
Trace column- and table-level lineage across bronze/silver/gold in the Seshat BI repo and report the downstream impact of a change. Read-only: it reads committed SQL and mappings, opens no database, and edits nothing.
retail-build-warehouse
Author the silver + gold migration SQL for a mapped retail table from its APPROVED source-map, then STOP before executing. Use after a table's mapping gate is CLEARED in the Seshat BI repo and someone asks to build the silver/gold SQL, write the migration, or fill the retail-orchestrate build seam. Author-and-stop: it…