← Back to PRs

#17546: feat(memory): add native google-vertex embedding provider

by mike-hyperverse open 2026-02-15 21:51 View on GitHub →
docs commands agents size: M
This PR adds native support for **Vertex AI embeddings** (GCP) to OpenClaw's memory search system. ### Key Changes: - **New Provider:** Added `google-vertex` as a first-class embedding provider. - **Service Account Auth:** Implemented OAuth token generation using `google-auth-library` to support Service Account keys (ADC) and `GOOGLE_APPLICATION_CREDENTIALS`. - **Regional Support:** Introduced a per-provider `location` setting in `memorySearch.remote`. This is essential for Vertex because embeddings are regional and cannot be used via the `global` endpoint. - **Schema Updates:** Updated Zod schemas and internal types to recognize the new provider and settings. - **Documentation:** Updated `docs/concepts/memory.md` with configuration examples. ### Why? Currently, the `gemini` provider assumes a public API key flow. Enterprise/Vertex users using service accounts lacked a way to authenticate the embedding requests. This bridge allows full GCP native auth. ### Testing: - Fully tested in a live environment using a Vertex Service Account. - Verified successful indexing and semantic search results using `text-embedding-004`. - Verified hierarchical location resolution (specific setting overrides global env). Human-guided by @hyperverse. 🕶️ <!-- greptile_comment --> <h3>Greptile Summary</h3> Added native Vertex AI embeddings support for GCP enterprise users with service account authentication. The implementation introduces `google-vertex` as a new embedding provider with OAuth token generation via `google-auth-library` and regional endpoint support through the new `location` setting in `memorySearch.remote`. **Key changes:** - New `embeddings-vertex.ts` provider with Service Account/ADC auth - Regional location support (essential for Vertex embeddings, which don't work on `global` endpoint) - Schema updates across config types and Zod schemas to recognize `google-vertex` provider - Documentation updated with configuration examples **Issues found:** - Missing `VertexEmbeddingClient` type import in `manager.ts` - Missing `vertex` property declaration and initialization in `MemoryIndexManager` class - These will cause TypeScript compilation errors The implementation follows established patterns from existing providers (Gemini, Voyage) and handles auth properly. <h3>Confidence Score: 2/5</h3> - This PR has critical TypeScript compilation errors that must be fixed before merging - Score reflects three critical logic errors in `manager.ts`: missing type import, missing property declaration, and missing property initialization for the `vertex` client. These will cause TypeScript compilation failures and runtime issues when using the google-vertex provider. The implementation is otherwise well-structured and follows existing patterns. - Pay close attention to `src/memory/manager.ts` - it's missing the `VertexEmbeddingClient` import, property declaration, and initialization <sub>Last reviewed commit: 4d50f2c</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs