vector-embed
它能做什么
这项技能为一段文本创建数值表示,称为嵌入(embedding),并可将其存储以供之后搜索。适用于在自己的笔记或文档上构建搜索或比较功能的人。
适用场景
- ✓当你想让文档可以按含义搜索的时候。
- ✓当你想比较两段文本的相似程度的时候。
- ✓当你需要嵌入作为聚类或搜索的输入的时候。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-ruvector/skills/vector-embed/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这份会议记录转换为向量并保存,以便我之后搜索相似的笔记。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会安装固定版本的 ruvector 工具,并使用一个小型本地语言模型为每段文本创建由 384 个数字组成的向量。结果可以写入文件,也可以存入记忆。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Vector Embed
Generate and store vector embeddings using the ruvector npm package.
When to use
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).
Steps
- Ensure ruvector@0.3.3 is available:
ruvector 0.3.3 bundles the ONNX runtime; no add-on is needed. Ifnpm ls ruvector 2>/dev/null | grep '0.3.3' || npm install ruvector@0.3.3embed textreportsONNX WASM files not bundled, an older ruvector (0.2.x) is being resolved — rerun with the pinnednpx -y ruvector@0.3.3. - Embed the input (use the
textsubcommand, with text as a positional arg):- Single string:
npx -y ruvector@0.3.3 embed text "your text here" - With output file:
npx -y ruvector@0.3.3 embed text "your text here" -o vec.json - For a file: read its content via the Read tool, then pass it as the positional argument.
- For batch: loop over files in shell — ruvector@0.3.3 has no built-in
--batch/--globflags.
- Single string:
- Adaptive (LoRA) variant:
npx -y ruvector@0.3.3 embed text "..." --adaptive --domain code - Confirm — report vector dimension (384), norm, and any output path written.
- Store metadata in AgentDB if needed:
mcp__plugin_ruflo-core_ruflo__memory_store({ key: "embed-SOURCE", value: "VECTOR_METADATA", namespace: "vector-patterns" })
MCP alternative
Register the MCP server once with the pinned version:
claude mcp add ruvector -- npx -y ruvector@0.3.3 mcp start
Then call MCP tools directly: hooks_rag_context (semantic context), brain_search (collective brain), hooks_ast_analyze, hooks_route.
Caveats
- The
embed --batch --globflags do not exist in ruvector@0.3.3.embed textaccepts one text,--stdin, or--input-file <path>(keeps sensitive text off argv); call it per file. - If embedding fails, run
npx -y ruvector@0.3.3 doctorto diagnose.
常见问题
每个向量有多长?
来源说明每段文本对应 384 个数字。
文本会离开我的电脑吗?
来源说明该模型是通过该工具运行的 ONNX 模型,因此生成嵌入本身不需要托管的 API。
如果我要嵌入很多文件怎么办?
这项技能建议在 shell 中循环处理这些文件,因为该工具没有内置的批处理选项。
详情
作者的原始描述
Generate embeddings via npx ruvector@0.3.3 embed text (ONNX all-MiniLM-L6-v2, 384-dim), normalize, and store in HNSW index
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1686
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。