ontology-zh

Manages typed knowledge graphs for agent memory with entity CRUD, relations, and constraint validation.

10|10|Updated May 13, 2026
One-click install
npx skills add https://github.com/yuluyangguang1/openclaw-portable --skill ontology-zh-yuluyangguang1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ontology-zh
Source: https://github.com/yuluyangguang1/openclaw-portable/tree/main/system/skills-zh/ontology-zh
Command: npx skills add https://github.com/yuluyangguang1/openclaw-portable --skill ontology-zh-yuluyangguang1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, and includes scripts (resource) and references (resource) components.

What problem does it solve? AI agents lack structured, persistent memory: facts about people, projects, tasks, and events end up scattered across conversations with no way to query, relate, or validate them. This Skill provides a typed knowledge graph stored as an append-only JSONL file so agents can remember, link, and verify information across sessions and skills. ## Core Features & Use Cases - Typed Entity Management: Create, query, update, and delete entities such as Person, Project, Task, Event, Document, and Credential via a Python CLI. - Relations & Graph Traversal: Link entities with typed relations (has_owner, blocks, part_of) and query dependencies in outgoing, incoming, or both directions. - Schema Constraint Validation: Enforce required properties, enums, forbidden fields, cardinality, acyclic dependency checks, and Event end >= start rules defined in a YAML schema. - Cross-Skill Shared State: Other skills declare ontology read/write contracts so commitments, tasks, and actions flow between skills through one graph. - Use Case: Tell the agent "remember Alice owns the Website Redesign project" and later ask "what tasks depend on task X?" — the graph answers with validated, queryable structure. ## Quick Start Ask the agent to remember a new person named Alice and create a project owned by her, then list all people stored in the ontology.

Frequently Asked Questions about ontology-zh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a knowledge graph for agent memory?

Initialize a graph.jsonl file under memory/ontology, then use the ontology.py CLI to create typed entities like Person, Project, or Task and link them with relations. Every change is appended as an operation record, preserving full history.

How to query entities and relations in a JSONL graph?

Use the query command with a type and JSON filter, or the related command with an entity ID and relation type to traverse links. Direction flags (outgoing, incoming, both) control traversal, and the Python API supports custom multi-hop queries.

Does the ontology validate schema constraints like cardinality?

Yes, the validate command checks required and forbidden properties, enum values, relation type constraints, cardinality rules, and acyclic dependency detection against a schema.yaml file. Event end >= start is also enforced when defined.

Can multiple skills share state through one knowledge graph?

Yes, skills declare an ontology contract listing the types they read and write, plus preconditions and postconditions. For example, an email skill can create a Commitment entity that a task skill later converts into a Task.

What are the limitations of JSONL-based graph storage?

The append-only JSONL format reloads the entire graph per operation, so performance degrades on very large datasets. The documentation recommends migrating to SQLite for complex or large-scale graph workloads.