embeddings
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEmbeddings Skill
Embeddings Skill
Purpose
用途
Vector embeddings for semantic search and pattern matching with HNSW indexing.
用于语义搜索和模式匹配的向量嵌入技术,搭配HNSW索引。
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 |
| 特性 | 描述 |
|---|---|
| sql.js | 跨平台SQLite持久化缓存(WASM) |
| HNSW | 搜索速度提升150-12500倍 |
| Hyperbolic | 用于层级数据的庞加莱球模型 |
| Normalization | L2、L1、最小-最大、z分数归一化 |
| Chunking | 可配置的重叠度与尺寸 |
| 75倍提速 | 集成agentic-flow ONNX后实现 |
Commands
命令
Initialize Embeddings
初始化Embeddings
bash
npx claude-flow embeddings init --backend sqlitebash
npx claude-flow embeddings init --backend sqliteEmbed Text
嵌入文本
bash
npx claude-flow embeddings embed --text "authentication patterns"bash
npx claude-flow embeddings embed --text "authentication patterns"Batch Embed
批量嵌入
bash
npx claude-flow embeddings batch --file documents.jsonbash
npx claude-flow embeddings batch --file documents.jsonSemantic Search
语义搜索
bash
npx claude-flow embeddings search --query "security best practices" --top-k 5bash
npx claude-flow embeddings search --query "security best practices" --top-k 5Memory Integration
记忆集成
bash
undefinedbash
undefinedStore with embeddings
搭配嵌入存储
npx claude-flow memory store --key "pattern-1" --value "description" --embed
npx claude-flow memory store --key "pattern-1" --value "description" --embed
Search with embeddings
基于嵌入搜索
npx claude-flow memory search --query "related patterns" --semantic
undefinednpx claude-flow memory search --query "related patterns" --semantic
undefinedQuantization
量化
| Type | Memory Reduction | Speed |
|---|---|---|
| Int8 | 3.92x | Fast |
| Int4 | 7.84x | Faster |
| Binary | 32x | Fastest |
| 类型 | 内存占用减少比例 | 速度 |
|---|---|---|
| Int8 | 3.92倍 | 快速 |
| Int4 | 7.84倍 | 更快 |
| Binary | 32倍 | 最快 |
Best Practices
最佳实践
- Use HNSW for large pattern databases
- Enable quantization for memory efficiency
- Use hyperbolic for hierarchical relationships
- Normalize embeddings for consistency
- 针对大型模式数据库使用HNSW
- 启用量化以提升内存效率
- 针对层级关系使用双曲空间
- 对嵌入向量进行归一化以保证一致性