Embedders
Embedder management.
Methods on this page are called through client.embedders.
client.embedders.create
client.embedders.create(request: EmbeddersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise<EmbedderResponseShape>Creates an embedder configuration for use with memory spaces. If ownerId is omitted, the authenticated principal becomes the owner; CREATE_EMBEDDER is evaluated against that proposed embedder and owner. Returns 409 when an equivalent embedder configuration already exists for the owner. See the embedder provider guide for provider-specific configuration.
HTTP: POST /v1/embedders
Parameters
| Parameter | Type | Description |
|---|---|---|
request | EmbeddersCreateRequest | Creation request. Known modelIdentifier values fill provider, endpoint, dimensionality, and modality defaults. |
requestOptions | ProviderApiKeyOptions optional | Provider API key plus per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const embedder = await client.embedders.create(
{
displayName: "Doc Embedder",
modelIdentifier: "text-embedding-3-small",
labels: { env: "docs" },
},
{ apiKey: "sk-..." },
);client.embedders.delete
client.embedders.delete(id: string, requestOptions?: RequestOptions): Promise<void>Permanently deletes an embedder configuration. This operation cannot be undone and removes the embedder record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete embeddings previously created with this embedder - existing embeddings remain accessible. CONFLICT: Returns HTTP 409 Conflict if the embedder is still referenced by a space. Requires DELETE_EMBEDDER on the requested embedder.
HTTP: DELETE /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to delete |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<void>
Example
await client.embedders.delete("your-embedder-id");client.embedders.get
client.embedders.get(id: string, options?: EmbeddersGetOptions, requestOptions?: RequestOptions): Promise<EmbedderResponseShape>Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER on the requested embedder. The service distinguishes a missing embedder from an existing embedder the caller cannot read. This is a read-only operation with no side effects.
HTTP: GET /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to retrieve |
options | EmbeddersGetOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const fetchedEmbedder = await client.embedders.get("your-embedder-id");
console.log(fetchedEmbedder.displayName);client.embedders.list
client.embedders.list(options?: EmbeddersListOptions, requestOptions?: RequestOptions): Promise<Array<EmbedderResponseShape>>Retrieves a list of embedder configurations accessible to the caller, with optional filtering. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production). AUTHORIZATION: Requires LIST_EMBEDDER on the GoodMem instance. Each returned embedder must also be visible through READ_EMBEDDER; unauthorized embedders are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility. This is a read-only operation with no side effects.
HTTP: GET /v1/embedders
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EmbeddersListOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Array<EmbedderResponseShape>>
Example
for (const emb of await client.embedders.list()) {
console.log(emb.embedderId, emb.displayName);
}client.embedders.update
client.embedders.update(id: string, request: UpdateEmbedderRequest, requestOptions?: RequestOptions): Promise<EmbedderResponseShape>Updates explicitly supplied embedder fields; at least one mutable field is required. Field omission and reset semantics are defined by the request schema, and providerType cannot be changed. Returns 409 if the resulting configuration duplicates another embedder for the owner, and 412 when model-defining fields are changed while the embedder is in use. Requires UPDATE_EMBEDDER on the requested embedder. See the embedder provider guide for provider-specific configuration.
HTTP: PUT /v1/embedders/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the embedder to update |
request | UpdateEmbedderRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<EmbedderResponseShape>
Example
const updatedEmbedder = await client.embedders.update("your-embedder-id", {
displayName: "Doc Embedder (updated)",
mergeLabels: { version: "2" },
});
console.log(updatedEmbedder.embedderId);Data Models
Enum Values
DistributionType
DENSE, SPARSE
GeminiApiBackend
UNSPECIFIED, DEVELOPER, GOOGLE_CLOUD
Interfaces
EmbedderCreationRequest
Request body for creating a new Embedder. An Embedder represents a configuration for vectorizing content.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | yes | Type of embedding provider |
endpointUrl | string | yes | Base HTTP(S) endpoint for provider requests. Gemini endpoint URLs must not contain query parameters. |
apiPath | string | null | no | Provider-relative request path. Omit or send blank to use the provider default. For Gemini, this is an API version: /v1beta for Developer and /v1 for Google Cloud. |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality> | null | no | Supported content modalities (defaults to TEXT if not provided) |
credentials | EndpointAuthentication | null | no | Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. |
labels | Record<string, string> | null | no | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | null | no | Optional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_EMBEDDER is evaluated against the proposed embedder and owner. |
embedderId | string | null | no | Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. |
dashscopeApiDialect | DashScopeApiDialect | null | no | DashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to infer the dialect from apiPath, the model catalog, or the native text default. |
geminiEndpointConfig | GeminiEndpointConfig | null | no | Gemini backend routing. Valid only for the GEMINI provider. Omit to use the Developer API; when present, backend is required and the gRPC service validates the backend-specific projectId and location contract. |
EmbedderResponse
Embedder configuration information
| Field | Type | Required | Description |
|---|---|---|---|
embedderId | string | yes | Unique identifier of the embedder |
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | yes | Type of embedding provider |
endpointUrl | string | yes | Canonical base HTTP(S) endpoint used for provider requests. |
apiPath | string | null | no | Configured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud. |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality> | yes | Supported content modalities |
credentials | EndpointAuthentication | null | no | Stored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses. |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the embedder |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the embedder |
updatedById | string | yes | ID of the user who last updated the embedder |
dashscopeApiDialect | DashScopeApiDialect | null | no | Configured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect. |
geminiEndpointConfig | GeminiEndpointConfig | null | no | Persisted Gemini backend routing; present only for Gemini embedder resources. |
GeminiEndpointConfig
Gemini backend routing. DEVELOPER does not use projectId or location; GOOGLE_CLOUD requires projectId and defaults an omitted location to global.
| Field | Type | Required | Description |
|---|---|---|---|
backend | GeminiApiBackend | yes | Google API surface. UNSPECIFIED is invalid when this configuration is supplied on a write. |
projectId | string | null | no | Google Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project. |
location | string | null | no | Google Cloud location. Valid only for GOOGLE_CLOUD; omission defaults to global. |
ListEmbeddersResponse
Response containing a list of embedders
| Field | Type | Required | Description |
|---|---|---|---|
embedders | Array<EmbedderResponse> | yes | List of embedder configurations |
UpdateEmbedderRequest
Request body for updating an existing Embedder. Only fields that should be updated need to be included. supportedModalities is creation-time only and cannot be changed here.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | null | no | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
endpointUrl | string | null | no | Replacement base HTTP(S) endpoint. Omit to preserve the stored value. Gemini endpoint URLs must not contain query parameters. |
apiPath | string | null | no | Replacement provider-relative request path. Omit to preserve the stored value, except that changing the Gemini backend without apiPath selects that backend's default; send blank to restore the provider default. For Gemini, this is an API version: /v1beta for Developer and /v1 for Google Cloud. |
modelIdentifier | string | null | no | Model identifier |
dimensionality | number | null | no | Output vector dimensions |
distributionType | DistributionType | null | no | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
credentials | EndpointAuthentication | null | no | Replace stored credentials. Omit this field to preserve the current credentials; a present empty payload is invalid and never clears them. |
replaceLabels | Record<string, string> | null | no | Replace all existing labels with these (mutually exclusive with mergeLabels) |
mergeLabels | Record<string, string> | null | no | Merge these labels with existing ones (mutually exclusive with replaceLabels) |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
dashscopeApiDialect | DashScopeApiDialect | null | no | Update the DashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to preserve the stored dialect. Changing apiPath to a recognized canonical DashScope dialect infers its matching dialect; a custom path preserves an existing dialect, while a legacy null dialect is inferred. |
geminiEndpointConfig | GeminiEndpointConfig | null | no | When present, atomically replaces the complete Gemini backend routing configuration. Valid only for a GEMINI embedder. Omit to preserve the stored configuration; the gRPC service validates the backend-specific projectId and location contract. |
Response Shapes
Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.
EmbedderResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
embedderId | string | yes | Unique identifier of the embedder |
displayName | string | yes | User-facing name of the embedder |
description | string | null | no | Description of the embedder |
providerType | ProviderType | null | yes | Type of embedding provider |
endpointUrl | string | yes | Canonical base HTTP(S) endpoint used for provider requests. |
apiPath | string | null | no | Configured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud. |
modelIdentifier | string | yes | Model identifier |
dimensionality | number | yes | Output vector dimensions |
distributionType | DistributionType | null | yes | Type of embedding distribution (DENSE or SPARSE) |
maxSequenceLength | number | null | no | Maximum input sequence length |
supportedModalities | Array<Modality | null> | yes | Supported content modalities |
credentials | EndpointAuthenticationResponseShape | null | no | Stored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses. |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the embedder |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the embedder |
updatedById | string | yes | ID of the user who last updated the embedder |
dashscopeApiDialect | DashScopeApiDialect | null | no | Configured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect. |
geminiEndpointConfig | GeminiEndpointConfigResponseShape | null | no | Persisted Gemini backend routing; present only for Gemini embedder resources. |
GeminiEndpointConfigResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
backend | GeminiApiBackend | null | yes | Google API surface. UNSPECIFIED is invalid when this configuration is supplied on a write. |
projectId | string | null | no | Google Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project. |
location | string | null | no | Google Cloud location. Valid only for GOOGLE_CLOUD; omission defaults to global. |
ListEmbeddersResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
embedders | Array<EmbedderResponseShape> | yes | List of embedder configurations |