GoodMemGoodMem

Rerankers

Reranker management.

Methods on this page are called through client.rerankers.

client.rerankers.create

client.rerankers.create(request: RerankersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise<RerankerResponseShape>

Creates a new reranker configuration for ranking search results. Rerankers represent connections to different reranking API services (like TEI, OpenAI, etc.) and include all the necessary configuration to use them for result ranking. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another reranker exists with the same effective provider connection and model configuration for this owner after endpoint canonicalization and provider-default resolution. Equivalent credentials participate in the comparison. DEFAULTS: apiPath defaults to '/v2/rerank' for Cohere and '/rerank' for other providers if omitted; supportedModalities defaults to [TEXT] if omitted. OWNER DEFAULTS: Owner defaults to the authenticated principal unless ownerId is provided; CREATE_RERANKER is evaluated against the proposed reranker and owner. This operation is NOT idempotent - each request creates a new reranker record.

HTTP: POST /v1/rerankers

Parameters

ParameterTypeDescription
requestRerankersCreateRequestCreation 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;RerankerResponseShape&gt;

Example

const reranker = await client.rerankers.create(
  {
    displayName: "Doc Reranker",
    modelIdentifier: "rerank-2",
    labels: { env: "docs" },
  },
  { apiKey: "voyage-key-..." },
);

client.rerankers.delete

client.rerankers.delete(id: string, requestOptions?: RequestOptions): Promise<void>

Permanently deletes a reranker configuration. This operation cannot be undone and immediately removes the reranker record from the database. SIDE EFFECTS: Invalidates any cached references to this reranker; does not affect historical usage data or audit logs. Requires DELETE_RERANKER on the requested reranker. This operation is safe to retry - may return NOT_FOUND if already deleted.

HTTP: DELETE /v1/rerankers/&#123;id&#125;

Parameters

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

Returns: Promise&lt;void&gt;

Example

await client.rerankers.delete("your-reranker-id");

client.rerankers.get

client.rerankers.get(id: string, options?: RerankersGetOptions, requestOptions?: RequestOptions): Promise<RerankerResponseShape>

Retrieves the details of a specific reranker configuration by its unique identifier. Stored credentials are omitted unless includeCredentials is true and the caller also has READ_RERANKER_CREDENTIALS. Requires READ_RERANKER on the requested reranker. The service distinguishes a missing reranker from an existing reranker the caller cannot read. This is a read-only operation with no side effects and is safe to retry.

HTTP: GET /v1/rerankers/&#123;id&#125;

Parameters

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

Returns: Promise&lt;RerankerResponseShape&gt;

Example

const fetchedReranker = await client.rerankers.get("your-reranker-id");
console.log(fetchedReranker.displayName);

client.rerankers.list

client.rerankers.list(options?: RerankersListOptions, requestOptions?: RequestOptions): Promise<Array<RerankerResponseShape>>

Retrieves a list of reranker configurations accessible to the caller, with optional filtering. IMPORTANT: Pagination is NOT supported - all matching results are returned. Results are ordered by created_at descending. Stored credentials are never included in list responses. 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_RERANKER on the GoodMem instance. Each returned reranker must also be visible through READ_RERANKER; unauthorized rerankers are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility.

HTTP: GET /v1/rerankers

Parameters

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

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

Example

for (const item of await client.rerankers.list()) {
  console.log(item.rerankerId, item.displayName);
}

client.rerankers.update

client.rerankers.update(id: string, request: UpdateRerankerRequest, requestOptions?: RequestOptions): Promise<RerankerResponseShape>

Updates an existing reranker configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMMUTABLE FIELDS: providerType and ownerId cannot be changed after creation. SUPPORTED_MODALITIES UPDATE: If the array contains >=1 elements, it replaces the stored set; if empty or omitted, no change occurs and it does not count as an update by itself. Returns ALREADY_EXISTS if update would create an equivalent reranker configuration for this owner after endpoint canonicalization and provider-default resolution (HTTP 409 Conflict / ALREADY_EXISTS). Requires UPDATE_RERANKER on the requested reranker. This operation is idempotent.

HTTP: PUT /v1/rerankers/&#123;id&#125;

Parameters

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

Returns: Promise&lt;RerankerResponseShape&gt;

Example

const updatedReranker = await client.rerankers.update("your-reranker-id", {
  displayName: "Doc Reranker (updated)",
  mergeLabels: { version: "2" },
});
console.log(updatedReranker.rerankerId);

Data Models

Interfaces

ListRerankersResponse

Response containing a list of rerankers

FieldTypeRequiredDescription
rerankersArray&lt;RerankerResponse&gt;yesList of reranker configurations

RerankerCreationRequest

Request body for creating a new Reranker. A Reranker represents a configuration for reranking search results.

FieldTypeRequiredDescription
displayNamestringyesUser-facing name of the reranker
descriptionstring | nullnoDescription of the reranker
providerTypeProviderTypeyesType of reranking provider
endpointUrlstringyesAPI endpoint URL
apiPathstring | nullnoAPI path for reranking request (defaults: Cohere /v2/rerank, Jina /v1/rerank, others /rerank)
modelIdentifierstringyesModel identifier
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_RERANKER is evaluated against the proposed reranker and owner.
rerankerIdstring | 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 reranking default.

RerankerResponse

Reranker configuration information

FieldTypeRequiredDescription
rerankerIdstringyesUnique identifier of the reranker
displayNamestringyesUser-facing name of the reranker
descriptionstring | nullnoDescription of the reranker
providerTypeProviderTypeyesType of reranking provider
endpointUrlstringyesAPI endpoint URL
apiPathstring | nullnoAPI path for reranking request
modelIdentifierstringyesModel identifier
supportedModalitiesArray&lt;Modality&gt;yesSupported content modalities
credentialsEndpointAuthentication | nullnoStored credentials; present only when GetReranker explicitly requests them and the caller has READ_RERANKER_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 reranker
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the reranker
updatedByIdstringyesID of the user who last updated the reranker
dashscopeApiDialectDashScopeApiDialect | nullnoConfigured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect.

UpdateRerankerRequest

Request body for updating an existing Reranker. Only fields that should be updated need to be included. supportedModalities replaces the stored set only when the array contains at least one value; empty or omitted leaves it unchanged and does not count as an update by itself.

FieldTypeRequiredDescription
displayNamestring | nullnoUser-facing name of the reranker
descriptionstring | nullnoDescription of the reranker
endpointUrlstring | nullnoAPI endpoint URL
apiPathstring | nullnoAPI path for reranking request
modelIdentifierstring | nullnoModel identifier
supportedModalitiesArray&lt;Modality&gt; | nullnoUpdate supported modalities (if array contains >=1 elements, replaces stored set; if empty or omitted, no change and does not count as an update by itself)
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.

Response Shapes

Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.

ListRerankersResponseShape

FieldTypeRequiredDescription
rerankersArray&lt;RerankerResponseShape&gt;yesList of reranker configurations

RerankerResponseShape

FieldTypeRequiredDescription
rerankerIdstringyesUnique identifier of the reranker
displayNamestringyesUser-facing name of the reranker
descriptionstring | nullnoDescription of the reranker
providerTypeProviderType | nullyesType of reranking provider
endpointUrlstringyesAPI endpoint URL
apiPathstring | nullnoAPI path for reranking request
modelIdentifierstringyesModel identifier
supportedModalitiesArray&lt;Modality | null&gt;yesSupported content modalities
credentialsEndpointAuthenticationResponseShape | nullnoStored credentials; present only when GetReranker explicitly requests them and the caller has READ_RERANKER_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 reranker
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the reranker
updatedByIdstringyesID of the user who last updated the reranker
dashscopeApiDialectDashScopeApiDialect | nullnoConfigured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect.