#Switch to new gemini embedding model

1 messages · Page 1 of 1 (latest)

cerulean frigate
#

How do we switch the embedding model to the new Gemini embedding model? Gemini Embedding 2

terse nymphBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

slow relicBOT
#

If you mean the semantic memory embeddings used by memory_search, that’s controlled by agents.defaults.memorySearch (not your chat model).

1) Set Gemini as the embedding provider + set the model id

In ~/.openclaw/openclaw.json:

{
  agents: {
    defaults: {
      memorySearch: {
        provider: "gemini",
        model: "<<< Gemini Embedding 2 model id from Google docs >>>",
        // API key can come from env (GEMINI_API_KEY) or be set here:
        remote: { apiKey: "YOUR_GEMINI_API_KEY" },
      },
    },
#
  },
}

Notes:

  • OpenClaw just passes the model string through to the Gemini embeddings API — so you can switch to “Gemini Embedding 2” by setting memorySearch.model to the exact model name Google uses.
  • This needs a Gemini API key (GEMINI_API_KEY / models.providers.google.apiKey / memorySearch.remote.apiKey). Gemini CLI OAuth doesn’t cover embeddings.

Docs: https://docs.openclaw.ai/concepts/memory#gemini-embeddings-native

2) Reindex (because changing embedding model forces a rebuild)

openclaw memory status --deep --index
# or to force a full rebuild:
openclaw memory index --force
#

CLI docs: https://docs.openclaw.ai/cli/memory

If you tell me what exact Gemini model string Google calls “Embedding 2” (or paste the link), I can sanity-check that it matches what OpenClaw expects to send.

cerulean frigate
#

Model code is gemini-embedding-2-preview

slow relicBOT
#

Yep — OpenClaw will accept that model string as-is.

Set the memory embeddings config like this (this is what backs memory_search):

{
  agents: {
    defaults: {
      memorySearch: {
        provider: "gemini",
        model: "gemini-embedding-2-preview",
        // make sure the Gateway can resolve a Google/Gemini API key:
        // (either env GEMINI_API_KEY / GOOGLE_API_KEY, or set it here)
        remote: { apiKey: "GEMINI_API_KEY" },
      },
    },