kg-traverse

Traverses a knowledge graph from a seed entity, scoring and ranking causal paths.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill kg-traverse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kg-traverse
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-knowledge-graph/skills/kg-traverse
Command: npx skills add https://github.com/ruvnet/claude-flow --skill kg-traverse

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Exploring how entities in a knowledge graph relate to each other—dependencies, impact chains, and indirect relationships—requires manual multi-hop queries that are slow and error-prone. This Skill automates pathfinder-style traversal from a seed entity, scoring and pruning paths so you get the most relevant connections.

Core Features & Use Cases

  • Seed-based traversal: Looks up a target entity and recursively expands outward through causal edges to a configurable depth (default 3).
  • Relevance scoring and pruning: Computes cumulative path scores from edge weights and keyword similarity, prunes paths below 0.3, and ranks the remainder.
  • Synthesized reporting: Combines the top paths into a coherent summary and reports the top 10 paths with entity chains, relation types, and scores.
  • Use Case: Before refactoring a core module, traverse the knowledge graph from that module's entity to discover every dependent component and indirect relationship that could be impacted.

Quick Start

Ask the AI to traverse the knowledge graph starting from a specific entity name, optionally specifying a traversal depth, to see its ranked dependency and relationship paths.

Frequently Asked Questions about kg-traverse

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

FAQPage Schema
How do I traverse a knowledge graph from a specific entity?

Provide the entity name as the seed, optionally with a depth flag. The skill looks up the entity, expands outward through causal edges up to the specified depth (default 3), then scores, prunes, and ranks the resulting paths.

How are knowledge graph paths scored and ranked?

Each path's cumulative score is the product of edge weights and keyword similarity between the query and each node. Paths scoring below 0.3 are pruned, and the remaining paths are sorted by cumulative score in descending order.

Can I use this for impact analysis before refactoring code?

Yes. Traversing from a module's entity reveals what depends on it and what it depends on, including indirect relationships. The top 10 ranked paths with relation types give a clear picture of potential impact.

What if semantic similarity search is not available in AgentDB?

The semanticRouter controller is disabled in current AgentDB builds, so the skill uses pattern-search for entity-name and relation-type keyword matching. For higher-fidelity similarity, callers can fall back to embeddings generation with manual cosine comparison.

Is there a CLI alternative to the knowledge graph traversal skill?

Yes. You can run npx @claude-flow/cli@latest memory search with a query like 'relations for ENTITY_NAME' against the knowledge-graph namespace for a simpler lookup without full path scoring.