跳到正文
Skillpedia
分析与电子表格81k · #1685

vector-cluster

它能做什么

这项技能使用基于图的方法,按相关程度对集合中的项目进行分组。适用于整理大量代码或笔记、并希望看到自然分组的人。

适用场景

  • ✓当你想在大量笔记或代码中发现主题的时候。
  • ✓当你想找出不属于任何组的离群项的时候。
  • ✓当你想把一个大型集合整理成多个聚类的时候。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ruvector/skills/vector-cluster/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ruvector/skills/vector-cluster/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请根据我项目中模块之间的紧密程度对它们分组,并展示各个聚类。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能会安装固定版本的 ruvector 工具,对你指定的文件运行图聚类命令,并检查聚类分配结果。它会为每个聚类的内聚度评分,并保存结果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Vector Cluster

Cluster vectors in a namespace by semantic similarity using ruvector.

When to use

Use this skill when you have a collection of embeddings and want to discover natural groupings. Clustering reveals themes, identifies outliers, and helps organize large vector collections.

Steps

  1. Ensure ruvector@0.3.3 is available:
    npm ls ruvector 2>/dev/null | grep '0.3.3' || npm install ruvector@0.3.3
    
  2. Run clustering — in ruvector@0.3.3 the only working clustering is via hooks graph-cluster (spectral/Louvain over a code graph). The top-level cluster command is reserved for distributed cluster ops and is currently "Coming Soon" upstream.
    npx -y ruvector@0.3.3 hooks graph-cluster <files...>
    npx -y ruvector@0.3.3 hooks graph-mincut <files...>
    
  3. Review output — JSON with cluster assignments, community labels, and edges. If you see "graph.nodes is not iterable", run hooks init first to seed the graph state.
  4. Store results: mcp__plugin_ruflo-core_ruflo__memory_store({ key: "clusters-PROJECT-TIMESTAMP", value: "CLUSTER_ASSIGNMENTS", namespace: "vector-clusters" })

Interpreting results

  • High cohesion (>0.85): tight, well-defined cluster
  • Medium cohesion (0.6-0.85): related but diverse content
  • Low cohesion (<0.6): loose grouping, try higher resolution
  • Outliers: novel or anomalous files worth investigating

Caveats

  • cluster --namespace ... --k N and cluster --density are not valid in ruvector@0.3.3 — those flags fall through to the distributed-cluster command, which only accepts --status, --join, --leave, --nodes, --leader, --info.
  • For namespaced k-means over arbitrary embeddings, run k-means in your own code against vectors stored in AgentDB.
常见问题

内聚度是什么意思?

它是一个分数,表示聚类中的项目结合得有多紧密。来源给出的范围是:高于 0.85 表示紧密,低于 0.6 表示松散。

如果输出出错怎么办?

来源建议先运行 hooks init 命令,以设置图状态。

它能对我提供的任意向量进行聚类吗?

这项技能说明,可用的聚类方式是图聚类命令。

详情

作者的原始描述

Cluster code by graph community detection via npx ruvector@0.3.3 hooks graph-cluster (spectral / Louvain)

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1685
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能