ollama-memory-embeddings
Configure OpenClaw memory search to use Ollama as the embeddings server (OpenAI-compatible /v1/embeddings) instead of the built-in node-llama-cpp local GGUF loading. Includes interactive model selection and optional import of an existing local embedding GGUF into Ollama.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- ollama-memory-embeddings
- slug
- ollama-memory-embeddings
- version
- 1.0.4
- description
- Configure OpenClaw memory search to use Ollama as the embeddings server (OpenAI-compatible /v1/embeddings) instead of the built-in node-llama-cpp local GGUF loading. Includes interactive model selection and optional import of an existing local embedding GGUF into Ollama.
- displayName
- Ollama Memory Embeddings
- display_name
- Ollama Memory Embeddings
03 SKILL.md 正文
Ollama Memory Embeddings
This skill configures OpenClaw memory search to use Ollama as the embeddings
server via its OpenAI-compatible /v1/embeddings endpoint.
Embeddings only. This skill does not affect chat/completions routing — it only changes how memory-search embedding vectors are generated.
What it does
- Installs this skill under
~/.openclaw/skills/ollama-memory-embeddings - Verifies Ollama is installed and reachable
- Lets the user choose an embedding model:
embeddinggemma(default — closest to OpenClaw built-in)nomic-embed-text(strong quality, efficient)all-minilm(smallest/fastest)mxbai-embed-large(highest quality, larger)
- Optionally imports an existing local embedding GGUF into Ollama via
ollama create(currently detects embeddinggemma, nomic-embed, all-minilm, and mxbai-embed GGUFs in known cache directories) - Normalizes model names (handles
:latesttag automatically) - Updates
agents.defaults.memorySearchin OpenClaw config (surgical — only touches keys this skill owns):provider = "openai"model = <selected model>:latestremote.baseUrl = "http://127.0.0.1:11434/v1/"remote.apiKey = "ollama"(required by client, ignored by Ollama)
- Performs a post-write config sanity check (reads back and validates JSON)
- Optionally restarts the OpenClaw gateway (with detection of available
restart methods:
openclaw gateway restart, systemd, launchd) - Optional memory reindex during install (
openclaw memory index --force --verbose) - Runs a two-step verification:
- Checks model exists in
ollama list - Calls the embeddings endpoint and validates the response
- Checks model exists in
- Adds an idempotent drift-enforcement command (
enforce.sh) - Adds optional config drift auto-healing watchdog (
watchdog.sh)
Install
bash ~/.openclaw/skills/ollama-memory-embeddings/install.sh
From this repository:
bash skills/ollama-memory-embeddings/install.sh
Non-interactive usage
bash ~/.openclaw/skills/ollama-memory-embeddings/install.sh \
--non-interactive \
--model embeddinggemma \
--reindex-memory auto
Bulletproof setup (install watchdog):
bash ~/.openclaw/skills/ollama-memory-embeddings/install.sh \
--non-interactive \
--model embeddinggemma \
--reindex-memory auto \
--install-watchdog \
--watchdog-interval 60
Note: In non-interactive mode,
--import-local-gguf autois treated asno(safe default). Use--import-local-gguf yesto explicitly opt in.
Options:
--model <id>: one ofembeddinggemma,nomic-embed-text,all-minilm,mxbai-embed-large--import-local-gguf <auto|yes|no>: defaultno(safer default; opt in withyes)--import-model-name <name>: defaultembeddinggemma-local--restart-gateway <yes|no>: defaultno(restart only when explicitly requested)--skip-restart: deprecated alias for--restart-gateway no--openclaw-config <path>: config file path override--install-watchdog: install launchd drift auto-heal watchdog (macOS)--watchdog-interval <sec>: watchdog interval (default 60)--reindex-memory <auto|yes|no>: memory rebuild mode (defaultauto)--dry-run: print planned changes and commands; make no modifications
Verify
~/.openclaw/skills/ollama-memory-embeddings/verify.sh
Use --verbose to dump raw API response on failure:
~/.openclaw/skills/ollama-memory-embeddings/verify.sh --verbose
Drift enforcement and auto-heal
Manually enforce desired state (safe to run repeatedly):
~/.openclaw/skills/ollama-memory-embeddings/enforce.sh \
--model embeddinggemma \
--openclaw-config ~/.openclaw/openclaw.json
Check for drift only:
~/.openclaw/skills/ollama-memory-embeddings/enforce.sh \
--check-only \
--model embeddinggemma
Run watchdog once (check + heal):
~/.openclaw/skills/ollama-memory-embeddings/watchdog.sh \
--once \
--model embeddinggemma
Install watchdog via launchd (macOS):
~/.openclaw/skills/ollama-memory-embeddings/watchdog.sh \
--install-launchd \
--model embeddinggemma \
--interval-sec 60
GGUF detection scope
The installer searches for embedding GGUFs matching these patterns in known
cache directories (~/.node-llama-cpp/models, ~/.cache/node-llama-cpp/models,
~/.cache/openclaw/models):
*embeddinggemma*.gguf*nomic-embed*.gguf*all-minilm*.gguf*mxbai-embed*.gguf
Other embedding GGUFs are not auto-detected. You can always import manually:
ollama create my-model -f /path/to/Modelfile
Notes
- This does not modify OpenClaw package code. It only updates user config.
- A timestamped backup of config is written before changes.
- If no local GGUF exists, install proceeds by pulling the selected model from Ollama.
- Model names are normalized with
:latesttag for consistent Ollama interaction. - If embedding model changes, rebuild/re-embed existing memory vectors to avoid retrieval mismatch across incompatible vector spaces.
- With
--reindex-memory auto, installer reindexes only when the effective embedding fingerprint changed (provider,model,baseUrl,apiKey presence). - Drift checks require a non-empty apiKey but do not require a literal
"ollama"value. - Config backups are created only when a write is needed.
- Legacy schema fallback is supported: if
agents.defaults.memorySearchis absent, the enforcer reads known legacy paths and mirrors writes to preserve compatibility.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.