vidarbrekke

Ollama Memory Embeddings

AI 智能体v1.0.4
作者:vidarbrekke更新于 2026-05-11共 5 个版本 · 最新版本发布于 2026-02-13ollama-memory-embeddings@clawhub_vidarbrekke/ollama-memory-embeddings
记忆增强工具调用

据 AlphaMoat 统计,截至 2026-09,Ollama Memory Embeddings 累计下载 3,025 次、获 6 个星标,在全部 5,078 个 AI 技能中排名第 3,712 位,在「AI 智能体」分类(969 个)中排名第 747 位。

累计安装
119
累计下载
3,025
星标
6
全站排名
#3,712
全站前 74% · 「AI 智能体」前 78%
平台累计安装累计下载星标评论
ClawHub ↗903,0105-
SkillHub ↗1193,0256—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它可检查 Ollama 是否已安装且可连接,让用户选择 embedding 模型,并可选择导入已有本地 embedding GGUF。它只影响 memory-search 的 embedding 生成,不改变聊天或 completion 路由。

资料发布于 2026-10-29

可以用来做什么

  • 为 OpenClaw memory search 配置 Ollama embedding 服务
  • 选择 embedding 模型或导入已有本地模型文件

什么时候用

  • 需要让 OpenClaw 的 memory search 使用 Ollama 生成 embedding 向量时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

说明如何将 OpenClaw memory search 指向 Ollama embeddings 服务,并指出哪些路由不受影响;不要修改配置。

月度数据趋势

累计下载3,025
1,5522,3433,1342026-03 · 累计下载 1,6612026-05 · 累计下载 2,1842026-06 · 累计下载 2,3672026-07 · 累计下载 2,6752026-08 · 累计下载 2,8352026-09 · 累计下载 3,02526-0326-09
星标6
5662026-03 · 星标 52026-05 · 星标 52026-06 · 星标 62026-07 · 星标 62026-08 · 星标 62026-09 · 星标 626-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,025—6
2026-082,835+6.0%6
2026-072,675+13.0%6
2026-062,367+8.4%6
2026-052,184—5
2026-031,661—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.9 KB · ClawHub v1.0.4
---
slug: ollama-memory-embeddings
version: "1.0.4"
display_name: Ollama Memory Embeddings
displayName: Ollama Memory Embeddings
name: ollama-memory-embeddings
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
展开全部(共 177 行)
  of an existing local embedding GGUF into Ollama.
---

# 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 = <selected 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
bash ~/.openclaw/skills/ollama-memory-embeddings/install.sh
```

From this repository:

```bash
bash skills/ollama-memory-embeddings/install.sh
```

## Non-interactive usage

```bash
bash ~/.openclaw/skills/ollama-memory-embeddings/install.sh \
  --non-interactive \
  --model embeddinggemma \
  --reindex-memory auto
```

Bulletproof setup (install watchdog):

```bash
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 <id>`: one of `embeddinggemma`, `nomic-embed-text`, `all-minilm`, `mxbai-embed-large`
- `--import-local-gguf <auto|yes|no>`: default `no` (safer default; opt in with `yes`)
- `--import-model-name <name>`: default `embeddinggemma-local`
- `--restart-gateway <yes|no>`: default `no` (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 (default `auto`)
- `--dry-run`: print planned changes and commands; make no modifications

## Verify

```bash
~/.openclaw/skills/ollama-memory-embeddings/verify.sh
```

Use `--verbose` to dump raw API response on failure:

```bash
~/.openclaw/skills/ollama-memory-embeddings/verify.sh --verbose
```

## Drift enforcement and auto-heal

Manually enforce desired state (safe to run repeatedly):

```bash
~/.openclaw/skills/ollama-memory-embeddings/enforce.sh \
  --model embeddinggemma \
  --openclaw-config ~/.openclaw/openclaw.json
```

Check for drift only:

```bash
~/.openclaw/skills/ollama-memory-embeddings/enforce.sh \
  --check-only \
  --model embeddinggemma
```

Run watchdog once (check + heal):

```bash
~/.openclaw/skills/ollama-memory-embeddings/watchdog.sh \
  --once \
  --model embeddinggemma
```

Install watchdog via launchd (macOS):

```bash
~/.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:

```bash
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.

「AI 智能体」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。