#Switch to new gemini embedding model
1 messages · Page 1 of 1 (latest)
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
modelstring through to the Gemini embeddings API — so you can switch to “Gemini Embedding 2” by settingmemorySearch.modelto 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.
Model code is gemini-embedding-2-preview
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" },
},
},