vector-hyperbolic
它能做什么
这项技能把依赖树或分类体系等层级数据排列到一个能表示每个项目所处深度的空间中。适用于对具有清晰父子层级的结构进行建模的人。
适用场景
- ✓当你的数据具有清晰的层级,例如组织结构图或模块树的时候。
- ✓当你希望距离能反映项目在层级中的位置的时候。
- ✓当你想检查某个层级结构是否得到了良好表示的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ruvector/skills/vector-hyperbolic/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
- Ensure ruvector@0.3.3 is available:
npm ls ruvector 2>/dev/null | grep '0.3.3' || npm install ruvector@0.3.3 - 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 convertgives 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. - 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 - 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 MCPembeddings_hyperbolic distancecomputes it (curvature -1) and returnssuccess: falsefor a point on or outside the ball rather than a null distance. - 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 poincareflag;attention hyperbolicis 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
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。