openclaw - ✅(Solved) Fix [Bug]: CLI `openclaw memory index` fails with 'Unknown memory embedding provider: ollama' [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63681Fetched 2026-04-10 03:42:13
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1referenced ×1

Error Message

Error: Unknown memory embedding provider: ollama
    at getAdapter (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:317:22)
    at createEmbeddingProvider (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:369:25)
    at MemoryIndexManager.loadProviderResult (...)

Root Cause

The builtin embedding providers (including ollama) are registered via registerBuiltInMemoryEmbeddingProviders(api), which is called in the memory-core plugin's register() function.

The Gateway loads plugins through the full lifecycle (which calls register()), but the CLI does not trigger this registration path. As a result, the provider registry is empty when CLI commands attempt to resolve the embedding provider.

This is consistent with the issue observed in #29568 and #10931, but specifically affects CLI commands rather than the memory_search tool.

Fix Action

Workaround

Currently, there is no CLI workaround. Users must rely on the Gateway's automatic file watcher (sync.watch: true) to index memory files.

PR fix notes

PR #63847: fix(cli): load plugins for memory commands so embedding providers register

Description (problem / solution / changelog)

Summary

The memory CLI command was missing from the command catalog, so ensureCliExecutionBootstrap never loaded the plugin registry before running memory subcommands. Without plugin loading, the Ollama plugin's embedding provider adapter was never registered, causing "Unknown memory embedding provider: ollama" errors.

Adding memory to the catalog with loadPlugins: "always" ensures all plugins are registered before any memory CLI command executes.

Closes #63681

Changes

  • Added memory to the CLI command catalog with loadPlugins: "always"

Testing

  • Verified that openclaw memory index no longer throws "Unknown memory embedding provider: ollama" when the Ollama plugin is configured

This PR was developed with AI assistance (Claude). Built with islo.dev

Changed files

  • src/cli/command-catalog.ts (modified, +1/-0)
  • src/cli/command-startup-policy.test.ts (modified, +12/-0)

Code Example

Memory index failed (devops): Unknown memory embedding provider: ollama

---

"memorySearch": {
  "enabled": true,
  "provider": "ollama",
  "sync": {
    "watch": true,
    "sessions": {
      "deltaBytes": 100000,
      "deltaMessages": 50
    }
  },
  "model": "qwen3-embedding:0.6b"
}

---

17:06:31+08:00 [plugins] [lcm] Plugin loaded
🦞 OpenClaw 2026.4.9 (0512059)

Memory index failed (devops): Unknown memory embedding provider: ollama
Error: (none)
Exit Code: 1

---

$ curl -s http://localhost:11434/api/embed -d '{"model": "qwen3-embedding:0.6b", "input": "test"}'
  # Returns embeddings successfully

---

Error: Unknown memory embedding provider: ollama
    at getAdapter (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:317:22)
    at createEmbeddingProvider (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:369:25)
    at MemoryIndexManager.loadProviderResult (...)
RAW_BUFFERClick to expand / collapse

Bug Description

When running the CLI command openclaw memory index --agent devops, it fails with the error:

Memory index failed (devops): Unknown memory embedding provider: ollama

The Gateway runtime works correctly with the same configuration, but the CLI commands fail to initialize the Ollama embedding provider.

Environment

  • OpenClaw Version: 2026.4.9 (0512059)
  • OS: Linux (x86_64)
  • Node.js: v22.21.1
  • Memory Provider: ollama
  • Embedding Model: qwen3-embedding:0.6b

Configuration

Relevant openclaw.json settings:

"memorySearch": {
  "enabled": true,
  "provider": "ollama",
  "sync": {
    "watch": true,
    "sessions": {
      "deltaBytes": 100000,
      "deltaMessages": 50
    }
  },
  "model": "qwen3-embedding:0.6b"
}

Steps To Reproduce

  1. Configure memorySearch.provider as "ollama" and memorySearch.model as "qwen3-embedding:0.6b"
  2. Ensure Ollama is running and the model is available (ollama list shows the model)
  3. Run: openclaw memory index --agent devops
  4. CLI fails with: Unknown memory embedding provider: ollama

Expected Behavior

The CLI should successfully initialize the Ollama embedding provider and index the memory files.

Actual Behavior

17:06:31+08:00 [plugins] [lcm] Plugin loaded
🦞 OpenClaw 2026.4.9 (0512059)

Memory index failed (devops): Unknown memory embedding provider: ollama
Error: (none)
Exit Code: 1

Additional Context

What Works

  • ✅ Ollama is running and responsive
  • ✅ Model qwen3-embedding:0.6b exists and works:
    $ curl -s http://localhost:11434/api/embed -d '{"model": "qwen3-embedding:0.6b", "input": "test"}'
    # Returns embeddings successfully
  • ✅ Gateway runtime works correctly (memory indexing via Gateway succeeds)
  • ✅ Configuration is valid (Gateway loads it without errors)

What Fails

  • ❌ All CLI memory commands fail:
    • openclaw memory index --agent devops
    • openclaw memory status --agent devops
    • openclaw memory search "query"

Stack Trace

Error: Unknown memory embedding provider: ollama
    at getAdapter (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:317:22)
    at createEmbeddingProvider (file:///root/.nvm/versions/node/v22.21.1/lib/node_modules/openclaw/dist/manager-vTWIfqhx.js:369:25)
    at MemoryIndexManager.loadProviderResult (...)

Root Cause Analysis

The builtin embedding providers (including ollama) are registered via registerBuiltInMemoryEmbeddingProviders(api), which is called in the memory-core plugin's register() function.

The Gateway loads plugins through the full lifecycle (which calls register()), but the CLI does not trigger this registration path. As a result, the provider registry is empty when CLI commands attempt to resolve the embedding provider.

This is consistent with the issue observed in #29568 and #10931, but specifically affects CLI commands rather than the memory_search tool.

Workaround

Currently, there is no CLI workaround. Users must rely on the Gateway's automatic file watcher (sync.watch: true) to index memory files.

Suggested Fix

Ensure the CLI runtime calls registerBuiltInMemoryEmbeddingProviders() before attempting to create embedding providers, or initialize the provider registry in the CLI entry point.

extent analysis

TL;DR

The most likely fix is to ensure the CLI runtime calls registerBuiltInMemoryEmbeddingProviders() before attempting to create embedding providers.

Guidance

  • Verify that the registerBuiltInMemoryEmbeddingProviders() function is being called in the CLI entry point by adding logging or debugging statements.
  • Check if the memory-core plugin's register() function is being executed in the CLI runtime, which should register the built-in embedding providers.
  • Consider initializing the provider registry in the CLI entry point as a temporary workaround.
  • Review the code changes suggested in issues #29568 and #10931 to see if they can be applied to the CLI runtime.

Example

No code snippet is provided as the issue does not contain sufficient information to create a concrete example.

Notes

The root cause analysis suggests that the issue is due to the CLI runtime not triggering the registration of built-in embedding providers. The suggested fix is to ensure that the registerBuiltInMemoryEmbeddingProviders() function is called before attempting to create embedding providers.

Recommendation

Apply the workaround by initializing the provider registry in the CLI entry point, as there is currently no CLI workaround available. This will allow users to index memory files using the CLI commands until a permanent fix is implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING