Ontology Knowledge Graph for Openclaw

A typed vocabulary and constraint validation system for organizing AI agent knowledge as a queryable, resilient graph database.

paudyyin
v2.0.0
Jun 4, 2026
0
606
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ontology-knowledge-graph

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ontology-knowledge-graph using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Ontology Knowledge Graph?

The Ontology Knowledge Graph is a typed vocabulary and constraint verification system designed to represent structured AI agent memory as a queryable graph. Built to expand the reliability of Openclaw Skills, it provides a rigorous schema framework for defining entities like Person, Project, Task, and Event, along with their multi-directional relationships. This prevents context fragmentation and helps agents maintain a coherent understanding of work states, dependencies, and environments over long-duration interactions.

By keeping an append-only transaction ledger, the ontology system provides a historical record of state changes. It also serves as a robust foundation for multi-agent synchronization, where sharing structured data schemas makes it easy for distinct specialized agents to cooperate, pass tasks, and validate postconditions without relying on unpredictable natural language context windows.

Ontology Knowledge Graph Use Cases

  • Structured Memory Retrieval: When an agent needs to retrieve precise relationships, such as finding all task blocker dependencies under a specific active project.
  • Multi-Agent Shared Workspace State: Letting diverse agents safely read and write to a shared entity store with strict schemas to avoid overwriting each other's work.
  • Context-Rich Knowledge Graph Queries: Transitioning simple natural-language queries into explicit relationship traversals using CLI-driven path queries.
  • Safe Credential Indirection: Storing credential accounts safely by forcing indirection patterns and blocking plain text passwords via strict constraint validation.

How Ontology Knowledge Graph Works

  1. Define Schema Rules: Establish required properties, acceptable status enums, and acyclic relation guidelines in schema.yaml.
  2. Entity Instantiation: Initialize or update objects (like Tasks, Goals, or People) directly via scripts or when triggered by conversational memory extraction rules.
  3. Validation Filtering: Pass each mutation payload through a constraint validator to check for missing requirements or forbidden formats before writing.
  4. Append-Only Serialization: Write validated changes to the graph storage (graph.jsonl) using JSON Lines for historical integrity and easy SQLite migrations.
  5. Automated Sync and Fallback: Continually pull fresh updates from daily workspace notes and serve as an active backup memory layer whenever primary vector or semantic searches return zero results.

Ontology Knowledge Graph Setup

Initialize the storage directory, establish a basic schema, and perform your first entity insertion with the steps below:

# Initialize ontology storage
mkdir -p memory/ontology
touch memory/ontology/graph.jsonl

# Create schema constraints
python scripts/ontology.py schema-append --data '{
  "types": {
    "Task": { "required": ["title", "status"] },
    "Project": { "required": ["name"] },
    "Person": { "required": ["name"] }
  }
}'

# Create a verified entity
python scripts/ontology.py create --type Person --props '{"name":"Alice","email":"[email protected]"}'

# Relate entities together
python scripts/ontology.py relate --from proj_001 --rel has_task --to task_001

Ontology Knowledge Graph Data Schema & Taxonomy

Storage Layout

Default storage keeps files locally inside the workflow workspace for optimal access controls.

  • memory/ontology/graph.jsonl: The central ledger tracking all mutations (create, relate, update, etc.) in sequential order.
  • memory/ontology/schema.yaml: The active configuration dictating types, properties, enums, relationship directionality, and cardinality.

Core Entity Schemas

Entity Type Required Fields Common Optional Fields Purpose
Person name email, phone, organization Represents people/agents
Project name status, goals, owner Tracks high-level objectives
Task title, status due, priority, assignee, blockers Manages operational tasks
Credential service, secret_ref N/A (Forbidden: password, secret) Secures API references

Ontology Knowledge Graph Advanced Features

  • Backup Memory Fallback (v2.0+): Automatically steps in as a secondary query source when primary search structures fail or return low-confidence answers, safeguarding performance in Openclaw Skills.
  • Daily Note Auto-Sync: Integrates with a file parser that scans markdown workspace notes, importing entities and relationships into the graph asynchronously.
  • Acyclic Constraint Validation: Automatically blocks circular dependency creation when linking task objects, guaranteeing reliable execution plans.
  • Planning as Graph Transformation: Allows the agent to construct detailed multi-step project plans as transaction blueprints that rollback entirely if any constraint validation fails.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*