kg-modality-sql

kg-modality-sql is a skill for Claude Code, Codex from Knuckles-Team/epistemic-graph. It costs 111 tokens per session (801 once invoked), scanned A, original, MIT.

A database connection layer that lets standard SQL tools and applications talk to the engine through PostgreSQL, MySQL, Microsoft SQL Server, or SQLite protocols.

In plain words
What is it for?
It helps run queries, joins, summaries, window calculations, common table expressions, data changes, table definitions, views, and database inspection from compatible SQL tools.
Why use it?
It removes the need to replace familiar database clients, reporting tools, or object-relational libraries when working with this engine.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/knuckles-team/epistemic-graph/kg-modality-sql
Any agent
npx skills add Knuckles-Team/epistemic-graph --skill kg-modality-sql
Clone the repo
git clone --depth 1 https://github.com/Knuckles-Team/epistemic-graph

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for kg-modality-sql

README.md
[![agentmods](https://agentmods.dev/badge/skills/knuckles-team/epistemic-graph/kg-modality-sql.svg)](https://agentmods.dev/skills/knuckles-team/epistemic-graph/kg-modality-sql)
Your own site
<a href="https://agentmods.dev/skills/knuckles-team/epistemic-graph/kg-modality-sql"><img src="https://agentmods.dev/badge/skills/knuckles-team/epistemic-graph/kg-modality-sql.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 801 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00111 $0.00801
Opus 5 $0.00056 $0.00400
Sonnet 5 $0.00022 $0.00160
Haiku 4.5 $0.00011 $0.00080

Measured 5d ago against content hash 8a33d1994636, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kg-modality-sql 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 5d 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.

epistemic_graph/skills/kg-modality-sql/SKILL.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

kg-modality-sql — SQL over the engine wire

The engine speaks SQL over the actual wire protocols (DataFusion-backed eg-query, wire-neutral classify → dispatch → exec core). Full SELECT (joins, aggregates, GROUP BY/HAVING, window frames, CTE, subquery, UNION), INSERT/UPDATE/DELETE (with compound WHERE, RETURNING, INSERT … SELECT, ON CONFLICT upsert), CREATE/ALTER/DROP DDL on arbitrary durable user tables, views, and SQL/plpgsql functions — plus Postgres extension drop-ins (pgvector <->/<=>, Apache AGE cypher(), TimescaleDB, ParadeDB BM25). pg_catalog/information_schema are synthesized so psql \d, ORMs and BI tools introspect. See docs/capabilities.mdSQL and Postgres wire.

The wire way (epistemic-graph owns it)

Each wire is opt-in (build with its feature + set its _ADDR env var). Postgres wire (feature pgwire, EPISTEMIC_GRAPH_PGWIRE_ADDR, default 127.0.0.1:5433):

psql "host=127.0.0.1 port=5433 user=agent dbname=__commons__"
SET graph = 'my_graph';
SELECT id, properties FROM nodes LIMIT 10;
INSERT INTO nodes (id, properties) VALUES ('n1', '{"label":"Doc"}');

Simple and extended/prepared protocol; SCRAM-SHA-256 auth (the pg user becomes the ACL actor, so RLS applies) or trust in dev. Sibling wires share the same SQL core: MySQL (mysql-wire, :3306), MSSQL/TDS (mssql-wire, :1433), SQLite NDJSON (sqlite-wire). Recipes + ports: docs/interfaces/connecting.md.

The MCP way (through graph-os)

load_tools(tools=["engine_query"])   # then run SQL through engine_query

or the REST twin graph-os exposes for the query modality.

Cross-modal seam

The nodes table is the same store the RDF, vector, and time-series modalities read, so a SQL statement can JOIN graph ⋈ vector ⋈ timeseries and commits inside the engine's unified mixed-store wire transaction (BEGIN/COMMIT/ROLLBACK, read-your-own-writes) — cross-modal ACID, not a separate SQL database.

  • kg-modality-sparql — RDF/SPARQL over the same nodes; kg-modality-consensus — the multi-Raft/tenant substrate these wires commit into.

Read the full file on GitHub · 64 lines

Changes

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.

  1. 5d ago First seen · 64 lines · 111 tokens per session scan A 8a33d1994636

Subscribe to this mod's changes

kg-modality-sql is a skill published in the GitHub repository Knuckles-Team/epistemic-graph (10 stars, last pushed 7d ago), licensed MIT. It adds 111 tokens to every session and 801 once invoked, about $0.0006 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-31.