Reranker
Reranker service API reference
Services
RerankerService Service
Service for managing Rerankers in the GoodMem system.
Authentication: All methods require valid API key authentication via gRPC metadata:
- Metadata key:
authorization - Value format:
Bearer <api-key>
Global errors: All RPCs may return DEADLINE_EXCEEDED, CANCELLED, UNAVAILABLE, RESOURCE_EXHAUSTED, INTERNAL.
Permissions are enforced based on ownership and granted roles:
*_OWNpermissions allow operations on rerankers owned by the authenticated user*_ANYpermissions allow operations on rerankers owned by any user (admin-level)
CreateReranker
Summary: Creates a new neural reranking service configuration.
| Type | |
|---|---|
| Request | goodmem.v1.CreateRerankerRequest |
| Response | goodmem.v1.Reranker |
Auth: gRPC metadata authorization: Bearer <api-key>
Permissions Required: CREATE_RERANKER_OWN or CREATE_RERANKER_ANY
Request Parameters:
display_name(REQUIRED): User-facing name; ≤255 chars after trimmingdescription(OPTIONAL): Descriptive textprovider_type(REQUIRED): Service provider type; becomes IMMUTABLE after creationendpoint_url(REQUIRED): HTTP(S) URL; server canonicalizes by stripping trailing slashapi_path(OPTIONAL): API path component; defaults to"/rerank"if emptymodel_identifier(REQUIRED): Model name/ID; non-empty after trimmingsupported_modalities(OPTIONAL): Defaults to[TEXT]if omittedcredentials(OPTIONAL): Structured credentials; required only for SaaS providers that enforce authenticationlabels(OPTIONAL): ≤20 entries; keys/values ≤255 chars; keys[a-z0-9._-]version(OPTIONAL): Version informationmonitoring_endpoint(OPTIONAL): HTTP(S) URL for health/metricsowner_id(OPTIONAL): If provided, requiresCREATE_RERANKER_ANYpermission
Response:
- Returns the created Reranker with all fields populated
credentialsfield is omitted from response for security
Side Effects:
- Creates new reranker record in database
- Sets
owner_idto authenticated user or specified value (if permitted) - Sets
created_by_idto authenticated user - Performs duplicate detection based on
{endpoint_url, api_path, model_identifier}
Idempotency: Not idempotent - each call creates a new reranker. Clients SHOULD NOT auto-retry blindly.
Error Codes:
UNAUTHENTICATED: Missing or invalid authenticationPERMISSION_DENIED: User lacksCREATE_RERANKER_OWNorCREATE_RERANKER_ANYpermissionINVALID_ARGUMENT: Required fields empty/missing; invalid URLs; label constraints violated;provider_typeunspecifiedALREADY_EXISTS: Duplicate reranker exists with same{owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint}after URL canonicalization; credentials_fingerprint is SHA-256 hash of normalized credentialsINTERNAL: Unexpected server error
Examples:
grpcurl -plaintext \
-H 'authorization: Bearer <api-key>' \
-d '{
"display_name": "Cohere Rerank v3",
"provider_type": "COHERE",
"endpoint_url": "https://api.cohere.ai",
"model_identifier": "rerank-english-v3.0",
"credentials": "your-cohere-api-key"
}' \
localhost:8080 goodmem.v1.RerankerService/CreateRerankerNote: bytes fields in JSON must be base64.
GetReranker
Retrieves details of a specific reranker configuration.
| Type | |
|---|---|
| Request | goodmem.v1.GetRerankerRequest |
| Response | goodmem.v1.Reranker |
Auth: gRPC metadata authorization: Bearer <api-key>
Permissions Required: READ_RERANKER_OWN or READ_RERANKER_ANY
Side Effects: None (read-only operation)
Error Codes:
UNAUTHENTICATED: Missing or invalid authenticationPERMISSION_DENIED: User lacksREAD_RERANKER_OWNfor own resources orREAD_RERANKER_ANYfor othersINVALID_ARGUMENT: Invalidreranker_idformat (not 16-byte UUID)NOT_FOUND: Reranker with specified ID does not existINTERNAL: Unexpected server error
Idempotency: Read-only; safe to retry; results may differ as state changes.
Examples:
grpcurl -plaintext \
-H 'authorization: Bearer <api-key>' \
-d '{"reranker_id": "base64-encoded-uuid-bytes"}' \
localhost:8080 goodmem.v1.RerankerService/GetRerankerNote: bytes fields in JSON must be base64.
ListRerankers
Lists reranker configurations accessible to the authenticated user.
| Type | |
|---|---|
| Request | goodmem.v1.ListRerankersRequest |
| Response | goodmem.v1.ListRerankersResponse |
Auth: gRPC metadata authorization: Bearer <api-key>
Permissions Required: LIST_RERANKER_OWN or LIST_RERANKER_ANY
Request Parameters:
owner_id(optional, bytes UUID): Filter by owner; requiresLIST_RERANKER_ANYif not authenticated userprovider_type(optional): Filter by provider type;PROVIDER_TYPE_UNSPECIFIEDignoredlabel_selectors(optional): AND of exact key=value matches (case-sensitive)
Response:
- Returns list of Reranker records accessible to the user
credentialsfields omitted from all responses for security- Results ordered by
created_atdescending
Side Effects: None (read-only operation)
Error Codes:
UNAUTHENTICATED: Missing or invalid authenticationPERMISSION_DENIED: User lacksLIST_RERANKER_OWNor specifiedowner_idwithoutLIST_RERANKER_ANYINVALID_ARGUMENT: Invalidowner_idformat (not 16-byte UUID)INTERNAL: Unexpected server error
Idempotency: Read-only; safe to retry; results may change over time.
Examples:
grpcurl -plaintext \
-H 'authorization: Bearer <api-key>' \
-d '{"provider_type": "COHERE"}' \
localhost:8080 goodmem.v1.RerankerService/ListRerankersNote: bytes fields in JSON must be base64.
UpdateReranker
Updates mutable properties of a reranker configuration.
| Type | |
|---|---|
| Request | goodmem.v1.UpdateRerankerRequest |
| Response | goodmem.v1.Reranker |
Auth: gRPC metadata authorization: Bearer <api-key>
Permissions Required: UPDATE_RERANKER_OWN or UPDATE_RERANKER_ANY
Summary:
- Only mutable fields can be updated:
display_name,description,endpoint_url,api_path,model_identifier,supported_modalities,credentials,version,monitoring_endpoint, labels provider_typeandowner_idare immutable- Label updates support replace (clear all, set new) or merge (upsert) strategies
Side Effects:
- Persists changes; updates
updated_atandupdated_by_id - Performs duplicate detection if
endpoint_url,api_path, ormodel_identifierchanged
Error Codes:
UNAUTHENTICATED: Missing or invalid authenticationPERMISSION_DENIED: User lacksUPDATE_RERANKER_OWNfor own resources orUPDATE_RERANKER_ANYfor othersINVALID_ARGUMENT: Invalidreranker_idformat; both label strategies set;provider_typespecified; empty required fieldsNOT_FOUND: Reranker with specified ID does not existALREADY_EXISTS: Update would create duplicate with same{endpoint_url, api_path, model_identifier}INTERNAL: Unexpected server error
Idempotency: Idempotent with identical input; safe to retry.
Examples:
grpcurl -plaintext \
-H 'authorization: Bearer <api-key>' \
-d '{
"reranker_id": "base64-encoded-uuid-bytes",
"display_name": "Updated Reranker Name",
"merge_labels": {"labels": {"environment": "production"}}
}' \
localhost:8080 goodmem.v1.RerankerService/UpdateRerankerNote: bytes fields in JSON must be base64.
DeleteReranker
Permanently deletes a reranker configuration.
| Type | |
|---|---|
| Request | goodmem.v1.DeleteRerankerRequest |
| Response | google.protobuf.Empty |
Auth: gRPC metadata authorization: Bearer <api-key>
Permissions Required: DELETE_RERANKER_OWN or DELETE_RERANKER_ANY
Side Effects:
- Permanently removes reranker record from database
- Invalidates any cached references to this reranker
- Does not affect historical usage data or audit logs
Error Codes:
UNAUTHENTICATED: Missing or invalid authenticationPERMISSION_DENIED: User lacksDELETE_RERANKER_OWNfor own resources orDELETE_RERANKER_ANYfor othersINVALID_ARGUMENT: Invalidreranker_idformat (not 16-byte UUID)NOT_FOUND: Reranker with specified ID does not exist or was already deletedINTERNAL: Unexpected server error
Idempotency: Safe to retry; may return NOT_FOUND if already deleted or never existed.
Examples:
grpcurl -plaintext \
-H 'authorization: Bearer <api-key>' \
-d '{"reranker_id": "base64-encoded-uuid-bytes"}' \
localhost:8080 goodmem.v1.RerankerService/DeleteRerankerNote: bytes fields in JSON must be base64.
Messages
Reranker
Represents a connection to a neural reranking service for post-processing search results.
Rerankers improve search relevance by re-scoring and re-ordering initial retrieval results using sophisticated neural networks or large language models. This includes cross-encoder neural networks, LLM-based reranking services, and other AI-powered relevance models. Algorithmic rerankers (like MMR) are built into the platform and don't require configuration.
Security:
credentialsis INPUT_ONLY and is omitted from all responses.
Immutability:
provider_typeis IMMUTABLE after creation.owner_idis set at creation and cannot be modified.
Duplicate detection:
- Uniqueness is enforced per-owner by the combination of
{owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint}after URL canonicalization (trailing slash stripped, case-insensitive host comparison). - Credentials are hashed (SHA-256) for uniqueness checking while remaining encrypted for storage.
Notes:
- All timestamps are UTC (
google.protobuf.Timestamp).
See also: goodmem.v1.ProviderType, goodmem.v1.Modality
| Field | Type | Description |
|---|---|---|
reranker_id | bytes | OUTPUT_ONLY UUID (16 bytes); immutable primary identifier |
display_name | string | REQUIRED on create; ≤255 chars after trimming; cannot be empty; user-facing name |
description | string | OPTIONAL descriptive text |
provider_type | goodmem.v1.ProviderType | REQUIRED on create; IMMUTABLE thereafter; service provider type. See: goodmem.v1.ProviderType |
endpoint_url | string | REQUIRED HTTP(S) URL; server canonicalizes by stripping trailing slash; used in duplicate detection |
api_path | string | OPTIONAL API path component; defaults to "/rerank" if empty on create |
model_identifier | string | REQUIRED on create; non-empty after trimming; model name or ID |
supported_modalities | goodmem.v1.Modality | OUTPUT semantics: server-stored set; defaults to [TEXT] if omitted at create. See: goodmem.v1.Modality |
credentials | ...dmem.v1.EndpointAuthentication | INPUT_ONLY; optional when provider allows anonymous requests; never returned in responses |
labels | ...oodmem.v1.Reranker.LabelsEntry | OPTIONAL; ≤20 entries; keys/values ≤255 chars; keys [a-z0-9._-] case-sensitive; merge overwrites on exact key match |
version | string | OPTIONAL version information |
monitoring_endpoint | string | OPTIONAL HTTP(S) URL for health checks or metrics |
owner_id | bytes | OUTPUT_ONLY owner UUID (16 bytes); set at creation from auth context or request; immutable |
created_at | google.protobuf.Timestamp | OUTPUT_ONLY creation timestamp (UTC). See: `google.protobuf.Timestamp` |
updated_at | google.protobuf.Timestamp | OUTPUT_ONLY last modification timestamp (UTC). See: `google.protobuf.Timestamp` |
created_by_id | bytes | OUTPUT_ONLY creator user UUID (16 bytes); derived from auth context at creation |
updated_by_id | bytes | OUTPUT_ONLY last modifier user UUID (16 bytes); derived from auth context on update |
Reranker.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
CreateRerankerRequest
Structured request for creating a reranker configuration.
| Field | Type | Description |
|---|---|---|
reranker_id | bytes | Optional: client-provided UUID (16 bytes); server generates if omitted; returns ALREADY_EXISTS if ID exists |
display_name | string | Required: User-facing name (≤255 chars after trimming; cannot be empty) |
description | string | Optional: description of the reranker's purpose |
provider_type | goodmem.v1.ProviderType | Required: Provider type; PROVIDER_TYPE_UNSPECIFIED → INVALID_ARGUMENT. See: goodmem.v1.ProviderType |
endpoint_url | string | Required: HTTP(S) URL; server strips trailing slash; duplicate detection uses canonical form |
api_path | string | Optional: API path; if empty, defaults to "/rerank" |
model_identifier | string | Required: Model identifier string (non-empty after trimming) |
supported_modalities | goodmem.v1.Modality | Optional: supported modalities; empty defaults to TEXT only. See: goodmem.v1.Modality |
credentials | ...dmem.v1.EndpointAuthentication | Optional: structured credentials; required only for providers that mandate authentication |
labels | ...ateRerankerRequest.LabelsEntry | Optional: labels (≤20 entries; keys/values ≤255 chars; keys [a-z0-9._-], case-sensitive) |
version | string | Optional: version information for the model/service |
monitoring_endpoint | string | Optional: HTTP(S) URL for health/metrics |
owner_id | bytes | Optional: owner ID (16 bytes UUID); if omitted → authenticated user; requires CREATE_RERANKER_ANY if different from caller |
CreateRerankerRequest.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
GetRerankerRequest
Request for retrieving a specific reranker by ID.
| Field | Type | Description |
|---|---|---|
reranker_id | bytes | Required: Reranker ID (16 bytes UUID) |
ListRerankersRequest
Request for listing rerankers with optional filtering.
| Field | Type | Description |
|---|---|---|
owner_id | bytes | Optional: Filter by owner (16 bytes UUID); requires LIST_RERANKER_ANY if not caller |
provider_type | goodmem.v1.ProviderType | Optional: Filter by provider; PROVIDER_TYPE_UNSPECIFIED ignored. See: goodmem.v1.ProviderType |
label_selectors | ...ersRequest.LabelSelectorsEntry | Optional: Conjunction (AND) of exact key=value matches; case-sensitive |
ListRerankersRequest.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
ListRerankersResponse
Response containing rerankers accessible to the caller (credentials omitted for security).
| Field | Type | Description |
|---|---|---|
rerankers | goodmem.v1.Reranker | OUTPUT_ONLY list ordered by created_at DESC |
UpdateRerankerRequest
Structured request for updating mutable reranker fields. Omit properties to keep existing values.
| Field | Type | Description |
|---|---|---|
reranker_id | bytes | Required: UUID (16 bytes) of the reranker to update |
display_name | string | Optional: New display name (≤255 chars after trimming); omit to keep existing |
description | string | Optional: Updated description; omit to keep existing |
endpoint_url | string | Optional: Updated HTTP(S) URL; server strips trailing slash; omit to keep existing |
api_path | string | Optional: Updated API path; omit to keep existing |
model_identifier | string | Optional: Updated model identifier (non-empty after trimming); omit to keep existing |
supported_modalities | goodmem.v1.Modality | Optional: If provided with ≥1 entries, replaces stored set; omit or empty to leave unchanged. See: goodmem.v1.Modality |
credentials | ...dmem.v1.EndpointAuthentication | Update credentials; omit to leave unchanged; replaces stored payload when set |
version | string | Optional: Updated version information; omit to keep existing |
monitoring_endpoint | string | Optional: Updated monitoring endpoint URL; omit to keep existing |
replace_labels | goodmem.v1.StringMap | Replaces all labels with provided set (empty clears all labels). See: goodmem.v1.StringMap |
merge_labels | goodmem.v1.StringMap | Merges provided entries with existing labels (upsert semantics). See: goodmem.v1.StringMap |
DeleteRerankerRequest
Request for permanently deleting a reranker configuration.
| Field | Type | Description |
|---|---|---|
reranker_id | bytes | Required: Reranker ID (16 bytes UUID) |