vector-cluster

Cluster code files by graph community detection using ruvector spectral and Louvain algorithms.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires [email protected].

What problem does it solve?

Grouping large collections of code files or embeddings by semantic similarity is difficult to do manually. This Skill runs graph community detection over a code graph so you can discover natural groupings, identify outliers, and organize vector namespaces without writing clustering code yourself.

Core Features & Use Cases

  • Graph-based clustering: Runs npx [email protected] hooks graph-cluster with spectral or Louvain community detection over code files.
  • Graph min-cut analysis: Supports hooks graph-mincut for partitioning code graphs into cohesive segments.
  • Result persistence: Stores cluster assignments in ruflo memory under the vector-clusters namespace for later retrieval.
  • Use Case: Given a repository of source files, run graph clustering to reveal which files form tight semantic communities, then store the assignments to memory so agents can route related work to the same context.

Quick Start

Ask the agent to cluster the files in your project with ruvector graph-cluster and store the resulting community assignments in memory.

Frequently Asked Questions about vector-cluster

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

FAQPage Schema
How do I cluster code files by semantic similarity with ruvector?

Run `npx -y [email protected] hooks graph-cluster <files...>` to perform spectral or Louvain community detection over a code graph. The output is JSON containing cluster assignments, community labels, and edges.

What clustering algorithms does ruvector graph-cluster support?

[email protected] supports spectral and Louvain community detection through the `hooks graph-cluster` command, plus `hooks graph-mincut` for graph partitioning. The top-level `cluster` command is reserved for distributed cluster operations.

Does ruvector support k-means clustering with --k and --namespace flags?

No. In [email protected], `cluster --namespace ... --k N` and `cluster --density` are not valid; those flags fall through to the distributed-cluster command. For namespaced k-means, run k-means in your own code against vectors stored in AgentDB.

Why does ruvector graph-cluster fail with 'graph.nodes is not iterable'?

This error means the graph state has not been initialized. Run `hooks init` first to seed the graph state, then rerun `hooks graph-cluster` on your files.

How do I interpret cluster cohesion scores?

Cohesion above 0.85 indicates a tight, well-defined cluster; 0.6 to 0.85 means related but diverse content; below 0.6 is a loose grouping where higher resolution may help. Outliers often represent novel or anomalous files worth investigating.