GoodMem
ReferenceClient SDKsJavaScript SDK

Embedders API

Embedders API documentation for JavaScript SDK

All URIs are relative to http://localhost:8080

MethodHTTP requestDescription
createEmbedderPOST /v1/embeddersCreate a new embedder
deleteEmbedderDELETE /v1/embedders/{id}Delete an embedder
getEmbedderGET /v1/embedders/{id}Get an embedder by ID
listEmbeddersGET /v1/embeddersList embedders
updateEmbedderPUT /v1/embedders/{id}Update an embedder

createEmbedder

EmbedderResponse createEmbedder(embedderCreationRequest)

Create a new embedder

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 ALREADY_EXISTS if another embedder exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} 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 api_path field defaults to '/embeddings' if omitted. Requires CREATE_EMBEDDER_OWN permission (or CREATE_EMBEDDER_ANY for admin users).

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.EmbeddersApi();
let embedderCreationRequest = {"displayName":"OpenAI Embedding Model","description":"OpenAI text embedding model with 1536 dimensions","providerType":"OPENAI","endpointUrl":"https://api.openai.com/v1","apiPath":"/embeddings","modelIdentifier":"text-embedding-3-small","dimensionality":"1536","distributionType":"DENSE","maxSequenceLength":"8192","supportedModalities":["TEXT"],"credentials":{"kind":"CREDENTIAL_KIND_API_KEY","apiKey":{"inlineSecret":"sk-your-api-key-here"}},"labels":{"environment":"production","team":"nlp"}}; // EmbedderCreationRequest | Embedder configuration details
apiInstance.createEmbedder(embedderCreationRequest).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
embedderCreationRequestEmbedderCreationRequestEmbedder configuration details

Return type

EmbedderResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteEmbedder

deleteEmbedder(id)

Delete an embedder

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

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.EmbeddersApi();
let id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the embedder to delete
apiInstance.deleteEmbedder(id).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
idStringThe unique identifier of the embedder to delete

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getEmbedder

EmbedderResponse getEmbedder(id)

Get an embedder by ID

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.

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.EmbeddersApi();
let id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the embedder to retrieve
apiInstance.getEmbedder(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
idStringThe unique identifier of the embedder to retrieve

Return type

EmbedderResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listEmbedders

ListEmbeddersResponse listEmbedders(opts)

List embedders

Retrieves a list of embedder configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_EMBEDDER_OWN permission, you can only see your own embedders (owner_id filter is ignored if set to another user). With LIST_EMBEDDER_ANY permission, you can see all embedders or filter by any owner_id. This is a read-only operation with no side effects.

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.EmbeddersApi();
let opts = {
  'ownerId': "550e8400-e29b-41d4-a716-446655440000", // String | Filter embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter.
  'providerType': "OPENAI", // String | Filter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)
  'label': "?label.environment=production&label.team=nlp" // String | Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)
};
apiInstance.listEmbedders(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
ownerIdStringFilter embedders by owner ID. With LIST_EMBEDDER_ANY permission, omitting this shows all accessible embedders; providing it filters by that owner. With LIST_EMBEDDER_OWN permission, only your own embedders are shown regardless of this parameter.[optional]
providerTypeStringFilter embedders by provider type (e.g., OPENAI, OPENAI_COMPATIBLE, COHERE, etc.)[optional]
labelStringFilter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=nlp)[optional]

Return type

ListEmbeddersResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateEmbedder

EmbedderResponse updateEmbedder(id, updateEmbedderRequest)

Update an embedder

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: provider_type is IMMUTABLE after creation and cannot be changed. CRITICAL: Returns FAILED_PRECONDITION if attempting to update core fields (dimensionality, distribution_type, model_identifier) while the embedder is actively referenced by spaces or ingestion jobs. Requires UPDATE_EMBEDDER_OWN permission for embedders you own (or UPDATE_EMBEDDER_ANY for admin users).

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.EmbeddersApi();
let id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the embedder to update
let updateEmbedderRequest = {"displayName":"Updated Production Embedder","description":"Updated OpenAI embedding model with enhanced configuration for production use","endpointUrl":"https://api.openai.com/v1","apiPath":"/embeddings","modelIdentifier":"text-embedding-3-large","dimensionality":"3072","maxSequenceLength":"8192","supportedModalities":["TEXT"],"credentials":"{\\\"kind\\\":\\\"CREDENTIAL_KIND_API_KEY\\\",\\\"apiKey\\\":{\\\"inlineSecret\\\":\\\"sk-updated-api-key-here\\\"}}","version":"2.0.1","monitoringEndpoint":"https://monitoring.company.com/embedders/status","replaceLabels":{"environment":"production","team":"ml-platform","cost-center":"ai-infrastructure"}}; // UpdateEmbedderRequest | Embedder update details
apiInstance.updateEmbedder(id, updateEmbedderRequest).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
idStringThe unique identifier of the embedder to update
updateEmbedderRequestUpdateEmbedderRequestEmbedder update details

Return type

EmbedderResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json