← 返回
未分类 中文

Ollama Memory Setup

Set up, diagnose, repair, and quality-test private local OpenClaw semantic memory search using Ollama embeddings. Use when memory_search is disabled, node-ll...
使用 Ollama 嵌入在本地私密部署 OpenClaw 语义记忆搜索,负责搭建、诊断、修复及质量测试。适用于 memory_search 被禁用、节点...
brasco05 brasco05 来源
未分类 clawhub v1.2.3 2 版本 100000 Key: 无需
★ 0
Stars
📥 483
下载
💾 0
安装
2
版本
#latest

概述

Ollama Memory Setup

Use this skill to make OpenClaw memory_search work locally with Ollama embeddings instead of fragile native node-llama-cpp builds or paid hosted embedding APIs.

What success looks like

A correct setup has all of this:

  • Ollama installed and reachable at http://localhost:11434
  • an embedding model pulled, usually nomic-embed-text
  • OpenClaw config explicitly sets agents.defaults.memorySearch.provider to ollama
  • memory index rebuilt after config changes
  • optional --quality-test passes against known memory topics
  • memory_search("...") or openclaw memory search "..." returns results with provider ollama

Side effects and consent

Default script mode is read-only/diagnostic. Side effects require explicit flags:

  • --install: may install Ollama, start services, and pull a model.
  • --apply-config: writes OpenClaw agents.defaults.memorySearch.* config.
  • --quality-test: read-only search validation; temp files are deleted on exit, but query text/output may still appear in terminal logs.

Before recommending --install or --apply-config, tell the user what will change. Do not run those flags silently. Prefer default localhost settings; review/patch the script before letting an agent provide arbitrary --model or --base-url values.

Fast path

Prefer the bundled diagnostic script first:

bash scripts/check-ollama-memory.sh

To install/pull the model and print/apply OpenClaw config commands:

# Diagnostic only first
bash scripts/check-ollama-memory.sh

# Then, with explicit user approval for side effects
bash scripts/check-ollama-memory.sh --install --apply-config
openclaw gateway restart
openclaw memory index --force
openclaw memory status --deep
bash scripts/check-ollama-memory.sh --quality-test --query="known memory topic"

If running inside an agent with first-class config tools available, use those for config changes instead of hand-editing JSON.

Workflow

1. Preflight before changing anything

Check:

command -v ollama
curl -s http://localhost:11434/api/tags
ollama list | grep -E 'nomic-embed-text|qwen.*embedding'
openclaw memory status --deep

If Ollama is reachable and the model exists, skip installation and go to config validation.

2. Install or start Ollama

macOS:

brew install ollama
brew services start ollama

Linux:

curl -fsSL https://ollama.com/install.sh | sh
ollama serve

Do not expose Ollama directly to the public internet. Keep it on localhost, VPN, or private LAN.

3. Pull an embedding model

Default:

ollama pull nomic-embed-text

Use nomic-embed-text for the lowest-friction setup. Use another embedding model only if OpenClaw/Ollama supports it and the user has a reason.

4. Configure OpenClaw memory search

Set this under agents.defaults.memorySearch:

{
  "enabled": true,
  "provider": "ollama",
  "model": "nomic-embed-text",
  "remote": {
    "baseUrl": "http://localhost:11434"
  }
}

CLI batch form:

openclaw config set --batch-json '[
  {"path":"agents.defaults.memorySearch.enabled","value":true},
  {"path":"agents.defaults.memorySearch.provider","value":"ollama"},
  {"path":"agents.defaults.memorySearch.model","value":"nomic-embed-text"},
  {"path":"agents.defaults.memorySearch.remote.baseUrl","value":"http://localhost:11434"}
]' --strict-json

Then restart the gateway:

openclaw gateway restart

5. Reindex and validate

openclaw memory index --force
openclaw memory status --deep
openclaw memory search "project decision" --max-results 5

In-agent validation:

memory_search("a known topic from MEMORY.md")

Expected: provider is ollama, search is not disabled, and results are semantically relevant. For stronger proof, run:

bash scripts/check-ollama-memory.sh --quality-test \
  --query="known project decision" \
  --query="known bug fix" \
  --query="known todo"

When to read troubleshooting

Read references/troubleshooting.md when:

  • memory_search still says disabled
  • Ollama is installed but not reachable
  • the model is pulled but OpenClaw still uses another provider
  • indexing is slow or returns no useful results
  • config commands fail or the installed OpenClaw CLI is older than the config file

Safety rules

  • Never paste secrets into openclaw.json for this setup. Ollama local embeddings do not need real API keys.
  • Do not bind Ollama to 0.0.0.0 unless the user understands the network/security risk.
  • Do not delete existing memory files to “fix” search. Reindex instead.
  • Do not promise semantic quality until a real memory_search/openclaw memory search validation passes.

版本历史

共 2 个版本

  • v1.2.3 当前
    2026-05-08 12:51 安全 安全
  • v1.0.0
    2026-05-03 09:32 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,391
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,810
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,721