Ollama Memory Setup
Enables semantic memory search in OpenClaw using Ollama locally — no API keys, no cloud, fully private.
Wann verwenden?
Nutze diesen Skill wenn memory_search folgende Fehler wirft:
- - INLINECODE1
- INLINECODE2
- INLINECODE3
- INLINECODE4
Oder wenn du Embeddings lokal halten willst ohne externe APIs (OpenAI, Gemini, Voyage).
Verwendung
Automatisch (empfohlen)
CODEBLOCK0
Manuell (Schritt für Schritt)
CODEBLOCK1
Aufstellen
Keine API-Keys nötig. Voraussetzungen:
- - macOS: Homebrew installiert (
brew --version) - Linux: curl installiert, systemd empfohlen
- Ollama Version: >= 0.18.0
- Speicher: ~300MB für das nomic-embed-text Modell
Verifizieren
Nach dem Neustart in einer frischen Session testen:
CODEBLOCK2
Erwartete Antwort enthält "provider": "ollama" — nicht disabled: true.
Warum nomic-embed-text?
INLINECODE8 ist ein spezialisiertes Embedding-Modell (nicht für Chat):
- - Klein (~270MB vs. mehrere GB für Chat-Modelle)
- Schnell (~50ms pro Anfrage auf moderner Hardware)
- Hohe Qualität für semantische Suche
- Kostenlos, Open Source (Apache 2.0)
Alternativer Modellname für ältere Ollama-Versionen: INLINECODE9
Fehlersuche
Siehe references/troubleshooting.md für häufige Probleme wie:
- - Ollama startet nicht
- memory_search bleibt deaktiviert nach Setup
- macOS: Ollama stoppt nach Neustart
- Linux: Systemd-Service einrichten
Ollama 内存设置
使用本地 Ollama 在 OpenClaw 中启用语义内存搜索——无需 API 密钥,无需云端,完全私有。
何时使用?
当 memory_search 抛出以下错误时使用此技能:
- - node-llama-cpp is missing (or failed to install)
- Local embeddings unavailable
- Cannot find package node-llama-cpp
- optional dependency node-llama-cpp is missing
或者当你希望本地保存嵌入向量而不使用外部 API(OpenAI、Gemini、Voyage)时。
使用方法
自动安装(推荐)
bash
运行设置脚本
bash ~/.openclaw/workspace/skills/ollama-memory-setup/scripts/setup.sh
重启 OpenClaw
openclaw gateway restart
手动安装(逐步操作)
bash
1. 安装 Ollama
brew install ollama # macOS
curl -fsSL https://ollama.com/install.sh | sh # Linux
2. 启动 Ollama(macOS:作为服务运行,自动启动)
brew services start ollama
3. 加载嵌入模型(约 270MB,仅需一次)
ollama pull nomic-embed-text
4. 配置 OpenClaw
openclaw config set agents.defaults.memorySearch.provider ollama
openclaw config set agents.defaults.memorySearch.model nomic-embed-text
openclaw config set agents.defaults.memorySearch.remote.baseUrl http://localhost:11434
openclaw config set agents.defaults.memorySearch.enabled true
5. 重启
openclaw gateway restart
安装要求
无需 API 密钥。前提条件:
- - macOS: 已安装 Homebrew(brew --version)
- Linux: 已安装 curl,推荐使用 systemd
- Ollama 版本: >= 0.18.0
- 存储空间: nomic-embed-text 模型约需 300MB
验证
重启后,在新会话中测试:
memory_search(test)
预期响应包含 provider: ollama——而不是 disabled: true。
为什么选择 nomic-embed-text?
nomic-embed-text 是一个专门的嵌入模型(不用于聊天):
- - 体积小(约 270MB,而聊天模型需要数 GB)
- 速度快(现代硬件上每次请求约 50ms)
- 语义搜索质量高
- 免费、开源(Apache 2.0 许可证)
旧版 Ollama 的替代模型名称:nomic-embed-text:latest
故障排除
常见问题请参阅 references/troubleshooting.md,例如:
- - Ollama 无法启动
- 设置后 memory_search 仍处于禁用状态
- macOS:重启后 Ollama 停止运行
- Linux:配置 systemd 服务