Knowledge Graph for Agents for Openclaw

An advanced skill for adding a structured knowledge graph layer to AI agents, enabling complex relationship traversal and multi-hop data retrieval.

vnesin-sarai
v1.0.0
Apr 13, 2026
1
912
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install knowledge-graph-agents

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-agents 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 for Agents?

While vector search is excellent at finding similar text chunks, it often fails at answering relationship-heavy questions like "Who works with Alice?" or "What systems depend on this database?" This skill provides a comprehensive framework for implementing Openclaw Skills that bridge this gap. By adding a graph-based memory layer, agents can traverse connections between entities such as people, organizations, and projects.

This implementation focuses on capturing entity relationships during the ingestion phase and utilizing spreading activation algorithms to discover multi-hop connections. Whether you are building a corporate internal tool or a complex research assistant, these Openclaw Skills allow your agent to move beyond flat keyword matching into the realm of structured reasoning and contextual discovery.

Knowledge Graph for Agents Use Cases

  • Mapping organizational hierarchies to answer "who reports to whom" or team collaboration queries.
  • Identifying technical dependencies between microservices, servers, and software libraries.
  • Discovering hidden relationships in research papers or legal documents through entity co-occurrence.
  • Enhancing agent memory by strengthening connections between frequently accessed data points.

How Knowledge Graph for Agents Works

  1. Entity Extraction: During data ingestion, the skill identifies key entities like names, organizations, and email addresses using heuristic patterns or NLP models.
  2. Graph Storage: Extracted entities are stored as nodes in a graph database (SQLite for local use or Neo4j for production scaling).
  3. Edge Creation: The system automatically creates CO_OCCURS edges between entities found within the same context or text chunk.
  4. Spreading Activation: When a query is received, the agent performs a 2-hop traversal to find not just the primary entity, but all secondary connections.
  5. Hybrid Fusion: The graph-discovered insights are fused with standard BM25 and vector search results to provide a comprehensive, ranked answer.

Knowledge Graph for Agents Setup

To begin using these Openclaw Skills, you can choose between a lightweight SQLite setup or a full Neo4j deployment.

For a local SQLite graph, initialize your tables with the following schema:

# Example SQL for node and edge creation
CREATE TABLE nodes (id INTEGER PRIMARY KEY, name TEXT UNIQUE, label TEXT, properties_json TEXT);
CREATE TABLE edges (source_id INTEGER, target_id INTEGER, rel_type TEXT, weight REAL);

If you prefer Neo4j for production workloads, ensure you have the driver installed:

pip install neo4j

Knowledge Graph for Agents Data Schema & Taxonomy

The skill organizes data into a node-edge taxonomy to facilitate relationship traversal:

Label Examples Use Case
Person Team members, contacts Addressing "Who" questions
Organisation Companies, departments Affiliation and hierarchy queries
Project Repositories, initiatives Connection and dependency mapping
System Services, tools Infrastructure and architecture queries
Place Offices, data centers Location-based queries

Relationships are stored with weights (defaulting to 1.0) and can be strengthened over time through access patterns.

Knowledge Graph for Agents Advanced Features

  • Hebbian Strengthening: Dynamically increases the weight of edges between entities that are frequently accessed together in the same query context.
  • Multi-Hop Traversal: Supports 2-hop spreading activation queries to find indirect relationships that flat search would miss.
  • Entity Merging: Built-in logic to resolve ambiguities, such as merging "Alice" and "Alice Smith" into a single node.
  • Temporal Relationships: Supports adding timestamps to edges to track when relationships (like "WORKS_ON") were active.
  • Hybrid Search Integration: Seamlessly boosts the relevance of text chunks that contain graph-discovered entities.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*