kg-traverse
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKG Traverse
知识图谱遍历(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
步骤
- Seed -- call to look up the target entity by name
mcp__claude-flow__agentdb_hierarchical-recall - Expand -- call to find all edges connected to the seed entity, then recursively expand outward to the specified depth (default: 3)
mcp__claude-flow__agentdb_causal-edge - Score -- for each path, compute relevance: using
cumulative_score = product(edge_weight * semantic_similarity(query, node))for similaritymcp__claude-flow__agentdb_semantic-route - Prune -- remove paths with cumulative score below 0.3
- Rank -- sort remaining paths by cumulative score descending
- Synthesize -- call to combine the top paths into a coherent summary
mcp__claude-flow__agentdb_context-synthesize - Report -- display the top 10 paths with: path (entity chain), relation types, cumulative score, and synthesized context
- 种子实体——调用,通过名称查找目标实体
mcp__claude-flow__agentdb_hierarchical-recall - 扩展——调用,找到与种子实体相连的所有边,然后递归向外扩展至指定深度(默认:3)
mcp__claude-flow__agentdb_causal-edge - 评分——对每条路径计算相关性:,使用
cumulative_score = product(edge_weight * semantic_similarity(query, node))计算相似度mcp__claude-flow__agentdb_semantic-route - 修剪——移除累积评分低于0.3的路径
- 排序——将剩余路径按累积评分降序排列
- 合成——调用,将排名靠前的路径整合成连贯的摘要
mcp__claude-flow__agentdb_context-synthesize - 报告——展示排名前10的路径,包含:路径(实体链)、关系类型、累积评分和合成上下文
CLI alternative
CLI替代方案
bash
npx @claude-flow/cli@latest memory search --query "relations for ENTITY_NAME" --namespace knowledge-graphbash
npx @claude-flow/cli@latest memory search --query "relations for ENTITY_NAME" --namespace knowledge-graph