GoodMemGoodMem
ReferenceSdkV2.NET

Embedders

Embedder management — provider configuration + lifecycle.

Namespace: Goodmem.Client.Api · Class: EmbeddersApi

Reach this surface as client.Embedders on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.

Methods

MethodSummary
CreateAsyncCreate a new embedder.
GetAsyncGet an embedder by ID.
ListAsyncList embedders.
UpdateAsyncUpdate an embedder.
DeleteAsyncDelete an embedder.

CreateAsync

Creates a new embedder configuration for vectorizing content. Embedders represent connections to different embedding API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them with memory spaces. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another embedder exists with identical {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, dimensionality, distributionType, credentialsFingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. The apiPath field defaults to '/v2/embed' for Cohere, '/embed' for TEI, and '/embeddings' for other providers when omitted. Requires CREATE_EMBEDDER_OWN permission (or CREATE_EMBEDDER_ANY for admin users).

Declaration

public Task<EmbedderResponse> CreateAsync(EmbedderCreationRequest request, string? apiKey = null, CancellationToken ct = default)

HTTPPOST /v1/embedders

Parameters

TypeNameDescription
EmbedderCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
stringapiKeyBare provider API key. The convenience layer auto-fills provider / endpoint / dimensionality from the bundled model registry and converts the key to structured credentials. Pass null to keep any credentials already set on request. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var embedder = await client.Embedders.CreateAsync(
    new EmbedderCreationRequest
    {
        DisplayName = "Doc Embedder",
        ModelIdentifier = "text-embedding-3-small",
        Labels = new Dictionary<string, string> { ["env"] = "docs" },
    },
    "sk-..."
);
Console.WriteLine(embedder.EmbedderId);


GetAsync

Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER_OWN permission for embedders you own (or READ_EMBEDDER_ANY for admin users to view any user's embedders). This is a read-only operation with no side effects.

Declaration

public Task<EmbedderResponse> GetAsync(string id, CancellationToken ct = default)

HTTPGET /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to retrieve
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var embedder = await client.Embedders.GetAsync("your-embedder-id");
Console.WriteLine(embedder.DisplayName);


ListAsync

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). PERMISSION-BASED FILTERING: With LIST_EMBEDDER_OWN permission, you can only see your own embedders (ownerId filter is ignored if set to another user). With LIST_EMBEDDER_ANY permission, you can see all embedders or filter by any ownerId. This is a read-only operation with no side effects.

Declaration

public Task<ListEmbeddersResponse> ListAsync(EmbeddersListOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/embedders

Parameters

TypeNameDescription
EmbeddersListOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<ListEmbeddersResponse> — an awaitable that resolves to ListEmbeddersResponse.

Exceptions

TypeCondition
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var resp = await client.Embedders.ListAsync();
foreach (var embedder in resp.Embedders)
    Console.WriteLine($"{embedder.EmbedderId} {embedder.DisplayName}");


UpdateAsync

Updates an existing embedder configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMPORTANT: providerType is IMMUTABLE after creation and cannot be changed. CRITICAL: Returns HTTP 412 Precondition Failed (FAILED_PRECONDITION) if attempting to update core fields (dimensionality, distributionType, modelIdentifier) while the embedder is actively referenced by spaces or ingestion jobs. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if the update would create a duplicate embedder with the same provider, endpoint, model, dimensionality, distribution, and credentials for this owner. Requires UPDATE_EMBEDDER_OWN permission for embedders you own (or UPDATE_EMBEDDER_ANY for admin users).

Declaration

public Task<EmbedderResponse> UpdateAsync(string id, UpdateEmbedderRequest request, CancellationToken ct = default)

HTTPPUT /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to update
UpdateEmbedderRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var updated = await client.Embedders.UpdateAsync(
    "your-embedder-id",
    new UpdateEmbedderRequest
    {
        DisplayName = "Doc Embedder (updated)",
        MergeLabels = new Dictionary<string, string> { ["version"] = "2" },
    }
);
Console.WriteLine(updated.EmbedderId);


DeleteAsync

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_OWN permission for embedders you own (or DELETE_EMBEDDER_ANY for admin users).

Declaration

public Task DeleteAsync(string id, CancellationToken ct = default)

HTTPDELETE /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to delete
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task — completes when the operation finishes; there is no response body.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

await client.Embedders.DeleteAsync("your-embedder-id");


Data Models

Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.

EmbedderCreationRequest

Request body for creating a new Embedder. An Embedder represents a configuration for vectorizing content.

PropertyTypeJSON (wire)Description
DisplayNamestringdisplayNameUser-facing name of the embedder
DescriptionstringdescriptionDescription of the embedder (optional)
ProviderTypeProviderTypeproviderTypeType of embedding provider
EndpointUrlstringendpointUrlAPI endpoint URL
ApiPathstringapiPathAPI path for embeddings request (defaults: Cohere /v2/embed, TEI /embed, others /embeddings) (optional)
ModelIdentifierstringmodelIdentifierModel identifier
DimensionalityintdimensionalityOutput vector dimensions
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
SupportedModalitiesIReadOnlyList<Modality>supportedModalitiesSupported content modalities (defaults to TEXT if not provided) (optional)
CredentialsEndpointAuthenticationcredentialsStructured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. (optional)
LabelsIReadOnlyDictionary<string, string>labelsUser-defined labels for categorization (optional)
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)
OwnerIdstringownerIdOptional owner ID. If not provided, derived from the authentication context. Requires CREATE_EMBEDDER_ANY permission if specified. (optional)
EmbedderIdstringembedderIdOptional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. (optional)

DistributionType

Type of embedding distribution produced by the embedder

String enum: "DENSE" · "SPARSE"

EmbedderResponse

Embedder configuration information

PropertyTypeJSON (wire)Description
EmbedderIdstringembedderIdUnique identifier of the embedder
DisplayNamestringdisplayNameUser-facing name of the embedder
DescriptionstringdescriptionDescription of the embedder (optional)
ProviderTypeProviderTypeproviderTypeType of embedding provider
EndpointUrlstringendpointUrlAPI endpoint URL
ApiPathstringapiPathAPI path for embeddings request (optional)
ModelIdentifierstringmodelIdentifierModel identifier
DimensionalityintdimensionalityOutput vector dimensions
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
SupportedModalitiesIReadOnlyList<Modality>supportedModalitiesSupported content modalities
CredentialsEndpointAuthenticationcredentialsStructured credential payload used for upstream authentication (optional)
LabelsIReadOnlyDictionary<string, string>labelsUser-defined labels for categorization
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)
OwnerIdstringownerIdOwner ID of the embedder
CreatedAtDateTimeOffsetcreatedAtCreation timestamp (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtLast update timestamp (milliseconds since epoch)
CreatedByIdstringcreatedByIdID of the user who created the embedder
UpdatedByIdstringupdatedByIdID of the user who last updated the embedder

ListEmbeddersResponse

Response containing a list of embedders

PropertyTypeJSON (wire)Description
EmbeddersIReadOnlyList<EmbedderResponse>embeddersList 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.

PropertyTypeJSON (wire)Description
DisplayNamestringdisplayNameUser-facing name of the embedder (optional)
DescriptionstringdescriptionDescription of the embedder (optional)
EndpointUrlstringendpointUrlAPI endpoint URL (optional)
ApiPathstringapiPathAPI path for embeddings request (optional)
ModelIdentifierstringmodelIdentifierModel identifier (optional)
DimensionalityintdimensionalityOutput vector dimensions (optional)
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE) (optional)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
CredentialsEndpointAuthenticationcredentialsStructured credential payload describing how to authenticate with the provider (optional)
ReplaceLabelsIReadOnlyDictionary<string, string>replaceLabelsReplace all existing labels with these (mutually exclusive with mergeLabels) (optional)
MergeLabelsIReadOnlyDictionary<string, string>mergeLabelsMerge these labels with existing ones (mutually exclusive with replaceLabels) (optional)
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)