---
name: kg-traverse-52a1510e366b
description: Pathfinder traversal of the knowledge graph starting from a seed entity
argument-hint: "<entity> [--depth N]"
allowed-tools: mcp__claude-flow__agentdb_hierarchical-recall mcp__claude-flow__agentdb_causal-edge mcp__claude-flow__agentdb_pattern-search mcp__claude-flow__agentdb_context-synthesize Bash
---

# KG Traverse

Perform pathfinder graph traversal starting from a seed entity. Expands outward through causal edges, scores paths by relevance, and prunes low-similarity branches.

## When to use

When you need to explore the knowledge graph starting from a specific entity -- finding what depends on it, what it depends on, or discovering indirect relationships. Useful for impact analysis, dependency chains, and understanding code structure.

## Steps

1. **Seed** -- call `mcp__claude-flow__agentdb_hierarchical-recall` to look up the target entity by name
2. **Expand** -- call `mcp__claude-flow__agentdb_causal-edge` to find all edges connected to the seed entity, then recursively expand outward to the specified depth (default: 3)
3. **Score** -- for each path, compute relevance: `cumulative_score = product(edge_weight * keyword_similarity(query, node))` using `mcp__claude-flow__agentdb_pattern-search` (the `semanticRouter` controller is `enabled: false` in current AgentDB builds; pattern-search is the available substitute and works fine for entity-name + relation-type keyword matches — see ruvnet/ruflo#2049). For higher-fidelity semantic similarity, callers can fall back to `mcp__claude-flow__embeddings_generate` + manual cosine, but that's not required for step 3 to function.
4. **Prune** -- remove paths with cumulative score below 0.3
5. **Rank** -- sort remaining paths by cumulative score descending
6. **Synthesize** -- call `mcp__claude-flow__agentdb_context-synthesize` to combine the top paths into a coherent summary
7. **Report** -- display the top 10 paths with: path (entity chain), relation types, cumulative score, and synthesized context

## CLI alternative

```bash
npx @claude-flow/cli@latest memory search --query "relations for ENTITY_NAME" --namespace knowledge-graph
```


---
Source attribution: digitalcrest01
Original project: https://github.com/digitalcrest01/ruflow/blob/8f78f238e1775aedf7faa6026b5f20c9aa8cbd12/plugins/ruflo-knowledge-graph/skills/kg-traverse/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2024-2026 ruvnet

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: digitalcrest01
Original project: https://github.com/digitalcrest01/ruflow/blob/8f78f238e1775aedf7faa6026b5f20c9aa8cbd12/plugins/ruflo-knowledge-graph/skills/kg-traverse/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics
Roles: Data Analyst, Data Scientist, Market Research Analyst
Specialties: API
Tools: Mcp__Claude Flow__Agentdb_Causal Edge, Mcp__Claude Flow__Agentdb_Context Synthesize, Mcp__Claude Flow__Agentdb_Hierarchical Recall, Mcp__Claude Flow__Agentdb_Pattern Search
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 2f657c922da9b18afc21677cc7a273163823fb0340cf8b6ce1fa43f135e05ff1
