rai-ontology

rai-ontology is a skill for Claude Code from RelationalAI/rai-agent-skills. It costs 99 tokens per session (12,397 once invoked), scanned A, original, Apache-2.0.

A skill for building an ontology, a structured map of concepts, properties, identities, and relationships in data, for RelationalAI. It can start from Snowflake tables or local CSV files.

In plain words
What is it for?
Starting or evolving RelationalAI models, mapping data, designing relationships and subtypes, enriching an existing model, and reviewing modeling gaps.
Why use it?
It helps turn raw data into a model that can answer domain questions and exposes whether problems come from the model or the source data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rai plugin — 12 skills shipped together

Good fit Starting or evolving RelationalAI models, mapping data, designing relationships and subtypes, enriching an existing model, and reviewing modeling gaps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/relationalai/rai-agent-skills/rai-ontology
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.

Any agent
npx skills add RelationalAI/rai-agent-skills --skill rai-ontology
Clone the repo
git clone --depth 1 https://github.com/RelationalAI/rai-agent-skills

Made for: Claude Code.

Or install rai, the plugin that ships this one along with the rest of its 12 skills.

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 rai-ontology

README.md
[![agentmods](https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-ontology/github.svg)](https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-ontology)
Your own site
<a href="https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-ontology"><img src="https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-ontology/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rai-ontology

Your own site · 80×15
<a href="https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-ontology"><img src="https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-ontology.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00099 $0.12397
Opus 5.5 $0.00040 $0.04959
Sonnet 5.5 $0.00020 $0.02479
Haiku 4.5 $0.00010 $0.01240

Measured 17d ago against content hash 3070823ebe8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rai-ontology 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 17d ago.

The scan reads SKILL.md. This mod also ships 10 executable files (examples/auxiliary_schema_enrichment.py, examples/cross_product_decision_concept.py, examples/derived_concept_bridge_entity.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/rai/skills/rai-ontology/SKILL.md · 565 lines

How it starts

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

Ontology

Summary

What: Building a working RAI ontology from raw data, and the design decisions that shape it — concepts, relationships, properties, identity, data mapping, layering, and enrichment.

When to use:

  • Starting a new RAI project from Snowflake tables or local CSV files (the Greenfield Build Workflow)
  • Enriching an existing model — adding properties, relationships, or subtypes to a model that already loads and queries
  • Reviewing or evolving a model — assessing gaps (READY / MODEL_GAP / DATA_GAP), examining inventories, applying advanced patterns
  • Any concept / relationship / property design decision, including cross-product decision concepts for optimization

When NOT to use:

  • PyRel authoring of any kind — syntax, data loading, queries, derived-property rules — see rai-pyrel
  • Optimization formulation (variables, constraints, objectives) — see rai-prescriptive-problem

Overview: Scope the questions → dump the source schema with rai explore schema → identify concepts with identities → identify relationships and properties → validate the design against the schema → generate code → validate with queries. The Design Principles sections are the authority the workflow steps apply; enrichment and gap classification extend an already-working model.


Quick Reference

Decision Choose Pattern
Has own PK / identity? Concept model.Concept("Name", identify_by={"id": Type})
Fact/event table, no PK at all? Concept keyed by row model.Concept("Sale", identify_by={"row": src}) — never a compound of data columns
Scalar value on entity? Property model.Property(f"{Concept} has {Type:name}")
Categorical value (status, type, brand) shared across tables, grouped or filtered on, or with attributes of its own? Enumeration concept keyed by the value model.Concept("Status", identify_by={"code": String}) — see Categorical values
Code column + description column for the same thing? Enumeration concept keyed by the code Description is a property of it — never map only the description
Functional FK (each A → one B)? Property model.Property(f"{Order} placed by {Customer:customer}")
Many-to-many link? Relationship model.Relationship(f"{A} links to {B}")
Boolean flag? Unary Relationship model.Relationship(f"{Concept} is active")
Fundamental category of a concept? Subtype model.Concept("Supplier", extends=[Business])
Recurring .where() filter? Subtype model.Concept("Sub", extends=[Parent])
Many-to-many with data? Junction concept Concept with compound identity (yours to establish — pk_candidates is single-column only)

Read the full file on GitHub · 565 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. 17d ago Changed 3070823ebe8a
  2. 1mo ago Changed · +24 lines 7daf1f0a8fa4
  3. 1mo ago Changed · +69 lines bef6a7998f16
  4. 3mo ago First seen · 472 lines · 99 tokens per session scan A 52a3053c4652

Subscribe to this mod's changes

rai-ontology is a skill published in the GitHub repository RelationalAI/rai-agent-skills (5 stars, last pushed 18d ago), licensed Apache-2.0. It adds 99 tokens to every session and 12,397 once invoked, about $0.0004 per session on Opus 5.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.

Related

rai-ontology compared with skills from other repositories

rai-ontology next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rai-ontologyRelationalAI/rai-agent-skillsSkill518d agoApache-2.0A99Claude Code
embeddingsruvnet/rufloSkill83kyesterdayMITA62Claude Code
rag-pineconedavila7/claude-code-templatesSkill35kyesterdayMITA65Claude Code, Codex
ingesting-into-data-lakeaws/agent-toolkit-for-awsSkill3.8ktodayApache-2.0A228Claude Code
graphjin-envdosco/graphjinSkill3.2k7d agoApache-2.0A61Claude Code, Codex
similarity-search-patternsforyourhealth111-pixel/Vibe-SkillsSkill3.9k26d agoApache-2.0A30Claude Code, Codex
qdrant-search-quality-diagnosistruera/trulensSkill3.7kyesterdayMITA104Claude Code, Codex