ontology

A system for defining and checking structured entities and relationships in mnemonic memories. An ontology is a description of the kinds of things a system knows about, such as components, incidents, or deployment procedures, and how they relate.

In plain words
What is it for?
Use it to define namespaces, entity types, reusable traits, and relationships, discover entities, and validate ontology files.
Why use it?
It helps memories use consistent names, types, fields, and relationships instead of storing loosely structured information.

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/modeled-information-format/mnemonic/ontology
Any agent
npx skills add modeled-information-format/mnemonic --skill ontology
Clone the repo
git clone --depth 1 https://github.com/modeled-information-format/mnemonic

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 989 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.00074 $0.00989
Opus 5 $0.00037 $0.00495
Sonnet 5 $0.00015 $0.00198
Haiku 4.5 $0.00007 $0.00099

Measured yesterday against content hash e9fd4ef781ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 5 executable files (lib/__init__.py, lib/entity_resolver.py, lib/ontology_loader.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.

skills/ontology/SKILL.md · 155 lines

How it starts

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

Memory

Search first: /mnemonic:search {relevant_keywords} Capture after: /mnemonic:capture {namespace} "{title}"

Run /mnemonic:list --namespaces to see available namespaces from loaded ontologies.

Ontology Skill

Provides custom ontology support for extending mnemonic with domain-specific knowledge structures.

Requirements

  • PyYAML - Optional but recommended for YAML parsing. The library works without it but with limited functionality.

Capabilities

  • Load and validate ontology definitions (YAML)
  • Define custom namespaces beyond the 9 base namespaces
  • Create typed entities (semantic, episodic, procedural)
  • Establish relationships between entities
  • Use traits/mixins for reusable field sets
  • Entity discovery patterns

Cognitive Memory Type Triad

All entity types inherit from one of three base memory types:

Type Purpose Examples
Semantic Facts, concepts Components, technologies, decisions
Episodic Events, experiences Incidents, debug sessions
Procedural Step-by-step processes Runbooks, deployments

Usage

ontology_validator.py

Validate ontology YAML files against the schema.

python ${SKILL_DIR}/lib/ontology_validator.py <file> [--json]
Option Description
<file> Ontology YAML file to validate (required)
--json Output validation results as JSON

ontology_registry.py

Load and query ontologies.

python ${SKILL_DIR}/lib/ontology_registry.py [OPTIONS]
Option Description
--list List all loaded ontologies
--namespaces List all available namespaces
--types List all entity types
--validate <NS> Validate a specific namespace
--json Output as JSON

entity_resolver.py

Resolve and search entity references across memories.

python ${SKILL_DIR}/lib/entity_resolver.py [OPTIONS]

Read the full file on GitHub · 155 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. yesterday First seen · 155 lines · 74 tokens per session scan A e9fd4ef781ae

Subscribe to this mod's changes

ontology is a skill published in the GitHub repository modeled-information-format/mnemonic (22 stars, last pushed 1mo ago), licensed MIT. It adds 74 tokens to every session and 989 once invoked, about $0.0004 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.