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

embeddings

它能做什么

这项技能帮助智能体把文本转换为嵌入(即捕捉含义的数字模式),然后搜索相似的内容。适合想找到相关观点或文档、而不仅仅是匹配词语的人。

适用场景

  • ✓当你想找出过去与新请求含义相近的工作的时候。
  • ✓当精确的关键词搜索漏掉了描述同一事物的条目的时候。
  • ✓当你需要为智能体准备一个可搜索的模式或文档库的时候。

技能链接

https://github.com/ruvnet/ruflo/blob/main/.agents/skills/embeddings/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请找出与安全最佳实践含义相近的过去文档,并显示前五个。”

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

工作原理

智能体会把文本转换为向量,保存在本地数据库中,并将新的查询与之比较,返回最接近的匹配结果。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Embeddings Skill

Purpose

Vector embeddings for semantic search and pattern matching with HNSW indexing.

Features

Feature Description
sql.js Cross-platform SQLite persistent cache (WASM)
HNSW 150x-12,500x faster search
Hyperbolic Poincare ball model for hierarchical data
Normalization L2, L1, min-max, z-score
Chunking Configurable overlap and size
75x faster With agentic-flow ONNX integration

Commands

Initialize Embeddings

npx claude-flow embeddings init --backend sqlite

Embed Text

npx claude-flow embeddings embed --text "authentication patterns"

Batch Embed

npx claude-flow embeddings batch --file documents.json

Semantic Search

npx claude-flow embeddings search --query "security best practices" --top-k 5

Memory Integration

# Store with embeddings
npx claude-flow memory store --key "pattern-1" --value "description" --embed

# Search with embeddings
npx claude-flow memory search --query "related patterns" --semantic

Quantization

Type Memory Reduction Speed
Int8 3.92x Fast
Int4 7.84x Faster
Binary 32x Fastest

Best Practices

  1. Use HNSW for large pattern databases
  2. Enable quantization for memory efficiency
  3. Use hyperbolic for hierarchical relationships
  4. Normalize embeddings for consistency
常见问题

什么是嵌入?

嵌入是一组数字,代表一段文本的含义。

它需要云服务吗?

这项技能描述的是本地 SQLite 缓存,因此数据保存在你自己的环境中。

什么时候不应该使用它?

这项技能说明,对于精确的文本匹配或简单查找,应当跳过它。

详情

作者的原始描述

Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.

repo: ruvnet/ruflo

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能