Agent Skills › matrixorigin/memoria › local-embedding

local-embedding

GitHub

指导在本地通过 ONNX Runtime 构建和配置离线嵌入模型,支持自定义模型选择与参数设置,无需 API Key,适用于对隐私有严格要求或无网络环境的场景。

skills/local-embedding/SKILL.md matrixorigin/memoria

Trigger Scenarios

需要在本地运行文本嵌入 避免使用远程 API 以保护隐私 在无网络环境下进行数据处理

Install

npx skills add matrixorigin/memoria --skill local-embedding -g -y
More Options

Use without installing

npx skills use matrixorigin/memoria@local-embedding

指定 Agent (Claude Code)

npx skills add matrixorigin/memoria --skill local-embedding -a claude-code -g -y

安装 repo 全部 skill

npx skills add matrixorigin/memoria --all -g -y

预览 repo 内 skill

npx skills add matrixorigin/memoria --list

SKILL.md

Frontmatter
{
    "name": "local-embedding",
    "description": "Run embedding on-device with ONNX Runtime. Build from source, model selection, offline mode. Use when setting up local embedding without an API key."
}

Build from Source

Pre-built binaries do NOT include local embedding.

cd Memoria
make build-local
sudo cp memoria/target/release/memoria /usr/local/bin/

Binary is ~50-80MB (bundles ONNX Runtime). Expected.

Configure

memoria init --tool kiro    # No --embedding-* flags needed

Leave EMBEDDING_* env vars empty in mcp.json → local embedding is the default.

How It Works

  1. First query → model downloads to ~/.cache/fastembed/ (~30MB default)
  2. Model loads via ONNX Runtime (~3-5s)
  3. Subsequent queries are fast (in-process)

Models

Model Dim Size Notes
all-MiniLM-L6-v2 384 ~30MB Default. Fast, English
BAAI/bge-m3 1024 ~1.2GB Best quality, multilingual

Change model in mcp.json env block:

{ "EMBEDDING_MODEL": "BAAI/bge-m3", "EMBEDDING_DIM": "1024" }

⚠️ Choose BEFORE first startup. Dimension is locked into schema.

When to Use

Local Remote (OpenAI/SiliconFlow)
Privacy ✅ Offline ⚠️ Text sent to API
Cost Free API key
First query ~3-5s Fast
Build From source Pre-built works
Offline ✅ ❌

Recommendation: Use remote unless you need offline/strict privacy.

Troubleshooting

Problem Fix
"compiled without local-embedding" Build from source: make build-local
Model download fails Set HF_ENDPOINT for mirror, or manually download to ~/.cache/fastembed/
High memory Default ~100MB. bge-m3 ~1-2GB. Choose based on available RAM

Version History

  • 63f0289 Current 2026-07-25 08:42

Same Skill Collection

plugins/clawhub/thememoria/SKILL.md
plugins/openclaw/skills/memoria-memory/SKILL.md
plugins/openclaw/skills/memoria-recovery/SKILL.md
skills/api-reference/SKILL.md
skills/architecture/SKILL.md
skills/deployment/SKILL.md
skills/plugin-development/SKILL.md
skills/release/SKILL.md
skills/setup/SKILL.md

Metadata

Files
0
Version
9962999
Hash
f963c2bf
Indexed
2026-07-25 08:42

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-02 18:09
浙ICP备14020137号-1