openclaw - 💡(How to fix) Fix [Bug]: memorySearch schema blocks `dimensions` key — cannot use non-OpenAI embedding models (BGE, M3E, etc.)

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…

OpenClaw's memory-core plugin cannot use popular free embedding models (e.g., BAAI/bge-large-zh-v1.5, BAAI/bge-m3) via openai-compatible provider because:

  1. The hardcoded EMBEDDING_DIMENSIONS map in config-X0Wd6pSA.js only recognizes text-embedding-3-small (1536) and text-embedding-3-large (3072). Unknown models throw "Unsupported embedding model".
  2. The dimensions config key is parsed by the runtime config code (EMBEDDING_CONFIG_KEYS includes "dimensions") and resolveEmbeddingDimensions() reads embedding.dimensions. But the Zod schema validator rejects dimensions as an unrecognized key, causing gateway startup to fail with "Unrecognized key: dimensions".
  3. The schema-accepted outputDimensionality key appears to only apply to Gemini embedding models, not openai-compatible.

Result: Users on mainland China (who can't use OpenAI API) cannot use domestic/free embedding models like BGE-large-zh-v1.5 via SiliconFlow or ModelScope — even though these models work perfectly fine with direct /v1/embeddings API calls.

Root Cause

Summary

OpenClaw's memory-core plugin cannot use popular free embedding models (e.g., BAAI/bge-large-zh-v1.5, BAAI/bge-m3) via openai-compatible provider because:

Code Example

// In openclaw.json
{
  "agents": {
    "defaults": {
      "memorySearch": {
        "provider": "openai-compatible",
        "model": "BAAI/bge-large-zh-v1.5",
        "remote": {
          "baseUrl": "https://api.siliconflow.cn/v1",
          "apiKey": "sk-xxx"
        }
      }
    }
  }
}

---

"memorySearch": {
  "provider": "openai-compatible",
  "model": "BAAI/bge-large-zh-v1.5",
  "dimensions": 1024,
  "remote": { "baseUrl": "...", "apiKey": "..." }
}
RAW_BUFFERClick to expand / collapse

Bug type

Config / Schema

Summary

OpenClaw's memory-core plugin cannot use popular free embedding models (e.g., BAAI/bge-large-zh-v1.5, BAAI/bge-m3) via openai-compatible provider because:

  1. The hardcoded EMBEDDING_DIMENSIONS map in config-X0Wd6pSA.js only recognizes text-embedding-3-small (1536) and text-embedding-3-large (3072). Unknown models throw "Unsupported embedding model".
  2. The dimensions config key is parsed by the runtime config code (EMBEDDING_CONFIG_KEYS includes "dimensions") and resolveEmbeddingDimensions() reads embedding.dimensions. But the Zod schema validator rejects dimensions as an unrecognized key, causing gateway startup to fail with "Unrecognized key: dimensions".
  3. The schema-accepted outputDimensionality key appears to only apply to Gemini embedding models, not openai-compatible.

Result: Users on mainland China (who can't use OpenAI API) cannot use domestic/free embedding models like BGE-large-zh-v1.5 via SiliconFlow or ModelScope — even though these models work perfectly fine with direct /v1/embeddings API calls.

Steps to reproduce

// In openclaw.json
{
  "agents": {
    "defaults": {
      "memorySearch": {
        "provider": "openai-compatible",
        "model": "BAAI/bge-large-zh-v1.5",
        "remote": {
          "baseUrl": "https://api.siliconflow.cn/v1",
          "apiKey": "sk-xxx"
        }
      }
    }
  }
}

Run openclaw memory index --force. Expected: successful index. Actual: "Unsupported embedding model: BAAI/bge-large-zh-v1.5".

Add "dimensions": 1024:

"memorySearch": {
  "provider": "openai-compatible",
  "model": "BAAI/bge-large-zh-v1.5",
  "dimensions": 1024,
  "remote": { "baseUrl": "...", "apiKey": "..." }
}

Run openclaw memory index --force → works (dimensions passed through). But restart gateway → crashes with "Unrecognized key: dimensions".

Expected behavior

  • dimensions should be accepted by the Zod schema as a valid memorySearch config key
  • OR outputDimensionality should work for openai-compatible provider (not just Gemini)
  • OR EMBEDDING_DIMENSIONS map should be a configurable override, not hardcoded

OpenClaw version

2026.6.1 (2e08f0f)

Platform

Windows 11 (x64), Node v24.14.0

Relevant source locations

  • dist/config-X0Wd6pSA.jsEMBEDDING_DIMENSIONS hardcoded map, resolveEmbeddingDimensions(), EMBEDDING_CONFIG_KEYS
  • dist/embeddings-CxNgQi_5.js — embedding providers
  • Zod schema — rejects dimensions as unrecognized key

Impact

Blocks all users who cannot use OpenAI API (mainland China, privacy-sensitive deployments) from using free/open embedding models via openai-compatible provider. Affects models: BGE series, M3E, text2vec, multilingual-e5, and any other non-OpenAI embedding model.

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…

FAQ

Expected behavior

  • dimensions should be accepted by the Zod schema as a valid memorySearch config key
  • OR outputDimensionality should work for openai-compatible provider (not just Gemini)
  • OR EMBEDDING_DIMENSIONS map should be a configurable override, not hardcoded

Still need to ship something?

×6

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

Back to top recommendations

TRENDING