Knowledge Graph for Openclaw

Maintain a deterministic, file-based knowledge graph by adding, superseding, and summarizing atomic facts for entities.

safatinaztepe
v1.0.0
Feb 7, 2026
5
7.4k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install 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 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 Knowledge Graph?

The Knowledge Graph skill provides a structured way to maintain a compounding repository of facts and entity summaries within a file-based architecture. Instead of relying on manual JSON edits which are prone to error, this skill utilizes a specialized Python script to manage data integrity under the life/areas directory. By leveraging this tool within the Openclaw Skills framework, developers can ensure their AI agents have access to a consistent and growing body of knowledge that persists across sessions.

It focuses on maintaining atomic facts while preserving history. Every piece of information is treated as a discrete item with a unique ID, allowing for clear provenance and the ability to supersede outdated information without losing historical context. This makes it an essential utility for anyone building sophisticated agents using Openclaw Skills.

Knowledge Graph Use Cases

  • Recording new observations about people, projects, or entities during AI interactions.
  • Updating status information or evolving facts without deleting historical data.
  • Generating human-readable Markdown summaries from raw JSON fact data.
  • Maintaining a structured Personal Knowledge Management (PKM) system for automated agents.
  • Ensuring ID consistency across a large, file-based knowledge repository within Openclaw Skills.

How Knowledge Graph Works

  1. The agent identifies a new fact or an update to an existing entity.
  2. The Python script is called with specific flags to add a new fact or supersede an old one.
  3. The system assigns a unique, auto-incrementing ID to the fact based on the entity slug.
  4. Information is stored in an items.json file within the specific entity's directory path.
  5. The summarize command is triggered to refresh the summary.md file based on the current active facts.
  6. The updated knowledge becomes available for the agent to reference in future tasks using Openclaw Skills.

Knowledge Graph Setup

To begin using this skill, ensure you have the necessary scripts within your local repository. The primary interface is the kg.py script located in the skills directory.

Add a new fact:

python3 skills/knowledge-graph/scripts/kg.py add \
  --entity <kind>/<slug> \
  --category <category> \
  --fact "<your-fact-here>" \
  --source <source>

Supersede an existing fact:

python3 skills/knowledge-graph/scripts/kg.py supersede \
  --entity <kind>/<slug> \
  --old <old-id> \
  --category <category> \
  --fact "<new-fact-content>"

Refresh the summary:

python3 skills/knowledge-graph/scripts/kg.py summarize --entity <kind>/<slug>

Knowledge Graph Data Schema & Taxonomy

Data is organized hierarchically within the file system to ensure compatibility with standard Openclaw Skills workflows.

File Description Format
life/areas/<kind>/<slug>/ The root directory for a specific entity. Directory
items.json A collection of atomic facts including IDs, timestamps, and status. JSON Array
summary.md A generated overview of the entity based on non-superseded facts. Markdown

Knowledge Graph Advanced Features

  • Deterministic ID generation using the <slug>-00n format to prevent collisions.
  • Non-destructive updates where old facts are marked as superseded rather than deleted, preserving data lineage.
  • Metadata tracking including source attribution and categorical tagging for every fact within Openclaw Skills.
  • Automatic Markdown generation to bridge the gap between machine-readable JSON and human-readable documentation.
  • Support for custom entity kinds and slugs to organize diverse datasets logically.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*