openclaw - ✅(Solved) Fix Make memory embedding retry/concurrency parameters configurable [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#68812Fetched 2026-04-19 15:07:06
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1referenced ×1

Fix Action

Fix / Workaround

  1. Rate limit hits: With concurrency=4, Gemini embedding RPM is frequently exceeded, causing 429 errors.
  2. Upgrade fragility: Every npm install / OpenClaw version upgrade overwrites the bundle, resetting these hardcoded values. Users must re-patch manually after each upgrade — it's a recurring tax.

PR fix notes

PR #68822: feat(memory): make embedding retry/concurrency parameters configurable

Description (problem / solution / changelog)

Summary

Hardcoded embedding constants (, , etc.) are hard to tune when using rate-limited providers like Gemini. This makes them configurable via openclaw.json.

Changes

  • Renamed module-level constants to DEFAULT_* and exported them
  • Added protected getters to MemoryManagerEmbeddingOps (abstract) that return defaults
  • Overridden in MemoryIndexManager to read from cfg.memorySearch.embedding.*

Config

All optional, current defaults preserved:

{
  "memorySearch": {
    "embedding": {
      "indexConcurrency": 4,
      "retryMaxAttempts": 3,
      "retryBaseDelayMs": 500,
      "retryMaxDelayMs": 8000
    }
  }
}

Closes #68812

Changed files

  • extensions/memory-core/src/memory/manager-embedding-ops.ts (modified, +26/-10)
  • extensions/memory-core/src/memory/manager.ts (modified, +15/-1)
  • openclaw-2026-04-15.log (added, +125/-0)

Code Example

{
  "memory": {
    "embedding": {
      "concurrency": 1,
      "retryBaseDelayMs": 15000,
      "retryMaxDelayMs": 120000
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

Providers like Gemini have strict per-minute (RPM) rate limits on embedding requests. Currently, three memory embedding parameters are hardcoded constants in the bundled manager JS:

  • EMBEDDING_INDEX_CONCURRENCY (default: 4) — indexing concurrency
  • EMBEDDING_RETRY_BASE_DELAY_MS (default: 500) — base retry delay
  • EMBEDDING_RETRY_MAX_DELAY_MS (default: 8000) — max retry delay

These are not configurable via openclaw.json. This causes two problems:

  1. Rate limit hits: With concurrency=4, Gemini embedding RPM is frequently exceeded, causing 429 errors.
  2. Upgrade fragility: Every npm install / OpenClaw version upgrade overwrites the bundle, resetting these hardcoded values. Users must re-patch manually after each upgrade — it's a recurring tax.

Proposed Solution

Add a new memory.embedding section to openclaw.json with configurable fields:

{
  "memory": {
    "embedding": {
      "concurrency": 1,
      "retryBaseDelayMs": 15000,
      "retryMaxDelayMs": 120000
    }
  }
}

Behavior:

  • If a config value is present, use it instead of the hardcoded default
  • If absent, fall back to the hardcoded default (backward compatible)
  • These values should be used in createMemoryEmbeddingRetryPolicy and embeddingIndexConcurrency in the manager bundle

Why it matters:

  • Gemini's free tier allows very few embedding requests per minute
  • Users on shared/hot tier accounts benefit from lower concurrency and longer retry backoff
  • This makes OpenClaw more provider-agnostic and self-healing for rate-limited embedding backends

extent analysis

TL;DR

To address rate limit issues and upgrade fragility, add a configurable memory.embedding section to openclaw.json to override hardcoded embedding parameters.

Guidance

  • Introduce a new memory.embedding configuration section in openclaw.json with fields for concurrency, retryBaseDelayMs, and retryMaxDelayMs to allow users to customize these values.
  • Update the manager bundle to use the configured values from openclaw.json if present, falling back to hardcoded defaults otherwise.
  • Adjust the createMemoryEmbeddingRetryPolicy and embeddingIndexConcurrency functions to utilize the new configurable values.
  • Test the changes with different configuration settings to ensure rate limit hits are reduced and the solution is backward compatible.

Example

{
  "memory": {
    "embedding": {
      "concurrency": 1,
      "retryBaseDelayMs": 15000,
      "retryMaxDelayMs": 120000
    }
  }
}

Notes

This solution assumes that the proposed configuration changes are sufficient to address the rate limit issues and upgrade fragility. However, the optimal values for concurrency, retryBaseDelayMs, and retryMaxDelayMs may vary depending on the specific use case and provider constraints.

Recommendation

Apply the proposed workaround by adding the configurable memory.embedding section to openclaw.json to allow users to customize embedding parameters and mitigate rate limit issues. This approach provides a flexible and provider-agnostic solution.

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