vector-hyperbolic — Claude Code skill: hyperbolic embeddings
Places hierarchical data in the Poincaré ball: radius from tree depth, direction from a text embedding. For dependency trees, ontologies, class hierarchies.
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a claude-codeWhat vector-hyperbolic does
The skill lays a hierarchy out in the Poincaré ball. A node's radius comes from its depth in the tree, its direction from a text embedding. Parent and child land closer than nodes in different branches, and you need fewer dimensions than a Euclidean layout would take.
It first checks for [email protected] and falls back to npm install [email protected] if the package is missing. Direction comes from npx -y [email protected] embed text "..." -o concept.vec.json. Distance goes through the MCP tool embeddings_hyperbolic distance at curvature -1, which returns success: false for a point on or outside the ball rather than a null. Placed coordinates and neighbours go into memory_store under the hyperbolic-embeddings namespace.
Here is the trap: a text embedding carries no depth. ONNX sentence vectors are unit-norm, so remapping puts every point at the same radius, tanh(0.5) = 0.4621, and the parent-child gap comes out about the same as the cross-branch gap. Set the radius yourself from depth, say r = tanh(depth * k), then measure on your own tree. There is no --model poincare flag in [email protected] even though the argument hint advertises one, so don't copy that call as-is.
What it helps with
- place a dependency tree by depth instead of text similarity
- compare geodesic distances between modules
- spot loosely coupled subtrees in the import graph
- verify that a node's radius tracks its depth, not its vector length
- keep placed coordinates and neighbours in agent memory
Example prompts for the agent
- Put the repo's module tree into the Poincaré ball: take the radius from node depth and the direction from `npx -y [email protected] embed text "module graph"`
- Compute the geodesic distance between `core` and `plugins/ruflo-ruvector` and tell me which branches they sit in
- Check on our tree that parent-child distance is clearly smaller than the distance between different branches
How to install vector-hyperbolic
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a claude-code2Manually: put the files in place
~/.claude/skills/vector-hyperbolic/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/vector-hyperbolic/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a codex2Manually: put the files in place
.agents/skills/vector-hyperbolic/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a cursor2Manually: put the files in place
.cursor/skills/vector-hyperbolic/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo vector-hyperbolic2Manually: put the files in place
.github/skills/vector-hyperbolic/SKILL.md1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a gemini-cli2Platform CLI
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-ruvector/skills/vector-hyperbolicManually: put the files in place
.devin/skills/vector-hyperbolic/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill vector-hyperbolic -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set104
The whole set →Similar
Questions about vector-hyperbolic
How do I install vector-hyperbolic in Claude Code?
Run npx skills add ruvnet/ruflo --skill vector-hyperbolic -a claude-code. The skill lands at ~/.claude/skills/vector-hyperbolic/SKILL.md with its steps and the tools it is allowed to call.
What does vector-hyperbolic do?
It places hierarchical data in the Poincaré ball, with each node's radius set by its depth and its direction taken from a text embedding. Distances are geodesic, so closeness in the tree shows up as a number.
Why does every point sit at the same radius after remapping the embedding?
ONNX vectors such as all-MiniLM-L6-v2 are unit-norm, so remapping pins each point at tanh(0.5) = 0.4621 and the depth disappears. Assign the radius from node depth, then check the distances against your own tree.
Source text
SKILL.md · MIT
--- name: vector-hyperbolic description: Place hierarchical data in the Poincare ball using depth for the radius and npx [email protected] embed text for direction (a unit-norm text embedding alone has no depth) argument-hint: "<text> [--model poincare]" allowed-tools: Bash Read mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search --- # 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 [email protected] is available**: ```bash npm ls ruvector 2>/dev/null | grep '0.3.3' || npm install [email protected] ``` 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. ```bash npx -y [email protected] 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 - [email protected] 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
© ruvnet · MIT · ruvnet/ruflo