← 返回
AI智能 中文

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.
配置 OpenClaw 内存搜索使用 Ollama 作为嵌入服务器(OpenAI 兼容的 /v1/embeddings),替换内置的 node-llama-cpp 本地 GGUF 加载。支持交互式模型选择,并可选择将现有本地嵌入 GGUF 导入 Ollama。
vidarbrekke
AI智能 clawhub v1.0.4 1 版本 99743.7 Key: 无需
★ 5
Stars
📥 2,235
下载
💾 119
安装
1
版本
#latest

概述

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 :latest tag automatically)
  • Updates agents.defaults.memorySearch in OpenClaw config (surgical — only

touches keys this skill owns):

  • provider = "openai"
  • model = :latest
  • remote.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:
  1. Checks model exists in ollama list
  2. Calls the embeddings endpoint and validates the response
    • 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 auto is treated as

> no (safe default). Use --import-local-gguf yes to explicitly opt in.

Options:

  • --model : one of embeddinggemma, nomic-embed-text, all-minilm, mxbai-embed-large
  • --import-local-gguf : default no (safer default; opt in with yes)
  • --import-model-name : default embeddinggemma-local
  • --restart-gateway : default no (restart only when explicitly requested)
  • --skip-restart: deprecated alias for --restart-gateway no
  • --openclaw-config : config file path override
  • --install-watchdog: install launchd drift auto-heal watchdog (macOS)
  • --watchdog-interval : watchdog interval (default 60)
  • --reindex-memory : memory rebuild mode (default auto)
  • --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 :latest tag 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.memorySearch is absent,

the enforcer reads known legacy paths and mirrors writes to preserve compatibility.

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-28 19:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,350 📥 317,750
developer-tools

Claw Backup

vidarbrekke
使用 rclone 将 OpenClaw 的自定义(记忆、配置、技能、工作区)备份到云存储,支持定时任务和保留策略。适用于 macOS、Linux 和 Windows(Git Bash/WSL)。
★ 4 📥 3,451
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,056 📥 796,412