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 skills add RelationalAI/rai-agent-skills --skill rai-ontologygit clone --depth 1 https://github.com/RelationalAI/rai-agent-skillsWrote 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/relationalai/rai-agent-skills/rai-ontology)<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.
<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>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.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 |
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.
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 — 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) |
What ships with it
19 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/auxiliary_schema_enrichment.py 2.2 KB runs code
- examples/cross_product_decision_concept.py 6.1 KB runs code
- examples/derived_concept_bridge_entity.py 5.1 KB runs code
- examples/geographic_hierarchy_compound_key.py 5.3 KB runs code
- examples/large_scale_bidirectional.py 8.4 KB runs code
- examples/multi_level_hierarchy_segmentation.py 4.5 KB runs code
- examples/multi_schema_cross_system.py 11 KB runs code
- examples/pairwise_property_ref.py 7.4 KB runs code
- examples/self_referential_bom.py 5.0 KB runs code
- examples/value_type_fk_resolution.py 4.6 KB runs code
- references/advanced-modeling.md 15 KB
- references/build-examples.md 42 KB
- references/categorization-and-advanced.md 22 KB
- references/constraint-patterns.md 23 KB
- references/discovery-queries.md 2.8 KB
- references/enrichment-patterns.md 15 KB
- references/examination-guidance.md 2.2 KB
- references/fact-decomposition-and-validation.md 13 KB
- references/schema-json.md 14 KB
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.
- 17d ago Changed 3070823ebe8a
- 1mo ago Changed · +24 lines 7daf1f0a8fa4
- 1mo ago Changed · +69 lines bef6a7998f16
- 3mo ago First seen · 472 lines · 99 tokens per session scan A 52a3053c4652
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.
rai-ontology compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rai-ontologyRelationalAI/rai-agent-skills | Skill | 5 | 18d ago | Apache-2.0 | A | 99 | Claude Code |
| embeddingsruvnet/ruflo | Skill | 83k | yesterday | MIT | A | 62 | Claude Code |
| rag-pineconedavila7/claude-code-templates | Skill | 35k | yesterday | MIT | A | 65 | Claude Code, Codex |
| ingesting-into-data-lakeaws/agent-toolkit-for-aws | Skill | 3.8k | today | Apache-2.0 | A | 228 | Claude Code |
| graphjin-envdosco/graphjin | Skill | 3.2k | 7d ago | Apache-2.0 | A | 61 | Claude Code, Codex |
| similarity-search-patternsforyourhealth111-pixel/Vibe-Skills | Skill | 3.9k | 26d ago | Apache-2.0 | A | 30 | Claude Code, Codex |
| qdrant-search-quality-diagnosistruera/trulens | Skill | 3.7k | yesterday | MIT | A | 104 | Claude Code, Codex |