Skip to main content

local-embedding

Run embedding on-device with ONNX Runtime. Build from source, model selection, offline mode. Use when setting up local embedding without an API key.

Source facts

Repository
matrixorigin/memoria
Last source activity
March 18, 2026 at 10:27
Detected SKILL.md language
English
Stars
624
Forks
81

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
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. ```bash cd Memoria make build-local sudo cp memoria/target/release/memoria /usr/local/bin/ ``` Binary is ~50-80MB (bundles ONNX Runtime). Expected. ## Configure ```bash 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: ```json { "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 |
View on GitHub