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

vector-hyperbolic

它能做什么

这项技能把依赖树或分类体系等层级数据排列到一个能表示每个项目所处深度的空间中。适用于对具有清晰父子层级的结构进行建模的人。

适用场景

  • ✓当你的数据具有清晰的层级,例如组织结构图或模块树的时候。
  • ✓当你希望距离能反映项目在层级中的位置的时候。
  • ✓当你想检查某个层级结构是否得到了良好表示的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请把我产品目录中的分类放入一个层级空间,使父分类和子分类彼此靠近。”

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

工作原理

这项技能根据每个项目在树中的深度设定其与中心的距离,并用文本嵌入决定其方向。然后它会检查父子项目是否比不同分支中的项目更接近。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Vector Hyperbolic

Embed hierarchical data in the Poincare ball model using ruvector.

When to use

Use this skill when your data has inherent hierarchy — dependency trees, module structures, taxonomies, org charts, ontologies. Hyperbolic space captures hierarchical distances with far fewer dimensions than Euclidean embeddings.

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. Know what a text embedding can and cannot give you. ONNX sentence embeddings (all-MiniLM-L6-v2) are unit-norm. Rescaling or exp-mapping a unit vector puts every point at the same radius (the MCP embeddings_hyperbolic convert gives tanh(0.5) = 0.4621 for all of them), so the radius carries no depth and parent/child distances come out nearly the same as cross-branch distances. Projecting a text embedding does not create hierarchy.
  3. Put the hierarchy in yourself. Choose each node's radius from its depth in the tree (root near 0, leaves near 1, for example r = tanh(depth * k)), and take its direction from the text embedding, or use embeddings trained on the tree's edges. Measure on your own tree: parent-child distance should be clearly smaller than cross-branch distance.
    npx -y ruvector@0.3.3 embed text "hierarchical concept" -o concept.vec.json   # direction only
    
  4. Geodesic distance for points strictly inside the unit ball: d(u, v) = arcosh(1 + 2 * ||u-v||^2 / ((1-||u||^2)(1-||v||^2))). The MCP embeddings_hyperbolic distance computes it (curvature -1) and returns success: false for a point on or outside the ball rather than a null distance.
  5. Store results: mcp__plugin_ruflo-core_ruflo__memory_store({ key: "hyperbolic-CONCEPT", value: "COORDINATES_AND_NEIGHBORS", namespace: "hyperbolic-embeddings" })

Caveats

  • ruvector@0.3.3 has no --model poincare flag; attention hyperbolic is the Poincare-ball attention op, not a text-embedding projector.
  • "Norm encodes depth" only holds when you set the radius from depth yourself (step 3). It does not come from the embedding.
  • If you need a hyperbolic search index, store the placed coordinates in AgentDB and compute geodesic distance in your own retrieval code.

Poincare ball properties (for points you placed by depth)

Property Meaning
Norm close to 0 Root-level concept (only if you assigned radius by depth)
Norm close to 1 Leaf-level concept (same condition)
Small geodesic distance Close in the hierarchy you encoded
Large geodesic distance Distant subtrees in the hierarchy you encoded

Use cases

  • Dependency analysis: embed module imports to find tightly coupled subtrees
  • Code architecture: map class hierarchies to discover structural patterns
  • Knowledge organization: embed concepts to reveal taxonomic relationships
  • Codebase navigation: find most specific/general modules relative to a query
常见问题

仅凭文本嵌入能体现层级吗?

不能。来源说明普通文本嵌入对每个项目的长度都相同,因此深度需要由你自己加入。

我怎么知道布局是否有效?

父到子的距离应明显小于不同分支之间的距离,这项技能会对此进行测量。

它使用什么工具?

使用固定版本的 ruvector 工具计算文本方向,并使用你提供的深度来确定半径。

详情

作者的原始描述

Place hierarchical data in the Poincare ball using depth for the radius and npx ruvector@0.3.3 embed text for direction (a unit-norm text embedding alone has no depth)

repo: ruvnet/ruflo

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能