GoodMemGoodMem

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

ParameterTypeDescription
requestEmbeddersCreateRequestCreation request. Known modelIdentifier values fill provider, endpoint, dimensionality, and modality defaults.
requestOptionsProviderApiKeyOptions optionalProvider API key plus per-call signal, timeout, or headers.

Returns: Promise&lt;EmbedderResponseShape&gt;

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/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the embedder to delete
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;void&gt;

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/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the embedder to retrieve
optionsEmbeddersGetOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;EmbedderResponseShape&gt;

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

ParameterTypeDescription
optionsEmbeddersListOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Array&lt;EmbedderResponseShape&gt;&gt;

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/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe unique identifier of the embedder to update
requestUpdateEmbedderRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;EmbedderResponseShape&gt;

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.

FieldTypeRequiredDescription
displayNamestringyesUser-facing name of the embedder
descriptionstring | nullnoDescription of the embedder
providerTypeProviderTypeyesType of embedding provider
endpointUrlstringyesBase HTTP(S) endpoint for provider requests. Gemini endpoint URLs must not contain query parameters.
apiPathstring | nullnoProvider-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.
modelIdentifierstringyesModel identifier
dimensionalitynumberyesOutput vector dimensions
distributionTypeDistributionTypeyesType of embedding distribution (DENSE or SPARSE)
maxSequenceLengthnumber | nullnoMaximum input sequence length
supportedModalitiesArray&lt;Modality&gt; | nullnoSupported content modalities (defaults to TEXT if not provided)
credentialsEndpointAuthentication | nullnoStructured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers.
labelsRecord&lt;string, string&gt; | nullnoUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
ownerIdstring | nullnoOptional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_EMBEDDER is evaluated against the proposed embedder and owner.
embedderIdstring | nullnoOptional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use.
dashscopeApiDialectDashScopeApiDialect | nullnoDashScope 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.
geminiEndpointConfigGeminiEndpointConfig | nullnoGemini 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

FieldTypeRequiredDescription
embedderIdstringyesUnique identifier of the embedder
displayNamestringyesUser-facing name of the embedder
descriptionstring | nullnoDescription of the embedder
providerTypeProviderTypeyesType of embedding provider
endpointUrlstringyesCanonical base HTTP(S) endpoint used for provider requests.
apiPathstring | nullnoConfigured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud.
modelIdentifierstringyesModel identifier
dimensionalitynumberyesOutput vector dimensions
distributionTypeDistributionTypeyesType of embedding distribution (DENSE or SPARSE)
maxSequenceLengthnumber | nullnoMaximum input sequence length
supportedModalitiesArray&lt;Modality&gt;yesSupported content modalities
credentialsEndpointAuthentication | nullnoStored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses.
labelsRecord&lt;string, string&gt;yesUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
ownerIdstringyesOwner ID of the embedder
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the embedder
updatedByIdstringyesID of the user who last updated the embedder
dashscopeApiDialectDashScopeApiDialect | nullnoConfigured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect.
geminiEndpointConfigGeminiEndpointConfig | nullnoPersisted 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.

FieldTypeRequiredDescription
backendGeminiApiBackendyesGoogle API surface. UNSPECIFIED is invalid when this configuration is supplied on a write.
projectIdstring | nullnoGoogle Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project.
locationstring | nullnoGoogle Cloud location. Valid only for GOOGLE_CLOUD; omission defaults to global.

ListEmbeddersResponse

Response containing a list of embedders

FieldTypeRequiredDescription
embeddersArray&lt;EmbedderResponse&gt;yesList 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.

FieldTypeRequiredDescription
displayNamestring | nullnoUser-facing name of the embedder
descriptionstring | nullnoDescription of the embedder
endpointUrlstring | nullnoReplacement base HTTP(S) endpoint. Omit to preserve the stored value. Gemini endpoint URLs must not contain query parameters.
apiPathstring | nullnoReplacement 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.
modelIdentifierstring | nullnoModel identifier
dimensionalitynumber | nullnoOutput vector dimensions
distributionTypeDistributionType | nullnoType of embedding distribution (DENSE or SPARSE)
maxSequenceLengthnumber | nullnoMaximum input sequence length
credentialsEndpointAuthentication | nullnoReplace stored credentials. Omit this field to preserve the current credentials; a present empty payload is invalid and never clears them.
replaceLabelsRecord&lt;string, string&gt; | nullnoReplace all existing labels with these (mutually exclusive with mergeLabels)
mergeLabelsRecord&lt;string, string&gt; | nullnoMerge these labels with existing ones (mutually exclusive with replaceLabels)
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
dashscopeApiDialectDashScopeApiDialect | nullnoUpdate 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.
geminiEndpointConfigGeminiEndpointConfig | nullnoWhen 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

FieldTypeRequiredDescription
embedderIdstringyesUnique identifier of the embedder
displayNamestringyesUser-facing name of the embedder
descriptionstring | nullnoDescription of the embedder
providerTypeProviderType | nullyesType of embedding provider
endpointUrlstringyesCanonical base HTTP(S) endpoint used for provider requests.
apiPathstring | nullnoConfigured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud.
modelIdentifierstringyesModel identifier
dimensionalitynumberyesOutput vector dimensions
distributionTypeDistributionType | nullyesType of embedding distribution (DENSE or SPARSE)
maxSequenceLengthnumber | nullnoMaximum input sequence length
supportedModalitiesArray&lt;Modality | null&gt;yesSupported content modalities
credentialsEndpointAuthenticationResponseShape | nullnoStored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses.
labelsRecord&lt;string, string&gt;yesUser-defined labels for categorization
versionstring | nullnoVersion information
monitoringEndpointstring | nullnoMonitoring endpoint URL
ownerIdstringyesOwner ID of the embedder
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the embedder
updatedByIdstringyesID of the user who last updated the embedder
dashscopeApiDialectDashScopeApiDialect | nullnoConfigured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect.
geminiEndpointConfigGeminiEndpointConfigResponseShape | nullnoPersisted Gemini backend routing; present only for Gemini embedder resources.

GeminiEndpointConfigResponseShape

FieldTypeRequiredDescription
backendGeminiApiBackend | nullyesGoogle API surface. UNSPECIFIED is invalid when this configuration is supplied on a write.
projectIdstring | nullnoGoogle Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project.
locationstring | nullnoGoogle Cloud location. Valid only for GOOGLE_CLOUD; omission defaults to global.

ListEmbeddersResponseShape

FieldTypeRequiredDescription
embeddersArray&lt;EmbedderResponseShape&gt;yesList of embedder configurations