/kdbx-knowledge:kxmeta-discoverfrom kdbx-knowledge
Discovers metadata on a running kdb+ process via aimeta, HTTP /meta route, kx-meta discover script, and qIPC fallback. Useful for learning exposed tables/functions and interpreting tier/response fields.
Ships in kdbx-knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
host:port and needs to know what tables/functions are exposed.kx-meta discover, curl host:port/meta, or .aimeta.get* qIPC calls.aimeta loaded (tier-1 fallback).references[] to resolve a vocabulary term (e.g. "USD") to the underlying key.For the wire model — full meta.json shape, kind vocabulary, references[] semantics, kdbType cheatsheet — see reference/agent-guide.md. This skill covers how to obtain the metadata and interpret which tier resolved.
GET /metaAlways begin with a single HTTP probe — it's cheap, requires nothing on $PATH, and tells you immediately whether the host is aimeta-enabled:
curl -s -w "\nHTTP %{http_code}\n" http://host:port/meta
200 + JSON body → tier 3. Full annotated meta.json in hand. Stop probing, start reading.404, non-JSON, or connection refused → host is not aimeta-enabled at HTTP. Fall through to kx-meta discover (below), which probes tier 2 (qIPC .aimeta.get*) and tier 1 (native tables/meta introspection)./ and /.well-known/api-catalog are useful when you want the route map (they list /meta, /openapi.json, /meta.schema.json), but they tell you the same thing /meta does — skip them unless you need the catalog explicitly.
kx-meta discoverWhen /meta is 404, use the kx-meta script. It walks Tier 3 → Tier 2 → Tier 1 and stops at the first resolution, so a single call handles every host shape:
kx-meta discover host:port # full payload + `tier` field
kx-meta discover host:port -tables # scope to tables[] only
kx-meta discover host:port -functions # scope to functions[] only
kx-meta discover host:port -tier 2 # force a specific tier; no fallthrough
The script lives at scripts/kx-meta.sh in the ai-meta source repo. If it's not on $PATH, find the repo root with git rev-parse --show-toplevel (or pwd + ls) and call it by absolute path: bash <repo>/scripts/kx-meta.sh discover host:port. Add <repo>/scripts/ to $PATH to drop the prefix.
/meta, /, /.well-known/api-catalog, /openapi.json, and /meta.schema.json all carry ETag headers and honour If-None-Match for 304. For polling agents, cache the ETag and send If-None-Match: <etag> on the next request:
curl -s -D /tmp/h http://host:port/meta -o /tmp/m; etag=$(awk 'tolower($1)=="etag:"{print $2}' /tmp/h | tr -d '\r')
curl -s -o /tmp/m2 -w "%{http_code}\n" -H "If-None-Match: ${etag}" http://host:port/meta
# 304 means nothing changed; 200 means re-parse /tmp/m2
From a q client process already connected (h: hopen ...):
h ".aimeta.getTables[]" / list[] of table dicts
h ".aimeta.getTable[`trade]" / single table dict by name
h ".aimeta.getFunctions[]" / list[] of function dicts
h ".aimeta.getFunction[`.gw.vwap]"
h ".aimeta.getReferences[]" / references[] index
h ".aimeta.getReference[`currency]"
If the host hasn't loaded aimeta (or hasn't called .aimeta.init[]), type get \.aimeta.getTables` returns -1h or similar — fall back to native introspection:
tables 0N!` / list of table names
meta `trade / column metadata for one table
\f / function names defined in the current process
That's the tier-1 surface — names + types only, no descriptions.
Every kx-meta discover response (and every tier3/tier2 shape returned by .aimeta.discover) carries a tier field. Read it first:
kx-meta discover host:port | jq .tier
tier | What's populated |
|---|---|
3 | Full annotated meta.json — desc, examples, uses, optional authorize, and references all live. |
2 | Same shape as tier 3, served over qIPC. |
1 | tables[] with names + columns only; functions[] with names + arity only; references[] empty; all desc fields empty. |
A consumer that requires desc or references[] should check tier >= 2 before relying on them. Don't assume rich metadata is present.
tier 3Even at tier 3 the host may be serving a Tier-1-synthesised document because init[]'s compile-on-boot step failed or produced no public surface. Check process.compileStatus:
compileStatus | Meaning |
|---|---|
| absent | Normal annotated output — trust the rich fields. |
"empty" | Source compiled clean but emitted nothing; tier-1 shape. |
"failed" | Compile errored; reason in process.warnings. Tier-1 shape. |
When compileStatus is set, treat desc/examples/references[] as
absent (they will be empty strings or empty arrays) regardless of the
tier field.
The meta.json shape is documented in reference/agent-guide.md. Three patterns worth lifting out:
references[]A user asks for trades in USD. The instrument.ccy column has semanticType: "currency":
instrument.ccy.semanticType → "currency".references[] where semanticType == "currency" → {table: "currency", keyColumn: "code", label: "name"}.currency where name = "US Dollar" → row with code = USD`.`USD against instrument.ccy.If tier < 2, references[] is empty — fall back to asking the user for the symbol.
foreignRef edgetrade.sym has foreignRef: "instrument.sym" — join trade to instrument on equality of sym. This is a hard edge, independent of any semanticType.
A function's uses field is its table dependency set. To answer "what schema does .gw.vwap need?", read functions[].uses and join to tables[] by name.
Before proposing or invoking a function at Tier 2 or 3, inspect its optional
authorize object. For example, {"action":"read","resource":"data.instrument"}
describes a read:data.instrument grant, while exec analytic describes the
higher-level exec:analytic capability.
This is informative metadata, not proof of authorization or enforcement. Do not infer that the caller holds the grant, and do not infer that the function checks it. Ask the policy module or gateway to enforce the grant. If the field is absent, the requirement is unknown—not unrestricted. Tier 1 cannot provide the field.
/meta; resend with If-None-Match on each tick. 304 is cheap; 200 means re-parse./meta.schema.json once; validate every /meta response against it. Refuse to interpret responses whose schemaVersion exceeds the schema's const.@uses trade where trade lives on another host means the cross-process publish graph stitches them. The function's home process may not have the table — chase the schema via the producing host.meta.json shape (kind vocabulary, type cheatsheet, references[] semantics, interpretation rules).host:port/meta.schema.json.host:port/openapi.json.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kdb+, metadata-discovery, aimeta, qipc, database-introspection
npx claudepluginhub kxsystems/kx-skills --plugin kdbx-knowledge4 skills in this plugin
/kdbxUse when working with KDB-X modules, AI libraries (vector search, HNSW, IVF, BM25, time-series similarity, anomaly detection), GPU acceleration, Parquet, kURL REST client, object storage, or the module framework. Also use when encountering module-not-found errors, vector dimension mismatches, HNSW index issues, GPU setup issues, or `nyi` errors from using `\l` instead of `use`./kdbx-db-serviceUse this skill whenever working with the KDB-X DB Service - a containerised time-series database distributed via Docker Compose. Trigger for any task involving: setting up or resetting the DB Service, ingesting data (CSV, streaming, REST, or third-party sources like OneTick), writing or optimising queries (Python client, q client, or REST/qSQL), or planning an end-to-end ingest pipeline. Also trigger for schema design questions, troubleshooting ingest jobs, or any reference to `dbservice_client`, `session.import_files`, `session.import_data`, `session.query_simple`, `session.query_sql`, `session.query_q`, `session.querySimple`, `session.querySQL`, `session.queryQ`, or the DB Service REST API on port 8080. Also trigger for: "run the FX recipe", "FX ingest recipe", "run the OneTick recipe", "run the OneTick LSE recipe", "run the OneTick LSE runbook", or any request to set up the full OneTick batch pipeline end-to-end from download through to ingest. Do NOT trigger for: KX Dashboards configuration; generic Docker Compose questions unrelated to the DB Service stack; or plain kdb+/q questions that don't reference the DB Service.
/kxmeta-authorWriting qdoc annotations for `aimeta` so the compiler publishes tables and functions correctly. Mandatory `@kind`/`@name` markers, the chained `@col` modifier form, q-language traps that silently drop items, and the recompile loop. Use when adding or editing `/ @kind ...` annotation blocks in a q codebase that loads `aimeta`, or when annotated items aren't surfacing in `meta.json`. For the wire model & tag vocabulary see ../../reference/agent-guide.md.Other plugins' skills for the same job