用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cvsz/zeaz-platform --skill zai-vector命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Master skill combining related sub-skills
Provides foundational definitions for the ZAI Agents Pack, encompassing the Omega Master Agent Matrix and associated lifecycle setups.
Comprehensive guide to Artificial Intelligence basics, including LLMs, Machine Learning, and Generative AI principles.
基于 SOC 职业分类
| name | zai-vector |
| description | Master skill combining related sub-skills |
When implementing tasks on the zeaz-platform repository, you MUST strictly enforce these architecture and workflow rules:
apps/ directory. Do not create top-level directories for apps. When refactoring or adding features, always scope your work to the specific apps/<app-name>/ folder..env files. Consolidate environment variables into a central .env.example inside the respective app folder. Canonical Cloudflare variables (e.g. CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID) MUST be used instead of legacy CF_ variants.git commit or git push directly. ALWAYS stage your intended files with git add and commit using make gpg-finalize COMMIT_MSG="..." from the repository root to ensure all GitOps and DevSecOps checks pass.test-secret-value-value-value, test-secret-value-value-value, test-secret-value-value-value are FORBIDDEN.Cluster vectors in a namespace by semantic similarity using ruvector.
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.
npm ls ruvector 2>/dev/null | grep '0.2.25' || npm install ruvector@0.2.25
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.2.25 hooks graph-cluster <files...>
npx -y ruvector@0.2.25 hooks graph-mincut <files...>
"graph.nodes is not iterable", run hooks init first to seed the graph state.mcp__claude-flow__memory_store({ key: "clusters-PROJECT-TIMESTAMP", value: "CLUSTER_ASSIGNMENTS", namespace: "vector-clusters" })cluster --namespace ... --k N and cluster --density are not valid in ruvector@0.2.25 — those flags fall through to the distributed-cluster command, which only accepts --status, --join, --leave, --nodes, --leader, --info.Generate and store vector embeddings using the ruvector npm package.
Use this skill to embed text, code, or documents into 384-dimensional vectors for semantic search, similarity comparison, or clustering. ruvector uses ONNX all-MiniLM-L6-v2 with HNSW indexing (52,000+ inserts/sec, ~0.045ms search).
npm ls ruvector 2>/dev/null | grep '0.2.25' || npm install ruvector@0.2.25
If embed text later reports ONNX WASM files not bundled, also run:
npm install ruvector-onnx-embeddings-wasm
text subcommand, with text as a positional arg):
npx -y ruvector@0.2.25 embed text "your text here"npx -y ruvector@0.2.25 embed text "your text here" -o vec.json--batch/--glob flags.npx -y ruvector@0.2.25 embed text "..." --adaptive --domain codemcp__claude-flow__memory_store({ key: "embed-SOURCE", value: "VECTOR_METADATA", namespace: "vector-patterns" })Register the MCP server once with the pinned version:
claude mcp add ruvector -- npx -y ruvector@0.2.25 mcp start
Then call MCP tools directly: hooks_rag_context (semantic context), brain_search (collective brain), hooks_ast_analyze, hooks_route.
embed --batch --glob and embed --file flags do not exist in ruvector@0.2.25; only embed text <text> is supported. Read files yourself and call embed text per file.ruvector-onnx-embeddings-wasm or run npx -y ruvector@0.2.25 doctor to diagnose.Embed hierarchical data in the Poincare ball model using ruvector.
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.
npm ls ruvector 2>/dev/null | grep '0.2.25' || npm install ruvector@0.2.25
--model poincare flag on embed text):
npx -y ruvector@0.2.25 embed text "hierarchical concept" -o concept.vec.json
npx -y ruvector@0.2.25 embed neural --help
For an ad-hoc projection, normalize the 384-dim vector to live inside the unit ball (x_i / (||x|| * (1 + epsilon))) and persist the projected coordinates alongside the original embedding.d(u, v) = arcosh(1 + 2 * ||u-v||^2 / ((1-||u||^2)(1-||v||^2)))
Distance grows logarithmically with tree depth, preserving hierarchy.mcp__claude-flow__memory_store({ key: "hyperbolic-CONCEPT", value: "COORDINATES_AND_NEIGHBORS", namespace: "hyperbolic-embeddings" })| Property | Meaning |
|---|---|
| Norm close to 0 | Generic, root-level concept |
| Norm close to 1 | Specific, leaf-level concept |
| Small geodesic distance | Closely related in hierarchy |
| Large geodesic distance | Distant or different subtrees |
Two distinct vector-search paths live in this plugin. Pick the right one — they're not interchangeable.
| Path | Tool family | Backing | Capacity | Latency |
|---|---|---|---|---|
| Large-scale corpus | embeddings_* | @claude-flow/memory HNSW (Rust/Native) | up to millions of vectors | 150×–12,500× faster than brute-force, depending on N and parameters |
| Hot-path router | ruvllm_hnsw_* | WASM-backed router (v2.0.1) | ~11 patterns max (ruvllm-tools.ts:58) | sub-ms; designed for high-priority routing, not corpus search |
The "12,500×" headline applies to the large-scale embeddings_search path. The WASM router is not that path.
| Need | Path |
|---|---|
| Search a corpus of N ≥ 500 documents | embeddings_search |
| Memory-constrained corpus (≥5,000 vectors) | RaBitQ quantized — see "Quantized search" below |
| Compare two strings | embeddings_compare |
| Hierarchical / taxonomic data | embeddings_hyperbolic (Poincare ball) |
| Route a query to one of ≤11 hot patterns | ruvllm_hnsw_route |
| Cross-namespace search | memory_search_unified |
mcp__claude-flow__embeddings_status to verify the embedding engine.mcp__claude-flow__embeddings_init if not active.mcp__claude-flow__embeddings_generate for text input.mcp__claude-flow__embeddings_search with the query.mcp__claude-flow__embeddings_compare to measure similarity.mcp__claude-flow__memory_search_unified for cross-namespace.For corpora ≥5,000 vectors and/or memory-constrained environments, use the RaBitQ 1-bit quantization workflow. Below 5,000 vectors the rebuild cost outweighs the savings — use the standard path instead.
| Step | Tool | Purpose |
|---|---|---|
| 1 | embeddings_init | Engine warm |
| 2 | embeddings_rabitq_build | One-time build of the 1-bit index after corpus is loaded |
| 3 | embeddings_rabitq_search | Hamming-prefilter returns top-N candidate IDs (cheap) |
| 4 | embeddings_search | Optional exact rerank on the candidate set (full-precision) |
| 5 | embeddings_rabitq_status | Index health, memory footprint, build time |
Note:
embeddings_rabitq_searchreturns candidate IDs only — the rerank in step 4 is the user's responsibility (mirrors the docstring atembeddings-tools.ts:911). Without rerank, results are approximate; with rerank, you get full-precision quality at 32× lower memory.
HNSW exposes three knobs that trade recall against latency. The "12,500×" headline assumes defaults; tune deliberately for your workload:
| Profile | efSearch | M | When to use |
|---|---|---|---|
recall-first | 200 | 32 | Pattern recall during planning; quality matters more than ms |
balanced (default) | 64 | 16 | General-purpose semantic recall |
latency-first | 16 | 8 | Hot-path routing where p99 latency matters |
efSearch is passed via ruvllm_hnsw_create (ruvllm-tools.ts:64). M is registry-level today; raise as a follow-up if it should be MCP-tunable. efConstruction defaults to 200 in the lite index (hnsw-index.ts:537).
For routing a small number of high-priority patterns:
mcp__claude-flow__ruvllm_hnsw_create — create the WASM index (cap ~11)mcp__claude-flow__ruvllm_hnsw_add — add a patternmcp__claude-flow__ruvllm_hnsw_route — route an incoming queryThis is not a corpus index. Treat it as a fast classifier over a curated set of patterns.
For hierarchical data (code trees, org charts), use mcp__claude-flow__embeddings_hyperbolic which maps to Poincare ball space. Distance is geodesic, not cosine.
npx @claude-flow/cli@latest embeddings search --query "authentication patterns"
npx @claude-flow/cli@latest embeddings init
npx @claude-flow/cli@latest memory search --query "your query"
| Method | Speed |
|---|---|
| Brute-force scan | Baseline |
| HNSW (n=500, balanced) | ~150× faster |
| HNSW (n=10,000, balanced) | ~12,500× faster |
| RaBitQ + rerank (n=10,000) | ~12,500× search speed at 32× lower memory |
ruvllm_hnsw_route (n≤11) | sub-ms per route, fixed cost |
Bootstraps ruvector@0.2.25 and its optional add-ons so every /vector subcommand actually works on first run.
Out of the box, several /vector subcommands fail with a confusing dep error:
| Error | Missing package |
|---|---|
ONNX WASM files not bundled. The onnx/ directory is missing. | ruvector-onnx-embeddings-wasm |
Brain commands require @ruvector/pi-brain | @ruvector/pi-brain |
SONA not available. Native error: Cannot find module '/.../@ruvector/sona/index.js' | @ruvector/ruvllm (JS fallback) |
LLM commands require @ruvector/ruvllm | @ruvector/ruvllm |
This skill installs them in one pass.
npm install ruvector@0.2.25
npm install ruvector-onnx-embeddings-wasm \
@ruvector/pi-brain \
@ruvector/ruvllm
For a leaner install, pass --full to also pull @ruvector/graph-node and @ruvector/router:
npm install ruvector-onnx-embeddings-wasm \
@ruvector/pi-brain \
@ruvector/ruvllm \
@ruvector/graph-node \
@ruvector/router
npx -y ruvector@0.2.25 doctor
npx -y ruvector@0.2.25 info
claude mcp add ruvector -- npx -y ruvector@0.2.25 mcp start
claude mcp list | grep ruvector
npx -y ruvector@0.2.25 hooks route "test"
npx -y ruvector@0.2.25 attention list
npx -y ruvector@0.2.25 rvf examples
npx -y ruvector@0.2.25 identity generate
npx -y ruvector@0.2.25 identity show
For a deterministic verification of the install, run the plugin's bundled smoke script:
bash plugins/ruflo-ruvector/scripts/smoke.sh
It checks: version pin, top-level subcommand visibility, hooks ast-analyze, hooks route, attention list, rvf examples, and info. Exits non-zero if any drift from the contracted surface is detected.
@ruvector/core)@ruvector/sona native binding (the JS fallback via @ruvector/ruvllm is sufficient on macOS arm64; Linux x64 has its own native binding)If doctor still reports a problem after this skill runs, paste its output verbatim and ask.