Skip to content

[Bug] Local embedding (node-llama-cpp) reindex silently fails - Dirty: yes forever, no chunks reindexed #16164

@morimasamasa

Description

@morimasamasa

Bug Description

After switching memorySearch.provider from openai to local (node-llama-cpp with nomic-embed-text-v1.5), the indexer detects the provider change and sets Dirty: yes, but never actually reindexes. No error or progress appears in gateway logs. The SQLite metadata remains unchanged (old OpenAI 1536-dim embeddings), and memory_search returns empty results.

Steps to Reproduce

  1. Start with working OpenAI embedding (text-embedding-3-small, 1536 dims, 541 chunks indexed)
  2. Apply config:
{
  "agents": {
    "defaults": {
      "memorySearch": {
        "provider": "local",
        "fallback": "none",
        "local": {
          "modelPath": "/path/to/nomic-embed-text-v1.5.Q8_0.gguf"
        }
      }
    }
  }
}
  1. Restart gateway
  2. Run openclaw memory status
  3. Call memory_search to trigger sync
  4. Wait several minutes, repeat

Expected Behavior

  • Indexer detects provider/model change (OpenAI 1536 → local 768)
  • SQLite is reset and all chunks are re-embedded with the local model
  • memory_search returns results using local embeddings

Actual Behavior

  • openclaw memory status shows:
    • Provider: local (requested: local)
    • Dirty: yes (never clears)
    • Vector dims: 1536 (old OpenAI dims, never changes to 768)
    • Indexed: 63/63 files · 541 chunks (old data)
  • memory_search returns empty results with provider: "local"
  • Gateway logs contain zero mentions of embedding, reindex, llama, or local model loading
  • No errors, no warnings — completely silent failure

Additional Context

  • node-llama-cpp works correctly when tested directly:
$ node --input-type=module -e "
import { getLlama } from 'node-llama-cpp';
const llama = await getLlama();
const model = await llama.loadModel({ modelPath: '...' });
const ctx = await model.createEmbeddingContext();
const vec = await ctx.getEmbeddingFor('test');
console.log('dims:', vec.vector.length); // 768 ✅
"
  • npx node-llama-cpp inspect gpu shows Metal available, Apple M4 Pro
  • Also tried: pnpm rebuild node-llama-cpp, deleting SQLite and forcing rebuild (0/52 forever), multiple gateway restarts
  • Tested over 2 days with same result
  • Reverted to OpenAI embedding (works immediately)

Environment

  • OpenClaw version: 2026.2.13
  • Node: v22.22.0
  • OS: macOS 25.2.0 (arm64)
  • Hardware: Mac mini M4 Pro, 64GB RAM
  • node-llama-cpp: 3.15.1 (prebuilt binaries, Metal available)
  • Model: nomic-embed-text-v1.5.Q8_0.gguf (Q8_0, 139MB)
  • Memory files: 63 files, ~1MB total (largest 442KB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions