#17701: fix(memory-lancedb): add gemini-embedding-001 and baseUrl support
extensions: memory-lancedb
stale
size: S
Cluster:
Memory Database Enhancements
## Summary
- Adds `gemini-embedding-001` (3072 dims) to the allowed embedding models
- Introduces `baseUrl` config option so users can point to Google's OpenAI-compatible endpoint (`https://generativelanguage.googleapis.com/v1beta/openai`) or any other compatible API
- Applies `resolveEnvVars` to `baseUrl` for `${ENV_VAR}` substitution, consistent with `apiKey` handling
Closes #17650
## Improvements over #17696
This PR addresses review feedback from #17696 that was left unresolved:
1. **`resolveEnvVars` on `baseUrl`** ([Copilot review](https://github.com/openclaw/openclaw/pull/17696#discussion_r2810471760)): `baseUrl` now supports `${ENV_VAR}` substitution, consistent with how `apiKey` is handled
2. **Missing `uiHints` in `config.ts`** ([Greptile review](https://github.com/openclaw/openclaw/pull/17696#issuecomment-3906198131)): Added `embedding.baseUrl` uiHints entry in `config.ts` to match `openclaw.plugin.json`
3. **Inconsistent help text** ([Greptile review](https://github.com/openclaw/openclaw/pull/17696#issuecomment-3906198131)): Updated `embedding.model` help to `"Embedding model to use (OpenAI or Gemini)"` in both `config.ts` and `openclaw.plugin.json`
4. **No test coverage**: Added two new tests — config accepts `gemini-embedding-001` with `baseUrl`, and env var resolution works on `baseUrl`
## Changes
- **config.ts**: Add `gemini-embedding-001` to `EMBEDDING_DIMENSIONS`, add `baseUrl` to type/parser/`assertAllowedKeys`, apply `resolveEnvVars`, add `uiHints`, update model help text
- **index.ts**: Pass `baseUrl` through `Embeddings` constructor to `OpenAI` client
- **openclaw.plugin.json**: Add `gemini-embedding-001` to enum, add `baseUrl` property, add uiHint, update model help text
- **index.test.ts**: Add tests for gemini model + baseUrl config and env var resolution on baseUrl
## Test plan
- [x] `pnpm vitest run extensions/memory-lancedb/` — 13 passed, 1 skipped (live test)
- [x] `pnpm build` passes
- [x] `pnpm oxfmt --check` passes on changed files
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds `gemini-embedding-001` (3072 dims) to the memory-lancedb plugin's allowed embedding models and introduces a `baseUrl` config option for pointing to Google's OpenAI-compatible endpoint or other compatible APIs. Environment variable substitution is applied to `baseUrl` consistent with `apiKey` handling.
- `config.ts`: Adds `gemini-embedding-001` to `EMBEDDING_DIMENSIONS`, adds `baseUrl` to the type/parser/allowed keys, applies `resolveEnvVars`, and adds `uiHints`
- `index.ts`: Passes `baseUrl` through the `Embeddings` constructor to the `OpenAI` client as `baseURL`
- `openclaw.plugin.json`: Adds `gemini-embedding-001` to the model enum, adds `baseUrl` property and uiHint
- `index.test.ts`: Adds tests for gemini model + baseUrl config parsing and env var resolution on baseUrl
- All four files are consistent with each other and follow existing patterns in the codebase
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it adds straightforward config options with proper validation and test coverage.
- The changes are well-contained to four files in a single extension, follow existing patterns (env var resolution, allowed keys validation, uiHints), and include test coverage. The new model entry and baseUrl passthrough are simple additions that don't modify existing behavior. No logical errors, security concerns, or breaking changes found.
- No files require special attention.
<sub>Last reviewed commit: e8b770e</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#20771: feat(memory-lancedb): support custom OpenAI-compatible embedding pr...
by marcodelpin · 2026-02-19
81.3%
#20315: fix(memory): add gemini-embedding-001 to GEMINI_MAX_INPUT_TOKENS
by Clawborn · 2026-02-18
80.4%
#17566: memory-lancedb: support local OpenAI-compatible embeddings
by lumenradley · 2026-02-15
79.1%
#23129: build(deps): move @discordjs/opus to optionalDependencies
by Imccccc · 2026-02-22
78.8%
#8675: fix: Gemini batch embeddings state path, enum values, and download URL
by seasalim · 2026-02-04
78.7%
#19006: feat(memory-lancedb): OpenAI-compatible baseUrl + Ollama provider +...
by martinsen-assistant · 2026-02-17
78.3%
#23424: feat: add Gemini 3.1 Pro Preview support (google-gemini-cli)
by hongchanroh · 2026-02-22
78.2%
#22899: fix(models): synthesize antigravity Gemini 3.1 pro high/low models
by Phineas1500 · 2026-02-21
76.9%
#21263: fix: add google-vertex support for Gemini 3.1 models
by pdd-cli · 2026-02-19
76.9%
#21181: fix(models): add gemini-3.1-pro-preview forward-compat for google-g...
by Mellowambience · 2026-02-19
76.8%