ontology — Claude Code skill: a typed knowledge graph for agent memory
This skill keeps agent memory as a typed graph of entities and relations, validating every change against type constraints. Useful when several skills need to share state.
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a claude-codeWhat ontology does
The skill models agent memory as entities with a type, properties and relations. Every mutation is checked against type constraints before it lands, so you won't end up with a task missing its status or an event ending before it starts. The vocabulary is already defined: Person, Organization, Project, Task, Goal, Event, Document, Message, Note, Account, Credential and more.
Storage defaults to memory/ontology/graph.jsonl, one operation per line. You work through scripts/ontology.py: create an entity, query by condition, fetch by id, relate two entities, validate constraints. The skill recommends describing required fields and status enums in memory/ontology/schema.yaml. For complex graphs it suggests migrating to SQLite.
Secrets stay out of the graph. The Credential type requires service and secret_ref, and properties like password or token are forbidden, so you keep an indirection instead of a plaintext secret. Python 3 is required, since every operation runs through python3 scripts/ontology.py. Multi-step plans the skill suggests modelling as a sequence of graph operations, with rollback when a constraint fails.
What it helps with
- remember a fact about a person or project and find it later
- link a task to its project and assignee
- pull every open task matching a condition
- trace dependencies and find blocking tasks
- hand shared state from one skill to another
Example prompts for the agent
- Remember that Alice owns the Website Redesign project.
- What do I know about task_001?
- Link proj_001 to p_001 with has_owner.
How to install ontology
1Skills CLI (Vercel)
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a claude-code2Manually: put the files in place
~/.claude/skills/ontology/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ontology/
1Skills CLI (Vercel)
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a codex2Manually: put the files in place
.agents/skills/ontology/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a cursor2Manually: put the files in place
.cursor/skills/ontology/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install sundial-org/awesome-openclaw-skills ontology2Manually: put the files in place
.github/skills/ontology/SKILL.md1Skills CLI (Vercel)
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a gemini-cli2Platform CLI
gemini skills install https://github.com/sundial-org/awesome-openclaw-skills --path skills/ontologyManually: put the files in place
.devin/skills/ontology/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ontology
How do I install ontology in Claude?
Run npx skills add sundial-org/awesome-openclaw-skills --skill ontology -a claude-code. The skill lands in ~/.claude/skills/ontology/SKILL.md.
What does the ontology skill do?
It keeps agent memory as a typed graph of entities and relations. Each write is validated against type constraints, and skills can read and write shared objects.
Where is the graph stored?
By default in memory/ontology/graph.jsonl, one operation per line. Type constraints go in memory/ontology/schema.yaml, and the skill suggests SQLite for complex graphs.