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 identical {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, 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. DEFAULTS: apiPath defaults to '/v2/rerank' for Cohere and '/rerank' for other providers if omitted; supportedModalities defaults to [TEXT] if omitted. Requires CREATE_RERANKER_OWN permission (or CREATE_RERANKER_ANY for admin users). 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_OWN permission for rerankers you own (or DELETE_RERANKER_ANY for admin users). 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, requestOptions?: RequestOptions): Promise<RerankerResponseShape>

Retrieves the details of a specific reranker configuration by its unique identifier. Response payloads include stored credentials, matching gRPC response semantics. Requires READ_RERANKER_OWN permission for rerankers you own (or READ_RERANKER_ANY for admin users). 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
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. Responses include stored credentials, matching gRPC response semantics. 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_RERANKER_OWN permission, only your own rerankers are shown. With LIST_RERANKER_ANY permission, you can see all rerankers or filter by any ownerId. Specifying ownerId without LIST_RERANKER_ANY permission returns PERMISSION_DENIED.

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 duplicate with same {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, credentialsFingerprint} after URL canonicalization (HTTP 409 Conflict / ALREADY_EXISTS). Requires UPDATE_RERANKER_OWN permission for rerankers you own (or UPDATE_RERANKER_ANY for admin users). 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 ID. If not provided, derived from the authentication context. Requires CREATE_RERANKER_ANY permission if specified.
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.

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 | nullnoStructured credential payload used for upstream authentication
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

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 | nullnoStructured credential payload describing how to authenticate with the provider. Omit to keep existing credentials.
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

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 | nullnoStructured credential payload used for upstream authentication
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